4 Replies Latest reply on Nov 13, 2002 1:08 PM by Javi

    ClassCastException when deploying MDB

    Javi Newbie

      Hi there,

      I am getting the following error message while deploying a MDB:
      2002-11-11 15:35:03,533 INFO [org.jboss.ejb.plugins.jms.JMSContainerInvoker] Starting
      2002-11-11 15:35:03,572 INFO [org.jboss.ejb.plugins.jms.DLQHandler] Creating
      2002-11-11 15:35:07,612 INFO [org.jboss.ejb.plugins.jms.DLQHandler] Created
      2002-11-11 15:35:07,720 ERROR [org.jboss.ejb.plugins.jms.JMSContainerInvoker] Starting failed
      java.lang.ClassCastException: com.ibm.mq.jms.MQQueueConnectionFactory
      at org.jboss.ejb.plugins.jms.JMSContainerInvoker.innerCreate(JMSContainerInvoker.java:763)
      at org.jboss.ejb.plugins.jms.JMSContainerInvoker.startService(JMSContainerInvoker.java:824)
      at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:164)
      at org.jboss.ejb.MessageDrivenContainer.start(MessageDrivenContainer.java:200)
      at org.jboss.ejb.Container.invoke(Container.java:756)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:976)
      at $Proxy6.start(Unknown Source)

      I am using JBoss 3.0.3 and an external context where I have created the jms administered objects (qcf and queue).

      I have searched throughout the different forums but I couldn't find a similar post. Any ideas why I am getting this?

      Thanks a lot

      javi

        • 1. Re: ClassCastException when deploying MDB
          Adrian Brock Master

          Is that queue factory XA?

          Regards,
          Adrian

          • 2. Re: ClassCastException when deploying MDB
            Javi Newbie

            Hi Adrian,

            Nope, I don't think so. In case this helps, this is what looks like my global jndi namespace once JBoss starts up:

            Global JNDI Namespace
            +- UserTransactionSessionFactory (class: org.jboss.tm.usertx.server.UserTransactionSessionFactoryImpl)
            +- QueueConnectionFactory[link -> external/fs/QueueConnectionFactory] (class: javax.naming.LinkRef)
            +- queue (class: org.jnp.interfaces.NamingContext)
            | +- InputQueueMDB[link -> external/fs/queue/InputQueueMDB] (class: javax.naming.LinkRef)
            | +- DLQ[link -> external/fs/queue/DLQ] (class: javax.naming.LinkRef)
            +- external (class: org.jnp.interfaces.NamingContext)
            | +- fs (class: javax.naming.Context)
            | | +- .bindings (class: java.io.File)
            | | +- queue (class: javax.naming.Context)
            | | | +- .bindings (class: java.io.File)
            | | | +- DLQ (class: com.ibm.mq.jms.MQQueue)
            | | | +- InputQueueMDB (class: com.ibm.mq.jms.MQQueue)
            | | +- QueueConnectionFactory (class: com.ibm.mq.jms.MQQueueConnectionFactory)
            +- qcf[link -> external/fs/QueueConnectionFactory] (class: javax.naming.LinkRef)
            +- UserTransaction (class: org.jboss.tm.usertx.client.ClientUserTransaction)
            +- ejb (class: org.jnp.interfaces.NamingContext)
            | +- mgmt (class: org.jnp.interfaces.NamingContext)
            | | +- MEJB (proxy: $Proxy13 implements interface javax.management.j2ee.ManagementHome,interface javax.ejb.Handle)
            | +- jmx (class: org.jnp.interfaces.NamingContext)
            | | +- ejb (class: org.jnp.interfaces.NamingContext)
            | | | +- Adaptor (proxy: $Proxy17 implements interface org.jboss.jmx.adaptor.interfaces.AdaptorHome,interface javax.ejb.Handle)
            .....

            The jboss.xml file for the MDB looks like this:


            <enterprise-beans>
            <message-driven>
            <ejb-name>IntegrationAgent</ejb-name>
            <destination-jndi-name>InputQueueMDB</destination-jndi-name>
            <resource-ref>
            <res-ref-name>jms/QCF</res-ref-name>
            <jndi-name>QueueConnectionFactory</jndi-name>
            </resource-ref>
            </message-driven>
            </enterprise-beans>


            and the jndi bit of ejb-jar.xml looks like this:
            <resource-ref>
            <res-ref-name>jms/QCF</res-ref-name>
            <res-type>javax.jms.QueueConnectionFactory</res-type>
            <res-auth>Container</res-auth>
            </resource-ref>


            Can you spot anything wrong with this?

            Thanks,

            Javi

            • 3. Re: ClassCastException when deploying MDB
              Adrian Brock Master

              Looking at the code you need to add

              <xa-connection>false</xa-connection>

              in jboss.xml

              I couldn't find it documented anywhere?

              Regards,
              Adrian

              • 4. Re: ClassCastException when deploying MDB
                Javi Newbie

                Adrian,

                Thanks a lot for your reply. I'll try this and let the forum know how I got on.

                Cheers,

                Javi