1 Reply Latest reply on Oct 7, 2011 2:07 AM by sven.loe

    J2EE 1.4 App with MQueue on JBoss 5.1 fails to work

    sven.loe

      Hello,

       

      I am porting an old J2EE 1.4 App from Websphere to JBoss 5.1. It has several queues with MDBs on Jboss of which 3 have to connect to an ibm MQueue on a host. I have configured it according to this resource: http://www.ibm.com/developerworks/websphere/library/techarticles/0710_ritchie/0710_ritchie.html but it throws an Exception when it tries to process the first message. To connect to the MQueue wmq.jmsra.rar version 7 is used. I tried to connect to the MQueue with HermesJMS and it worked. Has anybody an idea why I get this Exception: 

       

      13:59:45,456 INFO  [ServerImpl] JBoss (Microcontainer) [5.1.0.GA (build: SVNTag=JBoss_5_1_0_GA date=200905221634)] Started in 1m:874ms

      13:59:46,925 WARN  [JmsActivation] Failure in jms activation org.jboss.resource.adapter.jms.inflow.JmsActivationSpec@1eecd5d(ra=org.jboss.resource.adapter.jms.JmsResourceAdapter@9c80a8 destination=jms/rdp/elanContractFlowDeltaQueue destinationType=javax.jms.Queue tx=true durable=false reconnect=10 provider=DefaultJMSProvider user=null maxMessages=1 minSession=1 maxSession=15 keepAlive=30000 useDLQ=true DLQHandler=org.jboss.resource.adapter.jms.inflow.dlq.GenericDLQHandler DLQJndiName=queue/DLQ DLQUser=null DLQMaxResent=10)

      java.lang.ClassCastException: com.ibm.mq.jms.MQQueue cannot be cast to org.jboss.jms.destination.JBossDestination

          at org.jboss.jms.client.container.SessionAspect.handleCreateConnectionConsumer(SessionAspect.java:766)

          at org.jboss.aop.advice.org.jboss.jms.client.container.SessionAspect_z_handleCreateConnectionConsumer_18075390.invoke(SessionAspect_z_handleCreateConnectionConsumer_18075390.java)

          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

          at org.jboss.jms.client.container.ClosedInterceptor.invoke(ClosedInterceptor.java:170)

          at org.jboss.aop.advice.PerInstanceInterceptor.invoke(PerInstanceInterceptor.java:86)

          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

          at org.jboss.jms.client.delegate.ClientConnectionDelegate.createConnectionConsumer(ClientConnectionDelegate.java)

          at org.jboss.jms.client.JBossConnection.createConnectionConsumer(JBossConnection.java:140)

          at org.jboss.resource.adapter.jms.inflow.JmsServerSessionPool.setupConsumer(JmsServerSessionPool.java:289)

          at org.jboss.resource.adapter.jms.inflow.JmsServerSessionPool.start(JmsServerSessionPool.java:89)

          at org.jboss.resource.adapter.jms.inflow.JmsActivation.setupSessionPool(JmsActivation.java:656)

          at org.jboss.resource.adapter.jms.inflow.JmsActivation.setup(JmsActivation.java:359)

          at org.jboss.resource.adapter.jms.inflow.JmsActivation$SetupActivation.run(JmsActivation.java:729)

          at org.jboss.resource.work.WorkWrapper.execute(WorkWrapper.java:205)

          at org.jboss.util.threadpool.BasicTaskWrapper.run(BasicTaskWrapper.java:260)

          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

          at java.lang.Thread.run(Thread.java:619)

      13:59:56,977 INFO  [JmsActivation] Attempting to reconnect org.jboss.resource.adapter.jms.inflow.JmsActivationSpec@1eecd5d(ra=org.jboss.resource.adapter.jms.JmsResourceAdapter@9c80a8 destination=jms/rdp/elanContractFlowDeltaQueue destinationType=javax.jms.Queue tx=true durable=false reconnect=10 provider=DefaultJMSProvider user=null maxMessages=1 minSession=1 maxSession=15 keepAlive=30000 useDLQ=true DLQHandler=org.jboss.resource.adapter.jms.inflow.dlq.GenericDLQHandler DLQJndiName=queue/DLQ DLQUser=null DLQMaxResent=10)

      13:59:57,071 ERROR [JmsActivation] Unable to reconnect org.jboss.resource.adapter.jms.inflow.JmsActivationSpec@1eecd5d(ra=org.jboss.resource.adapter.jms.JmsResourceAdapter@9c80a8 destination=jms/rdp/elanContractFlowDeltaQueue destinationType=javax.jms.Queue tx=true durable=false reconnect=10 provider=DefaultJMSProvider user=null maxMessages=1 minSession=1 maxSession=15 keepAlive=30000 useDLQ=true DLQHandler=org.jboss.resource.adapter.jms.inflow.dlq.GenericDLQHandler DLQJndiName=queue/DLQ DLQUser=null DLQMaxResent=10)

      java.lang.ClassCastException: com.ibm.mq.jms.MQQueue cannot be cast to org.jboss.jms.destination.JBossDestination

          at org.jboss.jms.client.container.SessionAspect.handleCreateConnectionConsumer(SessionAspect.java:766)

          at org.jboss.aop.advice.org.jboss.jms.client.container.SessionAspect_z_handleCreateConnectionConsumer_18075390.invoke(SessionAspect_z_handleCreateConnectionConsumer_18075390.java)

          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

          at org.jboss.jms.client.container.ClosedInterceptor.invoke(ClosedInterceptor.java:170)

          at org.jboss.aop.advice.PerInstanceInterceptor.invoke(PerInstanceInterceptor.java:86)

          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

          at org.jboss.jms.client.delegate.ClientConnectionDelegate.createConnectionConsumer(ClientConnectionDelegate.java)

          at org.jboss.jms.client.JBossConnection.createConnectionConsumer(JBossConnection.java:140)

          at org.jboss.resource.adapter.jms.inflow.JmsServerSessionPool.setupConsumer(JmsServerSessionPool.java:289)

          at org.jboss.resource.adapter.jms.inflow.JmsServerSessionPool.start(JmsServerSessionPool.java:89)

          at org.jboss.resource.adapter.jms.inflow.JmsActivation.setupSessionPool(JmsActivation.java:656)

          at org.jboss.resource.adapter.jms.inflow.JmsActivation.setup(JmsActivation.java:359)

          at org.jboss.resource.adapter.jms.inflow.JmsActivation.handleFailure(JmsActivation.java:292)

          at org.jboss.resource.adapter.jms.inflow.JmsActivation$SetupActivation.run(JmsActivation.java:733)

          at org.jboss.resource.work.WorkWrapper.execute(WorkWrapper.java:205)

          at org.jboss.util.threadpool.BasicTaskWrapper.run(BasicTaskWrapper.java:260)

          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

          at java.lang.Thread.run(Thread.java:619)

       

      I have seen some solutions in the net but they all use Java EE 5 and I can not port the app because of this problem. I hope someone has an idea. Here comes my config:

       

      wmq.jmsra-ds.xml:

       

      <?xml version="1.0" encoding="UTF-8"?>

       

      <connection-factories>

        <!-- connection factory definition -->

        <tx-connection-factory>

       

          <jndi-name>RDPCF</jndi-name>

          <xa-transaction />

          <rar-name>wmq.jmsra.rar</rar-name>

       

          <connection-definition>

            javax.jms.ConnectionFactory

          </connection-definition>

       

          <config-property name="channel" type="java.lang.String">

            CLIENT.TO.QT01

          </config-property>

          <config-property name="hostName" type="java.lang.String">

            192.168.1.32

          </config-property>

          <config-property name="port" type="java.lang.String">

            1415

          </config-property>

          <config-property name="queueManager" type="java.lang.String">

            QT01

          </config-property>

          <config-property name="transportType" type="java.lang.String">

            CLIENT

          </config-property>

       

          <security-domain-and-application>JmsXARealm</security-domain-and-application>

        </tx-connection-factory>

       

        <!-- admin object definition -->

        <mbean code="org.jboss.resource.deployment.AdminObject"

            name="jca.wmq:name=elanContractFlowDeltaQueue">

       

          <attribute name="JNDIName">jms/DeltaQueue</attribute>

          <depends optional-attribute-name="RARName">

            jboss.jca:service=RARDeployment,name='wmq.jmsra.rar'

          </depends>

          <attribute name="Type">javax.jms.Queue</attribute>

       

          <attribute name="Properties">

            baseQueueManagerName=QT01

            baseQueueName=A.QUE

          </attribute>

        </mbean>

      </connection-factories>

       

      jboss.xml:

       

      <?xml version='1.0' encoding='UTF-8' ?>

      <jboss>

          <message-driven>   

              <resource-adapter-name>wmq.jmsra.rar</resource-adapter-name>

              <ejb-name>AdapterMDB</ejb-name>

              <!-- use the a JMS invoker bindings for message inflow driven beans -->

               <invoker-bindings>

                 <invoker>

                   <invoker-proxy-binding-name>message-inflow-driven-bean</invoker-proxy-binding-name>

                 </invoker>

               </invoker-bindings>

              <configuration-name>

              </configuration-name>

              <activation-config>

                  <activation-config-property>

                      <activation-config-property-name>destination

                      </activation-config-property-name>               

                      <activation-config-property-value>jms/DeltaQueue

                      </activation-config-property-value>

                  </activation-config-property>

                  <activation-config-property>

                      <activation-config-property-name>destinationType

                      </activation-config-property-name>

                      <activation-config-property-value>javax.jms.Queue

                      </activation-config-property-value>

                  </activation-config-property>

                  <activation-config-property>

                      <activation-config-property-name>hostName

                      </activation-config-property-name>

                      <activation-config-property-value>192.168.1.32

                      </activation-config-property-value>

                  </activation-config-property>

                  <activation-config-property>

                      <activation-config-property-name>port

                      </activation-config-property-name>

                      <activation-config-property-value>1415

                      </activation-config-property-value>

                  </activation-config-property>

                  <activation-config-property>

                      <activation-config-property-name>channel

                      </activation-config-property-name>

                      <activation-config-property-value>CLIENT.TO.QT01

                      </activation-config-property-value>

                  </activation-config-property>

                  <activation-config-property>

                      <activation-config-property-name>queueManager

                      </activation-config-property-name>

                      <activation-config-property-value>QT01

                      </activation-config-property-value>

                  </activation-config-property>

                  <activation-config-property>

                      <activation-config-property-name>transportType

                      </activation-config-property-name>

                      <activation-config-property-value>CLIENT

                      </activation-config-property-value>

                  </activation-config-property>

                  <activation-config-property>

                      <activation-config-property-name>useJNDI

                      </activation-config-property-name>

                      <activation-config-property-value>true

                      </activation-config-property-value>

                  </activation-config-property>

              </activation-config>       

            

          </message-driven>

      </jboss>

       

      ejb-jar.xml

       

      <?xml version="1.0" encoding="UTF-8"?>

      <ejb-jar id="ejb-jar_MPSPartnerFlowAdapter" version="2.1"

          xmlns="http://java.sun.com/xml/ns/j2ee"

          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

          xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd">

          <display-name>deltadetect_ejb</display-name>

          <enterprise-beans>

              <message-driven id="AdapterMDB">

                  <ejb-name id="AdapterMDBEJB">AdapterMDB</ejb-name>

                  <ejb-class>

                      ch.mobi.rdp.flow.adapter.business.ejb.AdapterMDB

                  </ejb-class>

                  <messaging-type>javax.jms.MessageListener</messaging-type>

                  <transaction-type>Container</transaction-type>

                  <message-destination-type>javax.jms.Queue</message-destination-type>

                  <activation-config>

                      <activation-config-property>

                          <activation-config-property-name>

                              destinationType

                          </activation-config-property-name>

                          <activation-config-property-value>

                              javax.jms.Queue

                          </activation-config-property-value>

                      </activation-config-property>

                      <activation-config-property>

                          <activation-config-property-name>

                              acknowledgeMode

                          </activation-config-property-name>

                          <activation-config-property-value>

                              Auto-acknowledge

                          </activation-config-property-value>

                      </activation-config-property>

                  </activation-config>

              </message-driven>

          </enterprise-beans>

          <assembly-descriptor>

              <container-transaction>

                  <method>

                      <ejb-name>AdapterMDB</ejb-name>

                      <method-name>*</method-name>

                  </method>

                  <trans-attribute>Required</trans-attribute>

              </container-transaction>

          </assembly-descriptor>

      </ejb-jar>

       

      Yours Sven