6 Replies Latest reply on Jan 25, 2013 8:05 AM by sfcoy

    Shared libraries like Websphere

    davadc88

      I'm migrating an application myapptest.ear from Websphere 6.1 to JBoss AS 7 and I read many discussions and the oficial documentation about shared libraries in JBoss AS 7. Now I have the modules, and the entries for global-modules in the file standalone.xml and I continue with the same error:

       

       

      09:00:57,687 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC0000

      1: Failed to start service jboss.deployment.subunit."myapptest.ear"."myapptestWeb.war".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.subunit."myapptest.ear"."myapptestWeb.war".

      POST_MODULE: Failed to process phase POST_MODULE of subdeployment "myapptestWeb.war" of deployment "myapptest.ear"

              at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]

              at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

              at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

              at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [rt.jar:1.7.0_09]

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.7.0_09]

              at java.lang.Thread.run(Unknown Source) [rt.jar:1.7.0_09]

      Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: Could not load home interface type es.bcn.doc.proxy_fwk.ejb.ProxyHome

              at org.jboss.as.ejb3.deployment.processors.EjbRefProcessor.processDescriptorEntries(EjbRefProcessor.java:91)

              at org.jboss.as.ee.component.deployers.AbstractDeploymentDescriptorBindingsProcessor.deploy(AbstractDeploymentDescriptorBindingsProcessor.java:100)

              at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]

              ... 5 more

      Caused by: java.lang.ClassNotFoundException: com.bicn.doc.proxy_fwk.ejb.ProxyHomefrom [Module "deployment.myapptest.ear.myapptestWeb.war:main" from Service Module Loader]

              at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)

              at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)

              at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)

              at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)

              at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)

              at java.lang.Class.forName0(Native Method) [rt.jar:1.7.0_09]

              at java.lang.Class.forName(Unknown Source) [rt.jar:1.7.0_09]

              at org.jboss.as.server.deployment.reflect.DeploymentClassIndex.classIndex(DeploymentClassIndex.java:54) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]

              at org.jboss.as.ejb3.deployment.processors.EjbRefProcessor.processDescriptorEntries(EjbRefProcessor.java:89)

              ... 7 more

      I don't understand the exception, because the Class com.bicn.doc.proxy_fwk.ejb.ProxyHomefrom is inside the correct place in the correct .jar . I have the next directories of modules:

           JBOSS_HOME/modules:

                imi

                     myapp_fwk

                          main

                               myapp_fwk.ear

                               myapp_fwkCommon.jar

                               myapp_fwkEJBClient.jar

                               appiio-2.0.2.jar

                               module.xml

       

      And here is the module.xml:

       

      <module xmlns="urn:jboss:module:1.1" name="imi.myapp_fwk">
      
          <resources>
              <resource-root path="myapp_fwk.ear"/>
              <resource-root path="myapp_fwkCommon.jar" />
              <resource-root path="myapp_fwkEJBClient.jar" />
              <resource-root path="appiio-2.0.2.jar" />
      
              <!-- Insert resources here -->
          </resources>
      
      </module>
      

       

      In the standalone.xml I have the next entries:

       

       

      <subsystem xmlns="urn:jboss:domain:ee:1.0">
           <global-modules>
                <module name="mi.myapp_fwk" slot="main"/>
           </global-modules>
      </subsystem>
      

       

      Any help or comment is good, thanks

        • 1. Re: Shared libraries like Websphere
          nickarls

          EAR:s should be deployed, using them as module resources is a bit... unusual.

           

          What is the structure of your ear, what do you have in the common and ejbclient jars?

          • 2. Re: Shared libraries like Websphere
            davadc88

            First, thank you Nicklas!

             

            Yes is unusual, and also is deployed. In my ear I have the next structure:

            mcicopiaproxytest.ear:

                 lib

                      commons-fileupload-1.2.jar

                      commons-io-1.4.jar

                 META-INF

                      application.xml

                      MANIFEST.MF

                 context.properties

                 myappproxytestWeb.war

             

            MANIFEST.MF:

             

            Manifest-Version: 1.0

            Dependencies: mi.myappdocffwk export,mi.myapp_fwk export,mi.apptinesug export,mi.appcopia export

             

            In jars I have this class com.bicn.doc.myapp_fwk.ejb.ProxyHomefrom and others.

            • 3. Re: Shared libraries like Websphere
              nickarls

              If it's one of the jars in the module, it might work (not sure stuff in the EJB in the module would be picked up)

              You could try add a dep to the module from the WAR manifest also (even if I think it should see it from the WAR manifest)

              • 4. Re: Shared libraries like Websphere
                davadc88

                Now I have the same entry in the MANIFEST.MF inside the .ear and the MANIFEST.MF inside the .war/META-INF/

                 

                The next image is the structure of my .ear:

                thanks

                 

                El mensaje fue editado por: David Castaño

                • 5. Re: Shared libraries like Websphere
                  davadc88

                  Now I found the specific error, the last error is derived from the exception java.lang.NoClassDefFoundError : javax/ejb/EJBObject.

                  • 6. Re: Shared libraries like Websphere
                    sfcoy

                    Your module needs some dependencies added to it:

                     

                    {code:xml}

                    <module ...>

                        ...

                        <dependencies>

                            <module name="javax.api"/>

                            <module name="javax.ejb.api" />

                        </dependencies>

                    </module>

                    {code}

                     

                    and possibly others.

                     

                    You can deduce them as needed from your jboss-as/modules/javax/... directories.