4 Replies Latest reply on Sep 22, 2011 6:14 AM by jaikiran

    Class loading problem regarding ear's lib directory

    mign

      I have an ear artifact like this:

       

      asepdemo-ear-1.1.0-SNAPSHOT.ear

      - lib

        - aseplib-commons-1.4.4-SNAPSHOT.jar (contains class AsepException)

        - ...

      - aseplib-server-1.4.4-SNAPSHOT.jar

      - ...

       

      It seems that my subdeployment aseplib-server does not have access to the libs in the lib directory:

       

      11:09:42,683 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC00001: Failed to start service jboss.deployment.subunit."asepdemo-ear-1.1.0-SNAPSHOT.ear"."asepli

      b-server-1.4.4-SNAPSHOT.jar".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.subunit."asepdemo-ear-1.1.0-SNAPSHOT.ear"."aseplib-server-1.4.4-SN

      APSHOT.jar".POST_MODULE: Failed to process phase POST_MODULE of subdeployment "aseplib-server-1.4.4-SNAPSHOT.jar" of deployment "asepdemo-ear-1.1.0-SNAPSHOT.ear"

              at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:121)

              at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1765)

              at org.jboss.msc.service.ServiceControllerImpl$ClearTCCLTask.run(ServiceControllerImpl.java:2291)

              at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_21]

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_21]

              at java.lang.Thread.run(Thread.java:619) [:1.6.0_21]

      Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: java.lang.ClassNotFoundException:

                                      de.xy.platform.errorhandling.AsepException

                               from [Module "deployment.asepdemo-ear-1.1.0-SNAPSHOT.ear.aseplib-server-1.4.4-SNAPSHOT.jar:main" from Service Module Loader]

              at org.jboss.as.ejb3.deployment.EjbJarDescription.prepareApplicationExceptions(EjbJarDescription.java:155)

              at org.jboss.as.ejb3.deployment.EjbJarDescription.prepareEjbJarConfiguration(EjbJarDescription.java:144)

              at org.jboss.as.ejb3.deployment.EjbJarDescription.createEjbJarConfiguration(EjbJarDescription.java:132)

              at org.jboss.as.ejb3.deployment.processors.EjbJarConfigurationProcessor.deploy(EjbJarConfigurationProcessor.java:46)

              at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:115)

              ... 5 more

       

       

      Is there any configuration needed?

       

      I already added

       

      <jboss-deployment-structure>

        <!-- Make sub deployments isolated by default, so they cannot see each others classes without a Class-Path entry -->

        <ear-subdeployments-isolated>false</ear-subdeployments-isolated>

      </jboss-deployment-structure>

        • 1. Re: Class loading problem regarding ear's lib directory
          mign

          I have several subdeployments like subdeployment aseplib-server. Maybe that is the problem?

          • 2. Re: Class loading problem regarding ear's lib directory
            mign

            I placed jboss-deployment-structure.xml in META-INF in my ear, but it is NOT read at all. At least if I enter any nonsense in this file it does not lead to an exception...

            • 3. Re: Class loading problem regarding ear's lib directory
              mign

              So the problem was not really related to class loading. If you have an ejb-jar.xml like

               

                     <application-exception>

                          <exception-class>

                            de.xyz.platform.errorhandling.AsepException

                          </exception-class>

                          <rollback>true</rollback>

                      </application-exception>

               

              dear JBoss is not even capable of triming away white spaces, but it tries to load "

                       de.xyz.platform.errorhandling.AsepException

              " class.

              • 4. Re: Class loading problem regarding ear's lib directory
                jaikiran

                mign wrote:

                 

                If you have an ejb-jar.xml like

                 

                            <exception-class>

                              de.xyz.platform.errorhandling.AsepException

                            </exception-class>

                 

                dear JBoss is not even capable of triming away white spaces, but it tries to load "

                         de.xyz.platform.errorhandling.AsepException

                " class.

                 

                Please create a JIRA for that. It's a bug. The exception-class value ultimately resolves to a javee:string type which says:

                 

                <xsd:complexType name="string">
                    <xsd:annotation>
                      <xsd:documentation>
                
                        This is a special string datatype that is defined by Java EE as
                        a base type for defining collapsed strings. When schemas
                        require trailing/leading space elimination as well as
                        collapsing the existing whitespace, this base type may be
                        used.
                
                      </xsd:documentation>
                    </xsd:annotation>
                    <xsd:simpleContent>
                      <xsd:extension base="xsd:token">
                        <xsd:attribute name="id"
                                       type="xsd:ID"/>
                      </xsd:extension>
                    </xsd:simpleContent>
                  </xsd:complexType>
                

                 

                So the trailing/leading whitespace should have been eliminated while loading the class.