1 Reply Latest reply on Sep 22, 2016 10:18 AM by Miroslav Novak

    Spring JMS Connection failing in Jboss EAP 6.4.9

    Prism Vibgyor Newbie

      My application has Spring JMS libraries(3.1.1) deployed on Jboss eap 6.4 GA which will connect to another Jboss server(6.4.9) and working fine, jms connected successfully.

       

      later I patched Jboss eap 6.4 GA with eap 6.4.9.

       

      Now I kept running 1stJboss server for JMS(eap 6.4.9) running with no error.

      then, When i deployed my application in 2nd Jboss eap 6.4.9 server, application deployed failed, and showing below error messages.

       

      17:33:18,411 ERROR [org.springframework.web.context.ContextLoader] (ServerService Thread Pool -- 59) Context initialization failed: org.springframework.context.ApplicationContextException: Failed to start bean 'jmsContainer'; nested exception is java.lang.NoSuchMethodError: javax.jms.ConnectionFactory.createConnection()Ljavax/jms/Connection;

        at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:170) [spring-context-3.2.8.RELEASE.jar:3.2.8.RELEASE]

        at org.springframework.context.support.DefaultLifecycleProcessor.access$200(DefaultLifecycleProcessor.java:51) [spring-context-3.2.8.RELEASE.jar:3.2.8.RELEASE]

        at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:339) [spring-context-3.2.8.RELEASE.jar:3.2.8.RELEASE]

        at org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:143) [spring-context-3.2.8.RELEASE.jar:3.2.8.RELEASE]

        at org.springframework.context.support.DefaultLifecycleProcessor.onRefresh(DefaultLifecycleProcessor.java:108) [spring-context-3.2.8.RELEASE.jar:3.2.8.RELEASE]

        at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:945) [spring-context-3.2.8.RELEASE.jar:3.2.8.RELEASE]

        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482) [spring-context-3.2.8.RELEASE.jar:3.2.8.RELEASE]

        at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:410) [spring-web-3.2.8.RELEASE.jar:3.2.8.RELEASE]

        at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306) [spring-web-3.2.8.RELEASE.jar:3.2.8.RELEASE]

        at org.springframework.web.context.ContextLnoaderListener.contextInitialized(ContextLoaderListener.java:112) [spring-web-3.2.8.RELEASE.jar:3.2.8.RELEASE]

        at org.jboss.resteasy.plugins.spring.SpringContextLoaderListener.contextInitialized(SpringContextLoaderListener.java:44) [resteasy-spring-2.3.5.Final.jar:]

        at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3339) [jbossweb-7.5.17.Final-redhat-1.jar:7.5.17.Final-redhat-1]

        at org.apache.catalina.core.StandardContext.start(StandardContext.java:3780) [jbossweb-7.5.17.Final-redhat-1.jar:7.5.17.Final-redhat-1]

        at org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:163) [jboss-as-web-7.5.9.Final-redhat-2.jar:7.5.9.Final-redhat-2]

        at org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:61) [jboss-as-web-7.5.9.Final-redhat-2.jar:7.5.9.Final-redhat-2]

        at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:96) [jboss-as-web-7.5.9.Final-redhat-2.jar:7.5.9.Final-redhat-2]

        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [rt.jar:1.7.0_80]

        at java.util.concurrent.FutureTask.run(FutureTask.java:262) [rt.jar:1.7.0_80]

        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_80]

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_80]

        at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_80]

        at org.jboss.threads.JBossThread.run(JBossThread.java:122)

      Caused by: java.lang.NoSuchMethodError: javax.jms.ConnectionFactory.createConnection()Ljavax/jms/Connection;

        at org.springframework.jms.support.JmsAccessor.createConnection(JmsAccessor.java:184) [spring-jms-3.1.1.RELEASE.jar:3.1.1.RELEASE]

        at org.springframework.jms.listener.AbstractJmsListeningContainer.createSharedConnection(AbstractJmsListeningContainer.java:404) [spring-jms-3.1.1.RELEASE.jar:3.1.1.RELEASE]

        at org.springframework.jms.listener.AbstractJmsListeningContainer.establishSharedConnection(AbstractJmsListeningContainer.java:372) [spring-jms-3.1.1.RELEASE.jar:3.1.1.RELEASE]

        at org.springframework.jms.listener.DefaultMessageListenerContainer.establishSharedConnection(DefaultMessageListenerContainer.java:760) [spring-jms-3.1.1.RELEASE.jar:3.1.1.RELEASE]

        at org.springframework.jms.listener.AbstractJmsListeningContainer.doStart(AbstractJmsListeningContainer.java:279) [spring-jms-3.1.1.RELEASE.jar:3.1.1.RELEASE]

        at org.springframework.jms.listener.AbstractJmsListeningContainer.start(AbstractJmsListeningContainer.java:264) [spring-jms-3.1.1.RELEASE.jar:3.1.1.RELEASE]

        at org.springframework.jms.listener.DefaultMessageListenerContainer.start(DefaultMessageListenerContainer.java:561) [spring-jms-3.1.1.RELEASE.jar:3.1.1.RELEASE]

        at com.mypackage.listener.MyListenerContainer.start(MyListenerContainer.java:82) [classes:]

        at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:167) [spring-context-3.2.8.RELEASE.jar:3.2.8.RELEASE]

        ... 21 more

      17:33:18,499 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/MyJMSApp]] (ServerService Thread Pool -- 59) JBWEB000287: Exception sending context initialized event to listener instance of class org.jboss.resteasy.plugins.spring.SpringContextLoaderListener: org.springframework.context.ApplicationContextException: Failed to start bean 'jmsContainer'; nested exception is java.lang.NoSuchMethodError: javax.jms.ConnectionFactory.createConnection()Ljavax/jms/Connection;

        at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:170) [spring-context-3.2.8.RELEASE.jar:3.2.8.RELEASE]

        at org.springframework.context.support.DefaultLifecycleProcessor.access$200(DefaultLifecycleProcessor.java:51) [spring-context-3.2.8.RELEASE.jar:3.2.8.RELEASE]

        at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:339) [spring-context-3.2.8.RELEASE.jar:3.2.8.RELEASE]

        at org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:143) [spring-context-3.2.8.RELEASE.jar:3.2.8.RELEASE]

        at org.springframework.context.support.DefaultLifecycleProcessor.onRefresh(DefaultLifecycleProcessor.java:108) [spring-context-3.2.8.RELEASE.jar:3.2.8.RELEASE]

        at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:945) [spring-context-3.2.8.RELEASE.jar:3.2.8.RELEASE]

        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482) [spring-context-3.2.8.RELEASE.jar:3.2.8.RELEASE]

        at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:410) [spring-web-3.2.8.RELEASE.jar:3.2.8.RELEASE]

        at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306) [spring-web-3.2.8.RELEASE.jar:3.2.8.RELEASE]

        at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112) [spring-web-3.2.8.RELEASE.jar:3.2.8.RELEASE]

        at org.jboss.resteasy.plugins.spring.SpringContextLoaderListener.contextInitialized(SpringContextLoaderListener.java:44) [resteasy-spring-2.3.5.Final.jar:]

        at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3339) [jbossweb-7.5.17.Final-redhat-1.jar:7.5.17.Final-redhat-1]

        at org.apache.catalina.core.StandardContext.start(StandardContext.java:3780) [jbossweb-7.5.17.Final-redhat-1.jar:7.5.17.Final-redhat-1]

        at org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:163) [jboss-as-web-7.5.9.Final-redhat-2.jar:7.5.9.Final-redhat-2]

        at org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:61) [jboss-as-web-7.5.9.Final-redhat-2.jar:7.5.9.Final-redhat-2]

        at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:96) [jboss-as-web-7.5.9.Final-redhat-2.jar:7.5.9.Final-redhat-2]

        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [rt.jar:1.7.0_80]

        at java.util.concurrent.FutureTask.run(FutureTask.java:262) [rt.jar:1.7.0_80]

        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_80]

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_80]

        at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_80]

        at org.jboss.threads.JBossThread.run(JBossThread.java:122)

      Caused by: java.lang.NoSuchMethodError: javax.jms.ConnectionFactory.createConnection()Ljavax/jms/Connection;

        at org.springframework.jms.support.JmsAccessor.createConnection(JmsAccessor.java:184) [spring-jms-3.1.1.RELEASE.jar:3.1.1.RELEASE]

        at org.springframework.jms.listener.AbstractJmsListeningContainer.createSharedConnection(AbstractJmsListeningContainer.java:404) [spring-jms-3.1.1.RELEASE.jar:3.1.1.RELEASE]

        at org.springframework.jms.listener.AbstractJmsListeningContainer.establishSharedConnection(AbstractJmsListeningContainer.java:372) [spring-jms-3.1.1.RELEASE.jar:3.1.1.RELEASE]

        at org.springframework.jms.listener.DefaultMessageListenerContainer.establishSharedConnection(DefaultMessageListenerContainer.java:760) [spring-jms-3.1.1.RELEASE.jar:3.1.1.RELEASE]

        at org.springframework.jms.listener.AbstractJmsListeningContainer.doStart(AbstractJmsListeningContainer.java:279) [spring-jms-3.1.1.RELEASE.jar:3.1.1.RELEASE]

        at org.springframework.jms.listener.AbstractJmsListeningContainer.start(AbstractJmsListeningContainer.java:264) [spring-jms-3.1.1.RELEASE.jar:3.1.1.RELEASE]

        at org.springframework.jms.listener.DefaultMessageListenerContainer.start(DefaultMessageListenerContainer.java:561) [spring-jms-3.1.1.RELEASE.jar:3.1.1.RELEASE]

        at com.mypackage.listener.MyListenerContainer.start(MyListenerContainer.java:82) [classes:]

        at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:167) [spring-context-3.2.8.RELEASE.jar:3.2.8.RELEASE]

        ... 21 more

       

       

      17:33:18,621 ERROR [org.apache.catalina.core] (ServerService Thread Pool -- 59) JBWEB001103: Error detected during context /MyJMSApp start, will stop it

      17:33:18,640 INFO  [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/MyJMSApp]] (ServerService Thread Pool -- 59) Closing Spring root WebApplicationContext

      17:33:18,642 INFO  [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/MyJMSApp]] (ServerService Thread Pool -- 59) Shutting down log4j

      17:33:18,653 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 59) MSC000001: Failed to start service jboss.web.deployment.default-host./MyJMSApp: org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./MyJMSApp: org.jboss.msc.service.StartException in anonymous service: JBAS018040: Failed to start context

        at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:99)

        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [rt.jar:1.7.0_80]

        at java.util.concurrent.FutureTask.run(FutureTask.java:262) [rt.jar:1.7.0_80]

        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_80]

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_80]

        at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_80]

        at org.jboss.threads.JBossThread.run(JBossThread.java:122)

      Caused by: org.jboss.msc.service.StartException in anonymous service: JBAS018040: Failed to start context

        at org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:168)

        at org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:61)

        at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:96)

        ... 6 more

       

      Can any one suggest what is issue with jms libraries in Jboss eap 6.4.9 and how to resolve this.

      suggestions/advises are always appreciated.

       

      let me know if any additional information needed.

        • 1. Re: Spring JMS Connection failing in Jboss EAP 6.4.9
          Miroslav Novak Master

          First of all, recommended way is to use $JBOSS_HOME/bin/client/jboss-client.jar in client applications. It contains all classes needed for EAP 6 clients - (for example hornetq client classes and also javax.jms.* classes)

           

          If EAP 6.4 is patched then jars in original modules are not overridden but just invalidated (jars can't be unzipped and read). Then new "layer-base-jboss-eap-6.4.xCP" directory is added to "modules" directory in which new patched jars are present  I believe you should provide path to modules in "layer-base-jboss-eap-6.4.xCP".

           

          For example:

          Path to original org.hornetq module in EAP 6.4.0.GA is - $JBOSS_HOME/modules/system/layers/base/org/hornetq/main/

          Path to patched org.hornetq module in EAP 6.4.9.CP is - $JBOSS_HOME/modules/system/layers/base/.overlays/layer-base-jboss-eap-6.4.9.CP/org/hornetq/main/

           

          You will need to check which modules you got patched.