9 Replies Latest reply on Jul 8, 2013 1:21 PM by atulkc

    MANIFEST and Jboss-deployment-structure.xml

    atulkc

      I had couple of questions regarding usage of MANIFEST file and jboss-deployment-structure.xml. I am using JBoss 7.2.0.Final.

       

      1) When I add both MANIFEST and jboss-deployment-structure.xml under META_INF directory of ear then jboss-deployment-structure is ignored. None of the settings from jboss-deployment-structure.xml are picked up. Can't I do some settings through manifest and some through jboss-deployment-structure.xml?

      2) The reason I wanted to use both was because we use infinispan grid cache in our application and the only way I can get the infinispan to work from our application is by adding manifest dependencies entry as suggested here:

      https://docs.jboss.org/author/display/ISPN/Infinispan+modules+for+JBoss+AS+7.x. I tried adding the infinispan dependency through jboss-deployment-structure.xml (shown below) but I get ClassNotFoundException.

       

       

      <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.1">
        <ear-subdeployments-isolated>false</ear-subdeployments-isolated>
        <deployment>
          <dependencies>
            <module name="org.infinispan" services="import"/>
          </dependencies>
        </deployment>
      
       </jboss-deployment-structure>
      
      

       

      Note that I tried chaning services="import" to services="export" with same result. I removed services attribute and added export="true" but that did not make any difference.

       

      Exception stack trace is as follows:

       

      13:51:47,137 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 60) MSC00001: Failed to start service jboss.deployment.subunit."dcm-server.ear"."system.jar".component.SystemMonitor.START: org.jboss.msc.service.StartException in service jboss.deployment.subunit."dcm-server.ear"."system.jar".component.SystemMonitor.START: java.lang.IllegalStateException: JBAS011048: Failed to construct component instance
                at org.jboss.as.ee.component.ComponentStartService$1.run(ComponentStartService.java:57) [jboss-as-ee-7.2.0.Final.jar:7.2.0.Final]
                at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [rt.jar:1.7.0_07]
                at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) [rt.jar:1.7.0_07]
                at java.util.concurrent.FutureTask.run(FutureTask.java:166) [rt.jar:1.7.0_07]
                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_07]
                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_07]
                at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_07]
                at org.jboss.threads.JBossThread.run(JBossThread.java:122) [jboss-threads-2.1.0.Final.jar:2.1.0.Final]
      Caused by: java.lang.IllegalStateException: JBAS011048: Failed to construct component instance
                at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:163) [jboss-as-ee-7.2.0.Final.jar:7.2.0.Final]
                at org.jboss.as.ee.component.BasicComponent.createInstance(BasicComponent.java:85) [jboss-as-ee-7.2.0.Final.jar:7.2.0.Final]
                at org.jboss.as.ejb3.component.singleton.SingletonComponent.getComponentInstance(SingletonComponent.java:126)
                at org.jboss.as.ejb3.component.singleton.SingletonComponent.start(SingletonComponent.java:141)
                at org.jboss.as.ee.component.ComponentStartService$1.run(ComponentStartService.java:54) [jboss-as-ee-7.2.0.Final.jar:7.2.0.Final]
                ... 7 more
      Caused by: javax.ejb.EJBException: JBAS014580: Unexpected Error
                at org.jboss.as.ejb3.tx.CMTTxInterceptor.handleExceptionInNoTx(CMTTxInterceptor.java:188)
                at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInNoTx(CMTTxInterceptor.java:237)
                at org.jboss.as.ejb3.tx.CMTTxInterceptor.supports(CMTTxInterceptor.java:374)
                at org.jboss.as.ejb3.tx.LifecycleCMTTxInterceptor.processInvocation(LifecycleCMTTxInterceptor.java:68)
                at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
                at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41)
                at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
                at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45) [jboss-as-ee-7.2.0.Final.jar:7.2.0.Final]
                at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
                at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
                at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:161) [jboss-as-ee-7.2.0.Final.jar:7.2.0.Final]
                ... 11 more
      Caused by: java.lang.NoClassDefFoundError: org/infinispan/manager/CacheManager
                at com.brocade.dcm.system.monitor.SystemMonitor.fakeStart(SystemMonitor.java:228)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_07]
                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_07]
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_07]
                at java.lang.reflect.Method.invoke(Method.java:601) [rt.jar:1.7.0_07]
                at org.jboss.as.ee.component.ManagedReferenceLifecycleMethodInterceptorFactory$ManagedReferenceLifecycleMethodInterceptor.processInvocation(ManagedReferenceLifecycleMethodInterceptorFactory.java:130) [jboss-as-ee-7.2.0.Final.jar:7.2.0.Final]
                at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
                at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)
                at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
                at org.jboss.as.weld.injection.WeldInjectionInterceptor.processInvocation(WeldInjectionInterceptor.java:73)
                at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
                at org.jboss.as.ee.component.ManagedReferenceFieldInjectionInterceptorFactory$ManagedReferenceFieldInjectionInterceptor.processInvocation(ManagedReferenceFieldInjectionInterceptorFactory.java:115) [jboss-as-ee-7.2.0.Final.jar:7.2.0.Final]
                at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
                at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)
                at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
                at org.jboss.as.ee.component.ManagedReferenceInterceptorFactory$ManagedReferenceInterceptor.processInvocation(ManagedReferenceInterceptorFactory.java:95) [jboss-as-ee-7.2.0.Final.jar:7.2.0.Final]
                at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
                at org.jboss.as.ee.component.ManagedReferenceInterceptorFactory$ManagedReferenceInterceptor.processInvocation(ManagedReferenceInterceptorFactory.java:95) [jboss-as-ee-7.2.0.Final.jar:7.2.0.Final]
                at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
                at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)
                at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
                at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50) [jboss-as-ee-7.2.0.Final.jar:7.2.0.Final]
                at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
                at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInNoTx(CMTTxInterceptor.java:235)
                ... 20 more
      Caused by: java.lang.ClassNotFoundException: org.infinispan.manager.CacheManager from [Module "deployment.dcm-server.ear.cache.jar:main" from Service Module Loader]
                at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190) [jboss-modules.jar:1.2.0.CR1]
                at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468) [jboss-modules.jar:1.2.0.CR1]
                at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456) [jboss-modules.jar:1.2.0.CR1]
                at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398) [jboss-modules.jar:1.2.0.CR1]
                at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120) [jboss-modules.jar:1.2.0.CR1]
                ... 44 more
      
      

      How do I achieve adding infinispan dependency using jboss-deployment-structure.xml? Or am I forced to stick to manifest dependencies when using infinispan as jboss-deployment-structure.xml is ignored in presence of manifest dependencies entries? The problem with using just manifest file is I cannot specify exclusions as I can do in jboss-deployment-structure.xml

       

      Thanks,

      Atul

        • 1. Re: MANIFEST and Jboss-deployment-structure.xml
          jaikiran

          You have to add that dependency to the subdeployment(s) of the .ear. Look at the xsd for the sub-deployment element and how the dependencies are added. You can even check here https://docs.jboss.org/author/display/AS72/Class+Loading+in+AS7

          1 of 1 people found this helpful
          • 2. Re: MANIFEST and Jboss-deployment-structure.xml
            atulkc

            Adding the dependency on sub deployment works. However, looks like I have to do this for  each and every of our sub deployments that use infinispan. Why isn't adding depedency for entire deployment propogated to all sub-deployments especially since I have set ear-subdeployments-isolated to false?

             

            Thanks

            • 3. Re: MANIFEST and Jboss-deployment-structure.xml
              jaikiran

              Atul Kshirsagar wrote:

               

              especially since I have set ear-subdeployments-isolated to false?

               

              That flag has nothing to do with whether the dependencies set for the ear deployment will be implicitly set for the subdeployments too. That element is just to enable/disable subdeployment modules from seeing each other. The xsd has more explanation of it.

              • 4. Re: MANIFEST and Jboss-deployment-structure.xml
                atulkc

                You are right, ear-subdeployment-isolated has nothing do with dependency propogation. However, can you tell me why do I have to set the infinispan dependency for each sub deployment unlike other dependencies which get propogated to all sub-deployments.

                • 5. Re: MANIFEST and Jboss-deployment-structure.xml
                  jaikiran

                  Atul Kshirsagar wrote:

                   

                  unlike other dependencies which get propogated to all sub-deployments.

                  I don't recollect of any dependencies which get propagated to all sub-deployments. Having said that, I think there was a feature request to have some such thing. I just can't find that JIRA now.

                  • 6. Re: MANIFEST and Jboss-deployment-structure.xml
                    atulkc

                    I had added dependency on a custom module I had created under deployment and all of my sub-deployments were able to see classes from that module.Don't know how that worked if dependencies are not propagated at all. Also, if depdencies specified under deployment are not available to sub-deployments, then what does specifying the dependencies in deployment do (I am using ear deployment)? Couldn't find much explanation in jboss-deployment-structure-1_1.xsd.

                    • 7. Re: MANIFEST and Jboss-deployment-structure.xml
                      jaikiran

                      Atul Kshirsagar wrote:

                       

                      Also, if depdencies specified under deployment are not available to sub-deployments, then what does specifying the dependencies in deployment do (I am using ear deployment)?

                      The .ear itself has a deployment module of its own. The jars in the .ear/lib (for example) are exposed via this module. So when you add a module dependency for the .ear deployment, the classes within the jars in .ear/lib can then access the classes exposed by your depdendency module.

                      • 8. Re: MANIFEST and Jboss-deployment-structure.xml
                        jaikiran

                        jaikiran pai wrote:

                         

                        Atul Kshirsagar wrote:

                         

                        unlike other dependencies which get propogated to all sub-deployments.

                        I don't recollect of any dependencies which get propagated to all sub-deployments. Having said that, I think there was a feature request to have some such thing. I just can't find that JIRA now.

                        Found the JIRA I was talking about. Here's what you need to do https://issues.jboss.org/browse/AS7-3203?focusedCommentId=12654748&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-12654748

                        • 9. Re: MANIFEST and Jboss-deployment-structure.xml
                          atulkc

                          I was on vacation last week and couldn't reply earlier.

                           

                          Thanks for the link to JIRA. This JIRA seems to indicate that if I set export="true" attribute on module in dependencies then it would be available to all sub deployments. However, adding that attribute to infinispan module did not work for me. Am I missing something?

                           

                          Also, does this behavior of not propagating the dependencies to sub deployments apply when I specify dependencies in MANIFEST file as well?