9 Replies Latest reply on Jan 26, 2004 11:06 AM by nagulapati

    "Class not found" while deploying

    marcomanco

      Have anybody had the same problem?

      While deploying an jar I get the message:

      Bean : SystemControlBean
      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: com.xxx.yyy.zzz.SystemControlBean

      The class is definitely in the jar and at the correct place. I do not understand that!

        • 1. Re: "Class not found" while deploying

          What about the other classes the bean depends upon?

          Regards,
          Adrian

          • 2. Re: "Class not found" while deploying
            marcomanco

            They are all there and in the correct path.

            Is it possible that JBoss has problems with EJBs which inheritate from other EJBs?
            My example is like that

            • 3. Re: "Class not found" while deploying

              Turn off strict verification in conf/jboss-service.xml
              see what real error you get.

              Regards,
              Adrian

              • 4. Re: "Class not found" while deploying
                marcomanco

                I tried that. And the problem is that I don't have all classes in the deploy-directory, I have also some libs in my classpath. The JBoss-Server is not able to find the classes from the classpath...
                And the path is definitely correct.
                The package-structure in the jar in the deploy-directory of the server is identical to the package in the jar from the classpath. Could this be a problem?

                • 5. Re: "Class not found" while deploying

                  Don't put things in the classpath. You lose class
                  visiblity.

                  e.g.

                  import in.classpath;

                  public class in.deploy
                  {
                  }

                  import another.in.deploy;

                  public class in.classpath
                  {
                  }

                  When jboss loads the class "in.deploy"
                  it will then load the class "in.classpath"
                  but the class "in.classpath" only has visibility
                  to classes in the classpath so it cannot
                  load the class "another.in.deploy".

                  Regards,
                  Adrian

                  • 6. Re:
                    erik777

                    Then how on earth do we use utility jars in our EJB modules? I am getting the same error because it can't find a superclass which is in a utility jar. I put the utility jar in the EAR root and included

                    Class-Path: OSnetHelper.jar

                    in the ear's manifest. This works on WSAD and is supposed to be part of the J2EE standard, or at least that's my understanding. I upgraded from JBoss 3.0.6 to 3.2.3 in hopes this issue would finally be resolved, but all that did was get rid of the error regarding the classpath. It still can't find the superclass.

                    What good are utility jars if we can't use them. This is not a minor inconvenience. An entire framework is in the utility jar for creating EJB applications that relies heavily on inheritence to implement. Additional, i'm trying to bring a componentized project to project status, but that requires complex component interdependencies and distribution in the EJB tier.

                    Has anyone ever been able to get utility jars to be deployable in the ear and accessible in the EJB module in JBoss? If so, have you discovered limitations?

                    Does anyone else believe this is a serious requirement for both J2EE compliance and highly componentized deployment models required for enterprise scalability and component marketability?

                    • 7. Re:
                      nagulapati

                      Hello Erik,

                      I am having a similar kind of problem. My EJB bean is instantiating an object of an external class and I tried deploying the bean. I am always getting the "NoClassDefFoundError" which is real frustrating.

                      I packed the external classes into EJB's jar file but I really dont understand why it is not recognizing them?

                      Is anyone successful in making an utility jar working? I can pack my external classes into an utility jar and can try a work around. I also tried including the utility jar in the MANIFEST.INF but in vain :(

                      Any pointers?
                      Vivek

                      • 8. Re:
                        kself

                        I have had many problems with JBoss (various versions) and locating custom (i.e. Utility class) jars. Many of our EJS's are dependent on inheriting from such jars. At first the only way to get this to work was to place inherited classes (in there jars) directly into the jre (<Java_home>/jre/lib/ext) which is not recommended normally, and we had to also place several jboss jars to make it work. However, with JBoss 3.2.3 I again spent a week trying to get things to work and I found that if you place the jars in the /server/default/lib directory, and not place a reference to it on the classpath, then JBoss's classloader was able to locate the classes.

                        • 9. Re:
                          nagulapati

                          Hello All,

                          I am using JBoss 3.2.1 version, does anyone know how to deploy an EJB bean which accesses an external class?

                          I tried placing the jar with all the external classes in the "server/default/lib" directory but I am getting the same error which says that it cannot find the external class.

                          Any help would be appreciated!

                          Thanks,
                          Vivek