12 Replies Latest reply on Apr 1, 2008 11:27 AM by David Buchwald

    ClassCastException with ActiveMQ RA

    Jan Arend Jansen Newbie

      Hi,

      I am trying to integrate ActiveMQ 3.2.1 RA into Jboss 4.0.4RC1. I've used the Sonic MQ example for configuration of JCA 1.5 inflow support. When I deploy my MBean I get the following exception:

      Caused by: java.lang.ClassCastException: org.activemq.message.ActiveMQTopic
       at org.jboss.mq.SpyConnectionConsumer.<init>(SpyConnectionConsumer.java:107)
       at org.jboss.mq.SpyConnection.createConnectionConsumer(SpyConnection.java:178)
       at org.jboss.ejb3.mdb.MDB.innerCreateTopic(MDB.java:610)
       at org.jboss.ejb3.mdb.MDB.innerCreate(MDB.java:442)
       at org.jboss.ejb3.mdb.MDB.start(MDB.java:258)
       ... 78 more


      I've looked it up in the code and the the SpyConnectionConsumer has an implicit dependency on SpyDestionation (line 107). ActiceMQTopic is a Destination, hence the classcast exception

      Have I configured my ActiveMQ RA or MDB wrong or is this a bug?

        • 1. Re: ClassCastException with ActiveMQ RA
          William Conroy Newbie

          I get this same exception. I am using jboss 4.0.4.CR2 and activemq 4.0.

          These are the annotations on my mbean.
          @MessageDriven(activationConfig =
          {
          @ActivationConfigProperty(propertyName="destinationType",
          propertyValue="javax.jms.Queue"),
          @ActivationConfigProperty(propertyName="destination",
          propertyValue="activemq/queue/SecurityChanged"),
          @ActivationConfigProperty(propertyName="connectionFactoryName",
          propertyValue="activemq/QueueConnectionFactory"),
          @ActivationConfigProperty(propertyName="resourceAdaptorName",
          propertyValue="activemq-ra-4.0.rar")
          })

          This is my queue definition for ActiveMQ

          activemq/queue/SecurityChanged

          <depends optional-attribute-name="RARName">jboss.jca:service=RARDeployment,name='activemq-ra-4.0.rar'
          javax.jms.Queue

          PhysicalName=SecurityChanged



          This is my stack trace

          java.lang.ClassCastException: org.apache.activemq.command.ActiveMQQueue
          at org.jboss.mq.SpyConnectionConsumer.(SpyConnectionConsumer.java:107)
          at org.jboss.mq.SpyConnection.createConnectionConsumer(SpyConnection.java:209)
          at org.jboss.ejb3.mdb.MDB.innerCreateQueue(MDB.java:530)
          at org.jboss.ejb3.mdb.MDB.innerCreate(MDB.java:454)
          at org.jboss.ejb3.mdb.MDB.innerStart(MDB.java:267)
          at org.jboss.ejb3.mdb.MDB.start(MDB.java:256)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:585)
          at org.jboss.ejb3.ServiceDelegateWrapper.startService(ServiceDelegateWrapper.java:99)
          at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
          at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
          at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:585)
          at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
          at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
          at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
          at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:260)
          at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
          at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
          at $Proxy0.start(Unknown Source)
          at org.jboss.system.ServiceController.start(ServiceController.java:417)
          at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:585)
          at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
          at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
          at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
          at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:260)
          at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
          at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:190)
          at $Proxy72.start(Unknown Source)
          at org.jboss.ejb3.JmxKernelAbstraction.install(JmxKernelAbstraction.java:77)
          at org.jboss.ejb3.Ejb3Deployment.registerEJBContainer(Ejb3Deployment.java:437)
          at org.jboss.ejb3.Ejb3Deployment.start(Ejb3Deployment.java:484)
          at org.jboss.ejb3.Ejb3Module.startService(Ejb3Module.java:139)
          at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
          at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
          at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:585)
          at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
          at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
          at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
          at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:260)
          at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
          at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
          at $Proxy0.start(Unknown Source)
          at org.jboss.system.ServiceController.start(ServiceController.java:417)
          at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:585)
          at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
          at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
          at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
          at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:260)
          at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
          at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:190)
          at $Proxy31.start(Unknown Source)
          at org.jboss.ejb3.EJB3Deployer.start(EJB3Deployer.java:385)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:585)
          at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
          at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
          at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
          at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
          at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
          at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
          at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
          at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:260)
          at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
          at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:190)
          at $Proxy32.start(Unknown Source)
          at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1007)
          at org.jboss.deployment.MainDeployer.start(MainDeployer.java:997)
          at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:808)
          at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:771)
          at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:585)
          at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
          at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
          at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
          at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
          at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
          at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
          at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:260)
          at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
          at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:190)
          at $Proxy6.deploy(Unknown Source)
          at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:334)
          at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:522)
          at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:207)
          at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:280)
          at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
          at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:585)
          at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
          at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
          at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
          at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:260)
          at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
          at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
          at $Proxy0.start(Unknown Source)
          at org.jboss.system.ServiceController.start(ServiceController.java:417)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:585)
          at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
          at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
          at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
          at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:260)
          at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
          at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:190)
          at $Proxy4.start(Unknown Source)
          at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
          at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1007)
          at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:808)
          at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:771)
          at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:755)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:585)
          at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
          at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
          at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
          at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
          at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
          at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
          at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:260)
          at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
          at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:190)
          at $Proxy5.deploy(Unknown Source)
          at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
          at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
          at org.jboss.Main.boot(Main.java:200)
          at org.jboss.Main$1.run(Main.java:464)
          at java.lang.Thread.run(Thread.java:595)


          Is there a configuration property I am missing? Do you have to specify a different consumer type other than the SpyConnectionConsumer?

          Thanks,

          Bo

          • 2. Re: ClassCastException with ActiveMQ RA
            Thomas Orr Newbie

            I am having the same problem. Have you solved this?

            • 3. Re: ClassCastException with ActiveMQ RA
              J-C jc Apprentice

              issue 1: ClassCastException is due to the fact that MDB EJB3 RC8 implementation is not able to create topic/queue with another implementation than JBossMQ.
              isue 2: If you create topic/queue using XML, you can go one step further. But now the problem is that MDB EJB3 use a createConnectionConsummer method that is optional in JMS 1.1 spec.

              Consequently, MDB EJB3 + activeMQ does not works.

              You can unse JBoss Messaging. You will not be able to create topic/queue dynamically (issue 1) but you will be able to use MDB EJB3 when queue is already created (there is a demo with EJB3 in the downloaf of messaging).

              If you really wants to use activeMQ, you can write your MDB in EJB2 style. It works fine.

              In SVN, it looks like a lot of works have been done to improve in class MDB.java, I first wanted to patch it but there is so many differences between EJB3 RC8 branch and the main branch ... that now I prefer the solution of writting MDB in EJB2 style.

              Question is while the issue be corrected in a further rcx release of EJB3 or should we wait till a JBoss 5 release ?

              • 4. Re: ClassCastException with ActiveMQ RA
                Sacha Labourey Master

                Do you have a patch? if you do, I would suggest to provide it so this can get fixed an ActiveMQ used as a source for JBoss 5.0 MDB.

                cheers,


                sacha

                • 5. Re: ClassCastException with ActiveMQ RA
                  J-C jc Apprentice

                  I started to write a patch based on the branch used for EJB3 RC8 but I do not terminate it when I see that the code for MDB in the main branch as been completly refactored (I did not try to rebuild main branch).

                  Writting a patch would have been a very short term action.

                  • 6. Re: ClassCastException with ActiveMQ RA
                    Thomas Orr Newbie

                    The fact that this isn't a priority for 4X is disconcerting. We have many jboss servers, and several activemq servers. All of our new/recent development is based on ejb3. Now we either have to wait for JBoss 5 or not use activemq. Neither one of these is an great option...

                    • 7. Re: ClassCastException with ActiveMQ RA
                      J-C jc Apprentice

                      Sorry I was wrong ...

                      ActiveMQ supports the createConnectionConsumer. I try to implement a patch on MDB.java class. My problem is now to be able to get the ServerSessionPool used by activeMQ. Any idea how to do that ?

                      • 8. Re: ClassCastException with ActiveMQ RA
                        pradeep Newbie

                        Has the problem been solved. I am using Jboss 4.0.3 with no MDB.It is a simple JMS consumer inside of Jboss.

                        15:21:24,099 INFO [STDOUT] java.lang.ClassCastException: org.apache.activemq.command.ActiveMQQueue
                        15:21:24,099 INFO [STDOUT] at org.jboss.mq.SpyQueueReceiver.<init>(SpyQueueReceiver.java:42)
                        15:21:24,099 INFO [STDOUT] at org.jboss.mq.SpySession.createReceiver(SpySession.java:689)
                        15:21:24,099 INFO [STDOUT] at org.jboss.mq.SpySession.createConsumer(SpySession.java:649)
                        15:21:24,099 INFO [STDOUT] at org.jboss.mq.SpySession.createConsumer(SpySession.java:635)
                        ....
                        


                        Please help me.

                        • 9. Re: ClassCastException with ActiveMQ RA
                          Branislav Meandzija Newbie

                          Has this been solved?

                          java.lang.ClassCastException: org.apache.activemq.command.ActiveMQQueue
                          at org.jboss.mq.SpyQueueReceiver.(SpyQueueReceiver.java:42)
                          at org.jboss.mq.SpySession.createReceiver(SpySession.java:689)
                          at org.jboss.mq.SpySession.createReceiver(SpySession.java:678)
                          at net.larian.vmail.notify.mbean.EmailTransmitter.(EmailTransmitter.java:78)
                          at net.larian.vmail.notify.mbean.EmailService.startService(EmailService.java:85)
                          at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:274)
                          at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:230)
                          at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
                          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                          at java.lang.reflect.Method.invoke(Method.java:585)
                          at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
                          at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
                          at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
                          at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)

                          • 10. Re: ClassCastException with ActiveMQ RA
                            Lukasz Indyk Newbie

                            I have a similar problem with MDB from EJB 2 (not from EJB 3). To access ActiveMQ from JBoss I am following the instructions from this article http://devzone.logicblaze.com/site/integrating-apache-activemq-with-jboss.html. The only difference is I have ActiveMQ running on a separate machine, whereas in the article ActiveMQ runs in embedded mode. That is why I have the following entry in ra.xml:

                            <config-property>

                            Sets the XML configuration file used to configure the embedded ActiveMQ broker via
                            Spring if using embedded mode.

                            BrokerXmlConfig is the filename which is assumed to be on the classpath unless
                            a URL is specified. So a value of foo/bar.xml would be assumed to be on the
                            classpath whereas file:dir/file.xml would use the file system.
                            Any valid URL string is supported.

                            <config-property-name>BrokerXmlConfig</config-property-name>
                            <config-property-type>java.lang.String</config-property-type>
                            <config-property-value></config-property-value>
                            </config-property>

                            (the difference is that in the article the config-property-value is set to xbean:broker-config.xml, and in my ra.xml it is empty).

                            During JBoss startup I am getting the following error:


                            17:06:25,546 WARN [JMSContainerInvoker] JMS provider failure detected for ApplicationRecieve
                            org.jboss.deployment.DeploymentException: Error during queue setup; - nested throwable: (java.lang.ClassCastException: org.apache.activemq.command.ActiveMQQueue)
                            at org.jboss.deployment.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:53)
                            at org.jboss.ejb.plugins.jms.JMSContainerInvoker.innerStartDelivery(JMSContainerInvoker.java:811)
                            at org.jboss.ejb.plugins.jms.JMSContainerInvoker.startService(JMSContainerInvoker.java:839)
                            at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
                            at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
                            at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
                            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                            at java.lang.reflect.Method.invoke(Method.java:585)
                            at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                            at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                            at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
                            at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                            at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                            at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
                            at $Proxy0.start(Unknown Source)
                            at org.jboss.system.ServiceController.start(ServiceController.java:417)
                            at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
                            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                            at java.lang.reflect.Method.invoke(Method.java:585)
                            at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                            at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                            at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
                            at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                            at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                            at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:194)
                            at org.jboss.ejb.MessageDrivenContainer.startService(MessageDrivenContainer.java:272)
                            at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
                            at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
                            at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
                            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                            at java.lang.reflect.Method.invoke(Method.java:585)
                            at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                            at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                            at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
                            at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                            at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                            at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
                            at $Proxy0.start(Unknown Source)
                            at org.jboss.system.ServiceController.start(ServiceController.java:417)
                            at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
                            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                            at java.lang.reflect.Method.invoke(Method.java:585)
                            at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                            at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                            at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
                            at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                            at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                            at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
                            at $Proxy54.start(Unknown Source)
                            at org.jboss.ejb.EjbModule.startService(EjbModule.java:429)
                            at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
                            at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
                            at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
                            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                            at java.lang.reflect.Method.invoke(Method.java:585)
                            at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                            at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                            at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
                            at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                            at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                            at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
                            at $Proxy0.start(Unknown Source)
                            at org.jboss.system.ServiceController.start(ServiceController.java:417)
                            at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
                            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                            at java.lang.reflect.Method.invoke(Method.java:585)
                            at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                            at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                            at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
                            at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                            at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                            at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
                            at $Proxy25.start(Unknown Source)
                            at org.jboss.ejb.EJBDeployer.start(EJBDeployer.java:662)
                            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                            at java.lang.reflect.Method.invoke(Method.java:585)
                            at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                            at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                            at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
                            at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                            at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
                            at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
                            at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238)
                            at org.jboss.ws.integration.jboss.DeployerInterceptor.start(DeployerInterceptor.java:92)
                            at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188)
                            at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95)
                            at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                            at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                            at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                            at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
                            at $Proxy26.start(Unknown Source)
                            at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
                            at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1015)
                            at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
                            at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
                            at sun.reflect.GeneratedMethodAccessor54.invoke(Unknown Source)
                            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                            at java.lang.reflect.Method.invoke(Method.java:585)
                            at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                            at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                            at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
                            at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                            at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
                            at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                            at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                            at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                            at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
                            at $Proxy8.deploy(Unknown Source)
                            at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
                            at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
                            at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
                            at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:336)
                            at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
                            at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
                            at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
                            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                            at java.lang.reflect.Method.invoke(Method.java:585)
                            at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                            at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                            at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
                            at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                            at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                            at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
                            at $Proxy0.start(Unknown Source)
                            at org.jboss.system.ServiceController.start(ServiceController.java:417)
                            at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
                            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                            at java.lang.reflect.Method.invoke(Method.java:585)
                            at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                            at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                            at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
                            at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                            at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                            at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
                            at $Proxy4.start(Unknown Source)
                            at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
                            at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
                            at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
                            at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
                            at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
                            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                            at java.lang.reflect.Method.invoke(Method.java:585)
                            at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                            at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                            at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
                            at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                            at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
                            at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                            at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                            at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                            at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
                            at $Proxy5.deploy(Unknown Source)
                            at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
                            at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
                            at org.jboss.Main.boot(Main.java:200)
                            at org.jboss.Main$1.run(Main.java:490)
                            at java.lang.Thread.run(Thread.java:595)
                            Caused by: java.lang.ClassCastException: org.apache.activemq.command.ActiveMQQueue
                            at org.jboss.mq.SpyConnectionConsumer.(SpyConnectionConsumer.java:107)
                            at org.jboss.mq.SpyConnection.createConnectionConsumer(SpyConnection.java:209)
                            at org.jboss.ejb.plugins.jms.JMSContainerInvoker.innerStartDelivery(JMSContainerInvoker.java:795)
                            ... 159 more


                            I am using jboss 4.0.4 and activemq 4.0.1. I have checked that same situation occures while using jboss 4.0.5.

                            Could you help me with solving this problem? Does a document that better describes JBoss and ActiveMQ integration exists?

                            Regards,

                            Lukasz Indyk.

                            • 11. Re: ClassCastException with ActiveMQ RA
                              Weston M. Price Master

                              The following thread

                              http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3989865#3989865

                              takes a step by step approach to integrating JBoss with ActiveMQ.

                              • 12. Re: ClassCastException with ActiveMQ RA
                                David Buchwald Newbie

                                I'm having the same problem using WebSphere MQ. Any solutions yet?