6 Replies Latest reply on Oct 9, 2002 5:56 AM by Andi

    Deployment problems with JBoss 3.0.0/3.0.2 (Classpath/Classl

    Steffen Dingel Newbie

      When running our application (EAR file) which consists of several EJB-jars and library-jars on JBoss 3.0.0, we get an IllegalAccessException during a call from an EJB client. A class in one of the libraries tries to access another class within the same package of the same library. The accessed class has default (package) access, so this should be okay. But JBoss seems to have loaded the accessed class before, during a call from a Client to a different EJB using a different class loader instance. So the VM treats the classes as being in different packages.

      Experimenting with the classpath entries in the manifest files of the EJB-jars showed that removing the references to the libraries in all but one of the EJB-jars solves the problem on JBoss 3.0.0. The libraries are still visible from the other EJB-jars. Is this an intended behaviour of the JBoss class loader? It doesn't seem to conform with J2EE?!

      Deploying the same EAR on JBoss 3.0.2 results in the following exception:
      -------------------------------------------------------
      13:40:00,889 INFO [EjbModule] Registration is not done -> destroy
      13:40:00,909 ERROR [URLDeploymentScanner] Failed to deploy: org.jboss.deployment
      .scanner.URLDeploymentScanner$DeployedURL@f49cdda8{ url=file:/C:/jboss-3.0.2/ser
      ver/default/deploy/EaiTestApp.ear, deployedLastModified=0 }
      org.jboss.deployment.DeploymentException: error in create of EjbModule: file:/C:
      /jboss-3.0.2/server/default/tmp/deploy/server/default/deploy/EaiTestApp.ear/61.E
      aiTestApp.ear-contents/trend-eai.jar; - nested throwable: (javax.management.Inst
      anceAlreadyExistsException: jboss.j2ee:service=EjbModule,url=file%/C%/jboss-3.0.
      2/server/default/tmp/deploy/server/default/deploy/EaiTestApp.ear/61.EaiTestApp.e
      ar-contents/trend-eai.jar already registered.)
      --------------------------------------------------------
      (trend-eai.jar is one of our libraries).
      Until now, I didn't get the application to work on 3.0.2 at all. Removing the references from all EJB-jars results in a ClassNotFoundException (as you would expect).

      Any ideas?
      Thanks in advance!

      Steffen

        • 1. Re: Deployment problems with JBoss 3.0.0/3.0.2 (Classpath/Cl
          Peter Doornbosch Apprentice

          Steffen,

          I've seen that exception before: in my case it was caused by the fact that my ejb jars were not deployed in the correct order (there were some dependencies between them). Setting classpath entries in the manifest does not help in this case; what does help is to package the ejb-jars inside each other; then they are deployed in inside-out order.

          Furthermore, i'd advise you to put your library jars in the lib directory, or some other dir configured as classpath (see user-service.xml).

          Hope this helps,
          Peter.

          • 2. Re: Deployment problems with JBoss 3.0.0/3.0.2 (Classpath/Cl
            Adrian Brock Master

            This sounds like a bug.
            Looks like it is trying to deploy the ejb twice.

            Can you show the jar -tf for the ear
            The application.xml
            and the MANIFEST.MFs from the jars.

            Regards,
            Adrian

            • 3. Re: Deployment problems with JBoss 3.0.0/3.0.2 (Classpath/Cl
              Steffen Dingel Newbie

              Here's the additional information you reqested:

              output of 'jar -tf EaiTestApp.ear':
              ----------------------------------------------------
              META-INF/
              META-INF/MANIFEST.MF
              eai-test-beans.jar
              rsc-bol.jar
              trend-eai.jar
              trend-ejb-bridge.jar
              trend-message-dispatcher.jar
              trend-standard-business-service.jar
              META-INF/application.xml
              ----------------------------------------------------

              application.xml:
              ----------------------------------------------------
              <?xml version="1.0" encoding="UTF-8"?>
              <!DOCTYPE application PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application 1.2//EN" "http://java.sun.com/j2ee/dtds/application_1_2.dtd">

              <display-name>EaiTestApp</display-name>

              trend-message-dispatcher.jar


              trend-ejb-bridge.jar


              trend-standard-business-service.jar


              eai-test-beans.jar


              ----------------------------------------------------

              eai-test-beans.jar contains this MANIFEST.MF:
              ----------------------------------------------------
              Manifest-Version: 1.0
              Created-By: Ant 1.4.1
              Class-Path: trend-eai.jar rsc-bol.jar
              ----------------------------------------------------

              The other JARs have no classpath set, they all have this MANIFEST.MF:
              ----------------------------------------------------
              Manifest-Version: 1.0
              Created-By: Ant 1.4.1
              ----------------------------------------------------

              When deploying the application on other servers (WebLogic/WebSphere) we do set the classpath in the other MANIFEST.MF files, but as I explained in my first posting, this doesn't work for JBoss.

              May it be a problem that the EJB classes (remote interface, home interface and implementation) are in some cases not contained in the EJB-jar-file itself, but in a library (trend-eai.jar)?

              Steffen

              • 4. Re: Deployment problems with JBoss 3.0.0/3.0.2 (Classpath/Cl
                Adrian Brock Master

                Yes, this is definitly a bug.

                trend-eai.jar gets deployed twice or at least it
                tries.

                Regards,
                Adrian

                • 5. Re: Deployment problems with JBoss 3.0.0/3.0.2 (Classpath/Cl
                  Andi Newbie

                  Hi,

                  i have exactly the same problem.
                  But when a copy/remove the ear several times, the deployment suddenly works !!???
                  Any ideas ???

                  Regards,
                  Andi

                  • 6. Re: Deployment problems with JBoss 3.0.0/3.0.2 (Classpath/Cl
                    Andi Newbie

                    Hi ,

                    i have exactly the same problem.
                    But when i remove/copy the ear to the deploy directory for several times, it suddenly works.
                    Any ideas ??

                    Regards,
                    Andi