10 Replies Latest reply on Aug 11, 2011 10:38 AM by jaikiran pai

    What is the JBoss Module name for a deployed jar

    Zemian Deng Apprentice

      Hi here,

       

      If I have a jar file deployed under $AS7/standalone/deployments/my.jar, would this be automatically availabe as an implicit JBoss module that can be reference by other module? If yes, what will this name be?

       

      Thanks.

        • 1. Re: What is the JBoss Module name for a deployed jar
          Gonne Martens Novice

          If it is possible I assume that the Name would be deployment.my.jar

           

          Regards,

          Gonne

          • 2. Re: What is the JBoss Module name for a deployed jar
            jaikiran pai Master

            For top-level deployments it's deployment.<deployment-filename>. For example, a ear deployment named myapp.ear will have  deployment.myapp.ear as its module identifier.

             

            For subdeployments, it's deployment.<top-level-deployment-filename>.<relativepath-to-subdeployment>. For example, if myejb.jar is packaged at the root of myapp.ear then the module identifier of myejb.jar will be  deployment.myapp.ear.myejb.jar.

            • 3. Re: What is the JBoss Module name for a deployed jar
              Zemian Deng Apprentice

              Thanks for the reply Jaikiran and Gonne!

               

              I have verified and it worked as you described. I think this is a good piece of info that should be captured in the DeveloperGuide, which currently I don't see it been documented.

              • 4. Re: What is the JBoss Module name for a deployed jar
                Antonio Bruno Newbie

                Ok. I added the line in the manifest:
                Dependencies: deployment.myapp.ear.myejb.jar
                and everything is working properly.

                 

                But if I have to import two or more jars I have tried:
                Dependencies: deployment.myapp.ear.myejb.jar, deployment.myapp.ear.myejb2.jar
                and JBoss is in error:

                 

                18:45:14,126 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC00001: Failed to start service jboss.deployment.unit."prova2.war".STRUCTURE: org.jboss.msc.service.StartException in service jboss.deployment.unit."prova2.war".STRU

                CTURE: Failed to process phase STRUCTURE of deployment "prova2.war"        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_20]

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

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

                Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: Failed to get manifest for deployment "/C:/jbossas700Final/bin/content/prova2.war"

                        at org.jboss.as.server.deployment.module.ManifestAttachmentProcessor.deploy(ManifestAttachmentProcessor.java:73)

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

                        ... 5 more

                Caused by: java.io.IOException: line too long

                        at java.util.jar.Attributes.read(Attributes.java:362) [:1.6.0_20]

                        at java.util.jar.Manifest.read(Manifest.java:182) [:1.6.0_20]

                        at java.util.jar.Manifest.<init>(Manifest.java:52) [:1.6.0_20]

                        at org.jboss.vfs.VFSUtils.readManifest(VFSUtils.java:215)

                        at org.jboss.vfs.VFSUtils.getManifest(VFSUtils.java:198)

                        at org.jboss.as.server.deployment.module.ManifestAttachmentProcessor.deploy(ManifestAttachmentProcessor.java:69)

                        ... 6 more

                 

                18:45:14,128 INFO  [org.jboss.as.server.controller] (DeploymentScanner-threads -

                1) Deployment of "prova2.war" was rolled back with failure message {"Failed services" => {"jboss.deployment.unit.\"prova2.war\".STRUCTURE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"prova2.war\".STRUCTURE:

                Failed to process phase STRUCTURE of deployment \"prova2.war\""}}

                18:45:14,129 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) Stopped deployment prova2.war in 0ms

                18:45:14,130 ERROR [org.jboss.as.deployment] (DeploymentScanner-threads - 2) {"Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"Failed services" => {"jboss.deployment.unit.\"prova2.war\".STRUCTURE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"prova2.war\".STRUCTURE: Failed to process phase STRUCTURE of deployment \"prova2.war\""}}}}

                 

                 

                Regards,

                Antonio

                • 5. Re: What is the JBoss Module name for a deployed jar
                  Gonne Martens Novice

                  No line may be longer than 72 bytes (not characters), in its UTF8-encoded form. If a value would make the initial line longer than this, it should be continued on extra lines (each starting with a single SPACE).

                  • 6. Re: What is the JBoss Module name for a deployed jar
                    Antonio Bruno Newbie

                    I have created an ear (applib.ear) where I put all my external libraries.
                    In my application "prova2.war" I put the file jboss-deploy-structure.xml
                    in the META-INF directory (see attachment)

                     

                    But if I try to deploy "prova2.war" JBoss goes wrong:

                     

                    12:13:25,724 INFO  [org.jboss.weld] (MSC service thread 1-4) Processing CDI deployment: prova2.war

                    12:13:25,728 WARN  [org.jboss.modules] (MSC service thread 1-4) Failed to define class org.apache.cxf.transport.servlet.AbstractHTTPServlet in Module "deployment.applib.ear.cxf-rt-transports-http-2.4.1.jar:main" from Service Module Loader: java.lang.LinkageError: Failed to link org/apache/cxf/transport/servlet/AbstractHTTPServlet (Module "deployment.applib.ear.cxf-rt-transports-http-2.4.1.jar:main" from Service Module Loader)

                        at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:401)

                        at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:261)

                        at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:76)

                        at org.jboss.modules.Module.loadModuleClass(Module.java:588)

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

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

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

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

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

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

                        at java.lang.ClassLoader.defineClass1(Native Method) [:1.6.0_20]

                        at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632) [:1.6.0_20]

                        at java.lang.ClassLoader.defineClass(ClassLoader.java:616) [:1.6.0_20]

                        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141) [:1.6.0_20]

                        at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:397)

                        at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:261)

                        at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:76)

                        at org.jboss.modules.Module.loadModuleClass(Module.java:588)

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

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

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

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

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

                        at java.lang.ClassLoader.defineClass1(Native Method) [:1.6.0_20]

                        at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632) [:1.6.0_20]

                        at java.lang.ClassLoader.defineClass(ClassLoader.java:616) [:1.6.0_20]

                        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141) [:1.6.0_20]

                        at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:397)

                        at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:261)

                        at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:76)

                        at org.jboss.modules.Module.loadModuleClass(Module.java:588)

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

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

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

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

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

                        at java.lang.Class.forName0(Native Method) [:1.6.0_20]

                        at java.lang.Class.forName(Class.java:247) [:1.6.0_20]

                        at org.jboss.as.ee.component.EEClassConfigurationProcessor.deploy(EEClassConfigurationProcessor.java:93)

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

                        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_20]

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

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

                    Caused by: java.lang.NoClassDefFoundError: javax/servlet/http/HttpServlet

                        at java.lang.ClassLoader.defineClass1(Native Method) [:1.6.0_20]

                        at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632) [:1.6.0_20]

                        at java.lang.ClassLoader.defineClass(ClassLoader.java:616) [:1.6.0_20]

                        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141) [:1.6.0_20]

                        at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:397)

                        ... 44 more

                    Caused by: java.lang.ClassNotFoundException: javax.servlet.http.HttpServlet from [Module "deployment.applib.ear.cxf-rt-transports-http-2.4.1.jar:main" from Service Module Loader]

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

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

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

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

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

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

                        ... 49 more

                     

                     

                    Thanks in advance

                    Antonio

                    • 7. Re: What is the JBoss Module name for a deployed jar
                      jaikiran pai Master

                      It might not be related to the issue you are running into, but the amount and kind of dependencies you have in that jboss-deployment-structure.xml doesn't look right. Those look like plain jar files which you can place in the .ear/lib folder and don't have to add any explicit dependencies.

                      • 8. Re: What is the JBoss Module name for a deployed jar
                        Antonio Bruno Newbie

                        Thank you.

                        If I put the libraries in the .ear / lib folder, everything works properly .

                        But my need was to put these libraries in an external directory shared by all applications .ear.

                        How could I do about it?

                        Do I have to use modules, or is there some other mechanism?

                         

                        Regards,

                        Antonio

                        • 9. Re: What is the JBoss Module name for a deployed jar
                          Rico Neubauer Novice

                          Currently facing the same challenge - could not find out so far whether the jboss/domain/lib/ could help-out in any way..

                          • 10. Re: What is the JBoss Module name for a deployed jar
                            jaikiran pai Master

                            Rico Neubauer wrote:

                             

                            Currently facing the same challenge - could not find out so far whether the jboss/domain/lib/ could help-out in any way..

                            http://community.jboss.org/message/615774#615774