4 Replies Latest reply on Oct 3, 2012 5:43 PM by jboss7_newbie

    Jboss7 - Application dependency on activemq.rar

    jboss7_newbie

      I configured ActiveMQ-5.6 successfully with Jboss7 and the rar gets deployed.Now my war file has dependency on the activemq.rar so when I start Jboss my application gets deployed first and fails with NameNotFoundException for the connectionFactory.But later on in the logs I can see that activemq.rar gets deployed and the connection factory and topic get registered.I followed the advice given in the link - https://community.jboss.org/message/746785

      and added a Dependencies: deployment.activemq.rar to my .war/META-INF/MANIFEST.MF but still I see my application deploying before activemq.rar has finished deplpoying.I even tried adding <module name="deployment.activemq.rar" /> to my jboss-deployment-structure.xml but that resulted in the same result.Below is excerpt from my log -

       

      Caused by: javax.naming.NameNotFoundException: jms/ConnectionFactory -- service jboss.naming.context.java.jboss.jms.ConnectionFactory

          at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:97)

          at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:179)

          at org.jboss.as.naming.InitialContext.lookup(InitialContext.java:122)

          at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:215)

          at javax.naming.InitialContext.lookup(InitialContext.java:392) [rt.jar:1.6.0_33]

          at org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:154) [org.springframework.context-3.0.5.RELEASE.jar:3.0.5.RELEASE]

          at org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:87) [org.springframework.context-3.0.5.RELEASE.jar:3.0.5.RELEASE]

          at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:152) [org.springframework.context-3.0.5.RELEASE.jar:3.0.5.RELEASE]

          at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:178) [org.springframework.context-3.0.5.RELEASE.jar:3.0.5.RELEASE]

          at org.springframework.jndi.JndiLocatorSupport.lookup(JndiLocatorSupport.java:95) [org.springframework.context-3.0.5.RELEASE.jar:3.0.5.RELEASE]

          at org.springframework.jndi.JndiObjectLocator.lookup(JndiObjectLocator.java:105) [org.springframework.context-3.0.5.RELEASE.jar:3.0.5.RELEASE]

          at org.springframework.jndi.JndiObjectFactoryBean.lookupWithFallback(JndiObjectFactoryBean.java:201) [org.springframework.context-3.0.5.RELEASE.jar:3.0.5.RELEASE]

          at org.springframework.jndi.JndiObjectFactoryBean.afterPropertiesSet(JndiObjectFactoryBean.java:187) [org.springframework.context-3.0.5.RELEASE.jar:3.0.5.RELEASE]

          at company.app.CentralApplicationContext.lookup(Unknown Source) [classes:]

          at company.app.CentralApplicationContext$$EnhancerByCGLIB$$51a22310.CGLIB$topicConnectionFactory$3(<generated>) [cglib-2.1.3.jar:]

          at company.app.CentralApplicationContext$$EnhancerByCGLIB$$51a22310$$FastClassByCGLIB$$41132966.invoke(<generated>) [cglib-2.1.3.jar:]

          at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:167) [cglib-2.1.3.jar:]

          at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:210) [org.springframework.context-3.0.5.RELEASE.jar:3.0.5.RELEASE]

          at company.app.CentralApplicationContext$$EnhancerByCGLIB$$51a22310.topicConnectionFactory(<generated>) [cglib-2.1.3.jar:]

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_33]

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [rt.jar:1.6.0_33]

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_33]

          at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_33]

          at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:145) [org.springframework.beans-3.0.5.RELEASE.jar:3.0.5.RELEASE]

          ... 45 more

       

      18:26:34,151 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-7) Error listenerStart

      18:26:34,152 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-7) Context [/MyApp] startup failed due to previous errors

      18:26:34,169 INFO  [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/MyApp]] (MSC service thread 1-7) Closing Spring root WebApplicationContext

      18:26:34,177 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-7) MSC00001: Failed to start service jboss.web.deployment.default-host./MyLog: org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./MyApp: JBAS018040: Failed to start context

          at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:107)

          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$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_33]

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

          at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_33]

       

      18:26:43,751 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015960: Class Path entry derbyLocale_cs.jar in /C:/jboss-as-7.2.0.Alpha1-SNAPSHOT/standalone/deployments/activemq.rar/derby-10.8.2.2.jar  does not point to a valid jar for a Class-Path reference.

      18:26:43,752 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015960: Class Path entry derbyLocale_de_DE.jar in /C:/jboss-as-7.2.0.Alpha1-SNAPSHOT/standalone/deployments/activemq.rar/derby-10.8.2.2.jar  does not point to a valid jar for a Class-Path reference.

      18:26:43,752 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015960: Class Path entry derbyLocale_es.jar in /C:/jboss-as-7.2.0.Alpha1-SNAPSHOT/standalone/deployments/activemq.rar/derby-10.8.2.2.jar  does not point to a valid jar for a Class-Path reference.

      18:26:43,753 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015960: Class Path entry derbyLocale_fr.jar in /C:/jboss-as-7.2.0.Alpha1-SNAPSHOT/standalone/deployments/activemq.rar/derby-10.8.2.2.jar  does not point to a valid jar for a Class-Path reference.

      18:26:43,753 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015960: Class Path entry derbyLocale_hu.jar in /C:/jboss-as-7.2.0.Alpha1-SNAPSHOT/standalone/deployments/activemq.rar/derby-10.8.2.2.jar  does not point to a valid jar for a Class-Path reference.

      18:26:43,753 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015960: Class Path entry derbyLocale_it.jar in /C:/jboss-as-7.2.0.Alpha1-SNAPSHOT/standalone/deployments/activemq.rar/derby-10.8.2.2.jar  does not point to a valid jar for a Class-Path reference.

      18:26:43,754 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015960: Class Path entry derbyLocale_ja_JP.jar in /C:/jboss-as-7.2.0.Alpha1-SNAPSHOT/standalone/deployments/activemq.rar/derby-10.8.2.2.jar  does not point to a valid jar for a Class-Path reference.

      18:26:43,754 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015960: Class Path entry derbyLocale_ko_KR.jar in /C:/jboss-as-7.2.0.Alpha1-SNAPSHOT/standalone/deployments/activemq.rar/derby-10.8.2.2.jar  does not point to a valid jar for a Class-Path reference.

      18:26:43,754 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015960: Class Path entry derbyLocale_pl.jar in /C:/jboss-as-7.2.0.Alpha1-SNAPSHOT/standalone/deployments/activemq.rar/derby-10.8.2.2.jar  does not point to a valid jar for a Class-Path reference.

      18:26:43,755 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015960: Class Path entry derbyLocale_pt_BR.jar in /C:/jboss-as-7.2.0.Alpha1-SNAPSHOT/standalone/deployments/activemq.rar/derby-10.8.2.2.jar  does not point to a valid jar for a Class-Path reference.

      18:26:43,755 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015960: Class Path entry derbyLocale_ru.jar in /C:/jboss-as-7.2.0.Alpha1-SNAPSHOT/standalone/deployments/activemq.rar/derby-10.8.2.2.jar  does not point to a valid jar for a Class-Path reference.

      18:26:43,756 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015960: Class Path entry derbyLocale_zh_CN.jar in /C:/jboss-as-7.2.0.Alpha1-SNAPSHOT/standalone/deployments/activemq.rar/derby-10.8.2.2.jar  does not point to a valid jar for a Class-Path reference.

      18:26:43,756 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015960: Class Path entry derbyLocale_zh_TW.jar in /C:/jboss-as-7.2.0.Alpha1-SNAPSHOT/standalone/deployments/activemq.rar/derby-10.8.2.2.jar  does not point to a valid jar for a Class-Path reference.

      18:26:43,814 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-9) JBAS015893: Encountered invalid class name 'org.apache.hadoop.hdfs.DFSClient$Renewer' for service type 'org.apache.hadoop.security.token.TokenRenewer'

      18:26:43,815 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-9) JBAS015893: Encountered invalid class name 'org.apache.hadoop.mapred.JobClient$Renewer' for service type 'org.apache.hadoop.security.token.TokenRenewer'

      18:26:43,815 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-9) JBAS015893: Encountered invalid class name 'org.apache.hadoop.hdfs.security.token.block.BlockTokenIdentifier$Renewer' for service type 'org.apache.hadoop.security.token.TokenRenewer'

      18:26:43,816 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-9) JBAS015893: Encountered invalid class name 'org.apache.hadoop.mapreduce.security.token.JobTokenIdentifier$Renewer' for service type 'org.apache.hadoop.security.token.TokenRenewer'

      18:26:43,816 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-9) JBAS015893: Encountered invalid class name 'org.apache.hadoop.hdfs.HftpFileSystem$TokenManager' for service type 'org.apache.hadoop.security.token.TokenRenewer'

      18:26:43,816 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-9) JBAS015893: Encountered invalid class name 'org.apache.hadoop.hdfs.web.WebHdfsFileSystem$DtRenewer' for service type 'org.apache.hadoop.security.token.TokenRenewer'

      18:26:45,077 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-14) JBAS010403: Deploying JDBC-compliant driver class org.apache.derby.jdbc.AutoloadedDriver (version 10.8)

      18:26:45,094 INFO  [org.jboss.as.connector.deployers.RADeployer] (MSC service thread 1-7) IJ020001: Required license terms for file:/C:/jboss-as-7.2.0.Alpha1-SNAPSHOT/standalone/deployments/activemq.rar/

      18:26:45,140 INFO  [org.jboss.as.connector.deployers.RaXmlDeployer] (MSC service thread 1-1) IJ020001: Required license terms for file:/C:/jboss-as-7.2.0.Alpha1-SNAPSHOT/standalone/deployments/activemq.rar/

      18:26:45,149 INFO  [org.jboss.as.deployment.connector] (MSC service thread 1-1) JBAS010406: Registered connection factory java:jboss/jms/ConnectionFactory

      18:26:45,156 INFO  [org.jboss.as.deployment.connector] (MSC service thread 1-1) JBAS010405: Registered admin object at java:jboss/jms/Queue

      18:26:45,161 INFO  [org.jboss.as.connector.deployers.RaXmlDeployer] (MSC service thread 1-1) IJ020002: Deployed: file:/C:/jboss-as-7.2.0.Alpha1-SNAPSHOT/standalone/deployments/activemq.rar/

      18:26:45,165 INFO  [org.jboss.as.deployment.connector] (MSC service thread 1-5) JBAS010401: Bound JCA ConnectionFactory [java:jboss/jms/ConnectionFactory]

      18:26:45,165 INFO  [org.jboss.as.deployment.connector] (MSC service thread 1-15) JBAS010401: Bound JCA AdminObject [java:jboss/jms/Queue]

      18:26:45,372 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 29) JBAS018559: Deployed "MyApp.war"

      18:26:45,372 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 29) JBAS018559: Deployed "activemq.rar"

      18:26:45,373 INFO  [org.jboss.as.controller] (Controller Boot Thread) JBAS014774: Service status report

      JBAS014777:   Services which failed to start:      service jboss.web.deployment.default-host./MyApp: org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./MyApp: JBAS018040: Failed to start context

       

      Please could anybody help me with this.

        • 1. Re: Jboss7 - Application dependency on activemq.rar
          jboss7_newbie

          This seems to be discussed here as well - http://stackoverflow.com/questions/11343732/jboss-7-deployment-order-and-timing

           

          Any suggestions please ?

          • 2. Re: Jboss7 - Application dependency on activemq.rar
            jboss7_newbie

            Some more inof - I am using yesterdays nightly build of Jbos 7.2.0 Alhpa1 as well

            • 3. Re: Jboss7 - Application dependency on activemq.rar
              ctomc

              What if you configure RA as part of standalone.xml?

               

              this way it won't be affected by deployment order and will be set-up before any deployments are activated

               

               

              --

              tomaz

              • 4. Re: Jboss7 - Application dependency on activemq.rar
                jboss7_newbie

                Thank you for the response.

                 

                I have defined the RA in standalone.xml as mentioned in the many articles discussing Jboss7+ActiveMQ integration.The activemq.rar is placed in standalone\deployments folder.

                 

                <subsystem xmlns="urn:jboss:domain:resource-adapters:1.0">

                            <resource-adapters>

                                <resource-adapter>

                                    <archive>

                                        activemq.rar

                                    </archive>

                                    <transaction-support>XATransaction</transaction-support>

                                    <config-property name="UseInboundSession">

                                        false

                                    </config-property>

                                    <config-property name="Password">

                                        defaultPassword

                                    </config-property>

                                    <config-property name="UserName">

                                        defaultUser

                                    </config-property>

                                    <config-property name="ServerUrl">

                                        tcp://localhost:61616

                                    </config-property>

                                    <connection-definitions>

                                        <connection-definition class-name="org.apache.activemq.ra.ActiveMQManagedConnectionFactory" jndi-name="java:jboss/jms/ConnectionFactory" enabled="true" use-java-context="true" pool-name="LogConnectionFactory" use-ccm="true">

                                            <xa-pool>

                                                <min-pool-size>1</min-pool-size>

                                                <max-pool-size>10</max-pool-size>

                                                <prefill>false</prefill>

                                                <use-strict-min>false</use-strict-min>

                                                <flush-strategy>FailingConnectionOnly</flush-strategy>

                                            </xa-pool>

                                          </connection-definition>

                                   </connection-definitions>

                               </resource-adpater>

                    </resource-adapters>

                </subsystem>

                 

                Is there something that I have missed ?