9 Replies Latest reply on Oct 14, 2002 1:17 PM by Adrian Brock

    Deplyment error: Class not found

    Henrik Andersson Newbie


      I'm trying to deploy a simple entity bean using the standard template. I have these files in the directory project/src/main/ejb/trs/entity:


      All with "package trs.entity;"

      When I try to deploy I get:

      18:03:12,560 INFO [EJBDeployer]
      Bean : trs.entity.Sal
      Section: 22.2
      Warning: The Bean Provider must specify the fully-qualified name of the Java class that implements the enterprise bean's business methods in the <ejb-class> element.
      Info : Class not found: trs.entity.SalCMP

      18:03:12,586 INFO [EjbModule] Creating
      18:03:12,830 INFO [EjbModule] Deploying trs.entity.Sal
      18:03:16,001 WARN [ServiceController] Problem creating service jboss.j2ee:service=EJB,jndiName=trs/entity/Sal
      java.lang.ClassNotFoundException: trs.interfaces.SalHome
      at java.net.URLClassLoader$1.run(URLClassLoader.java:198)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:299)

      And so on....

      What am I doing wrong?



        • 1. Re: Deplyment error: Class not found
          prabhakar chaganti Apprentice

          How are you creating the deployment descriptors. Are you using the ant build file with the template?


          • 3. Re: Deplyment error: Class not found
            prabhakar chaganti Apprentice

            Check and make sure that all of the interfaces are being generated by the build script. What version of xdoclet are you using?


            • 4. Re: Deplyment error: Class not found
              Henrik Andersson Newbie


              These are the files that are generated:


              • 5. Re: Deplyment error: Class not found
                Adrian Brock Master

                You're doing something wrong?

                With Xdoclet, you only need SalBean,
                the Sal and SalHome should be generated.


                • 6. Re: Deplyment error: Class not found
                  Henrik Andersson Newbie

                  Ok, that sounds nice.

                  I deleted the files I've created except the Bean, but the error remains.

                  Here's the code:

                  package trs.entity;

                  import java.util.Collection;
                  import javax.ejb.EntityBean;
                  import javax.ejb.EntityContext;
                  import javax.ejb.RemoveException;
                  import javax.ejb.CreateException;

                  public abstract class SalBean implements EntityBean
                  public abstract void setSalsId(String sals_id);
                  public abstract String getSalsId();
                  public abstract void setByggnad(String byggnad);
                  public abstract String getByggnad();
                  public abstract Collection getDatorer();
                  public String ejbCreate(String sals_id, String byggnad) throws CreateException
                  return null;
                  public void ejbPostCreate(String sals_id, String byggnad) {}

                  public void ejbRemove() throws RemoveException {}
                  public void ejbActivate() {}
                  public void ejbPassivate() {}
                  public void ejbLoad() {}
                  public void ejbStore() {}
                  public void setEntityContext(EntityContext ec) {}
                  public void unsetEntityContext() {}

                  Here's .ant.properties:

                  type.mapping=PostgreSQL 7.2

                  When I start JBoss this is the classpath I see:

                  CLASSPATH: /usr/local/jboss/bin/run.jar:/usr/local/j2sdk1.4.1/lib/tools.jar

                  JBoss complains: Class not found: trs.entity.SalCMP
                  java.lang.ClassNotFoundException: trs.interfaces.SalHome

                  though they exist in build/classes/trs/entity/SalCMP.class

                  • 7. Re: Deplyment error: Class not found
                    Adrian Brock Master

                    I don't see any xdoclet tags in your source?

                    You've included all the classes in your deployed jar?


                    • 8. Re: Deplyment error: Class not found
                      Henrik Andersson Newbie

                      ...no. That I forgot.

                      I copied the tag from the example and changed it a bit:

                      * This is the Sal entity bean. It is an example of how to use the
                      * EJBDoclet tags.
                      * @ejb.bean
                      * name="trs/Sal"
                      * type="CMP"
                      * jndi-name="ejb/trs/Sal"
                      * @ejb:env-entry name="SequenceName"
                      * value="Sal"
                      * @ejb:ejb-ref ejb-name="trs/SequenceGenerator"
                      * @ejb.transaction
                      * type="Required"
                      * @ejb:data-object extends="trs.interfaces.AbstractData"
                      * setdata="false"
                      * @ejb.finder
                      * signature="java.util.Collection findAll()"
                      * unchecked="true"
                      * setdata="false" * @ejb:finder signature="java.util.Collection findAll()"
                      * @ejb:finder signature="trs.interfaces.Sal findByName(java.lang.String sals_id)"
                      * @jboss:table-name table-name="Sal"
                      * @jboss:create-table create="true"
                      * @jboss:remove-table remove="true"


                      When I try this I get:

                      SalBean.java:8: cannot resolve symbol
                      [ejbdoclet] symbol : class SequenceGenerator
                      [ejbdoclet] location: package interfaces
                      [ejbdoclet] import trs.interfaces.SequenceGenerator;

                      I guess it's something simple.

                      Thanks for your time


                      • 9. Re: Deplyment error: Class not found
                        Adrian Brock Master

                        Do you have such a class?

                        Sometimes xdoclet prints "Cannot resolve symbol"
                        messages for classes it is going to generate.
                        It is just a warning.
                        This is usually on the first compile. Once it is
                        generated, the message goes away.

                        I think the example project includes an example for
                        generating entity bean keys. Did you copy it and
                        change the package name?

                        You are probably best asking in the
                        "Getting Started Documentation" forum.
                        Andreas can probably answer your questions better,
                        he wrote the example :-)