12 Replies Latest reply on Jun 26, 2007 8:39 AM by srikanth_vals

    JBoss 4.0.2 MDB bind to remote MQSeries

      First off, I've dilligently tried running through all of the examples in the (Excellent) wiki article IntegrationWithWebSphereMQSeries
      http://wiki.jboss.org/wiki/Wiki.jsp?page=IntegrationWithWebSphereMQSeries

      My configuration is as follows:
      JBoss 4.0.2
      JDK 1.5.0_05
      MQSeries version 5.3 CSD08

      My last issue is with PartII, I cannot seem to get the sample MDBs to bind to the remote MQ queue. I've been successful with the other steps in the test, with the exception of the MQ Extended Transaction Client, which I'm in the process of getting installed. Other than that, all of the examples have worked:
      - Standalone client sends messages to both MQRequest and MQResponse Queues (so connectivity is working)
      - MDB is listening to JBoss Queue and posting reply to external MQResponse Queue
      All that is not working is getting the MDB to connect to the MQRequest Queue. Since the first test is working, I assume the MBeans are configured correctly.

      When I try to deploy the MDBs are per part 2 I get the following exception:


      2005-09-29 15:48:40,117 ERROR [org.jboss.ejb.EjbModule] Initialization failed jboss.j2ee:service=EjbModule,module=wsmqmdb.jar
      org.jboss.deployment.DeploymentException: Failed to find InvokerProxyBindingMetaData for: 'wsmq-message-driven-bean'. Check the invoker-proxy-binding-name to invoker-proxy-binding/name mappings in jboss.xml
      at org.jboss.ejb.EjbModule.getWebClassLoader(EjbModule.java:806)
      at org.jboss.ejb.EjbModule.initializeContainer(EjbModule.java:696)
      at org.jboss.ejb.EjbModule.createMessageDrivenContainer(EjbModule.java:568)
      at org.jboss.ejb.EjbModule.createContainer(EjbModule.java:535)
      at org.jboss.ejb.EjbModule.createService(EjbModule.java:330)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalCreate(ServiceMBeanSupport.java:238)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:220)
      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:249)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:897)
      at $Proxy0.create(Unknown Source)
      at org.jboss.system.ServiceController.create(ServiceController.java:330)
      at org.jboss.system.ServiceController.create(ServiceController.java:275)
      at sun.reflect.GeneratedMethodAccessor4.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:249)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      at $Proxy22.create(Unknown Source)
      at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:584)
      at org.jboss.deployment.MainDeployer.create(MainDeployer.java:918)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:774)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:738)
      at sun.reflect.GeneratedMethodAccessor48.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.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:121)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:127)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      at $Proxy8.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:325)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:501)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:204)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:215)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:194)

      and

      --- MBeans waiting for other MBeans ---
      ObjectName: jboss.j2ee:service=EjbModule,module=wsmqmdb.jar
      State: FAILED
      Reason: org.jboss.deployment.DeploymentException: Failed to find InvokerProxyBindingMetaData for: 'wsmq-message-driven-bean'. Check the invoker-proxy-binding-name to invoker-proxy-binding/name mappings in jboss.xml

      --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
      ObjectName: jboss.j2ee:service=EjbModule,module=wsmqmdb.jar
      State: FAILED
      Reason: org.jboss.deployment.DeploymentException: Failed to find InvokerProxyBindingMetaData for: 'wsmq-message-driven-bean'. Check the invoker-proxy-binding-name to invoker-proxy-binding/name mappings in jboss.xml


      Is the cause of the problem the fact that the configuration files are by default bound to the XAConnectionFactory? Is it because I skipped that step that I need to reconfigure resources/jboss.xml?
      I made all of the changes exactly as per the documentation.
      -I've updated jboss.xml as per the docs
      <?xml version="1.0"?>
      <jboss>
       <enterprise-beans>
       <message-driven>
       <ejb-name>MDB</ejb-name>
       <!--
       For JBossMQ use
       configuration = Standard Message Driven Bean
       destination = queue/RequestQueue
      
       For WSMQ use
       configuration = WSMQ Message Driven Bean
       destination = wsmq/RequestQueue
       -->
      
       <configuration-name>WSMQ Message Driven Bean</configuration-name>
      
       <destination-jndi-name>wsmq/RequestQueue</destination-jndi-name>
      
       </message-driven>
      
       </enterprise-beans>
      
       <!-- container configuration for WSMQ -->
      
       <container-configurations>
       <container-configuration extends="Standard Message Driven Bean">
       <container-name>WSMQ Message Driven Bean</container-name>
       <invoker-proxy-binding-name>wsmq-message-driven-bean</invoker-proxy-binding-name>
       </container-configuration>
       </container-configurations>
      
       <!-- The JmsProviderAdapterJNDI must match the ProviderName in SERVER_HOME/deploy/jms/wsmq-ds.xml file. -->
       <invoker-proxy-binding>
       <name>wsmq-message-driven-bean</name>
       <invoker-mbean>default</invoker-mbean>
       <proxy-factory>org.jboss.ejb.plugins.jms.JMSContainerInvoker</proxy-factory>
       <proxy-factory-config>
       <JMSProviderAdapterJNDI>WSMQJMSProvider</JMSProviderAdapterJNDI>
       <ServerSessionPoolFactoryJNDI>StdJMSPool</ServerSessionPoolFactoryJNDI>
       <CreateJBossMQDestination>true</CreateJBossMQDestination>
       <!-- WARN: Don't set this to zero until a bug in the pooled executor is fixed -->
       <MinimumSize>1</MinimumSize>
       <MaximumSize>15</MaximumSize>
       <KeepAliveMillis>30000</KeepAliveMillis>
       <MaxMessages>1</MaxMessages>
       <MDBConfig>
       <ReconnectIntervalSec>10</ReconnectIntervalSec>
       <DLQConfig>
       <DestinationQueue>queue/DLQ</DestinationQueue>
       <MaxTimesRedelivered>10</MaxTimesRedelivered>
       <TimeToLive>0</TimeToLive>
       </DLQConfig>
       </MDBConfig>
       </proxy-factory-config>
       </invoker-proxy-binding>
      
      
      
      </jboss>
      

      The exception states Failed to find InvokerProxyBindingMetaData for: 'wsmq-message-driven-bean'. Check the invoker-proxy-binding-name to invoker-proxy-binding/name mappings in jboss.xml, but clearly <invoker-proxy-binding-name> is the same as <invoker-proxy-binding/name>

      On a related note, the wiki is very well done, but there is a problem with the build.xml script that keeps the first test from working properly. Any experienced java developer could figure it out easily (the task needs a nother parameter "false") but I'd like to know if there is there an easy way to communicate with the author of the wiki.

      Thanks in advance
      --Paul

        • 1. Re: JBoss 4.0.2 MDB bind to remote MQSeries
          lucluc

          I have identical problem too.

          My configuration is as follows:
          JBoss 4.0.2
          JDK 1.5.0_05
          MQSeries version 5.3

          • 2. Re: JBoss 4.0.2 MDB bind to remote MQSeries

            The example is wrong, which a quick check against jboss_4_0.dtd would verify:

            <?xml version="1.0"?>
            <jboss>
             <enterprise-beans>
             <message-driven>
             <ejb-name>MDB</ejb-name>
             <!--
             For JBossMQ use
             configuration = Standard Message Driven Bean
             destination = queue/RequestQueue
            
             For WSMQ use
             configuration = WSMQ Message Driven Bean
             destination = wsmq/RequestQueue
             -->
            
             <configuration-name>WSMQ Message Driven Bean</configuration-name>
            
             <destination-jndi-name>wsmq/RequestQueue</destination-jndi-name>
            
             </message-driven>
            
             </enterprise-beans>
            
             <!-- container configuration for WSMQ -->
            
             <container-configurations>
             <container-configuration extends="Standard Message Driven Bean">
             <container-name>WSMQ Message Driven Bean</container-name>
             <invoker-proxy-binding-name>wsmq-message-driven-bean</invoker-proxy-binding-name>
             </container-configuration>
             </container-configurations>
            
             <!-- The JmsProviderAdapterJNDI must match the ProviderName in SERVER_HOME/deploy/jms/wsmq-ds.xml fil
            e. -->
            
            <invoker-proxy-bindings> <!-- ADD THIS -->
            
             <invoker-proxy-binding>
             <name>wsmq-message-driven-bean</name>
             <invoker-mbean>default</invoker-mbean>
             <proxy-factory>org.jboss.ejb.plugins.jms.JMSContainerInvoker</proxy-factory>
             <proxy-factory-config>
             <JMSProviderAdapterJNDI>WSMQJMSProvider</JMSProviderAdapterJNDI>
             <ServerSessionPoolFactoryJNDI>StdJMSPool</ServerSessionPoolFactoryJNDI>
             <CreateJBossMQDestination>true</CreateJBossMQDestination>
             <!-- WARN: Don't set this to zero until a bug in the pooled executor is fixed -->
             <MinimumSize>1</MinimumSize>
             <MaximumSize>15</MaximumSize>
             <KeepAliveMillis>30000</KeepAliveMillis>
             <MaxMessages>1</MaxMessages>
             <MDBConfig>
             <ReconnectIntervalSec>10</ReconnectIntervalSec>
             <DLQConfig>
             <DestinationQueue>queue/DLQ</DestinationQueue>
             <MaxTimesRedelivered>10</MaxTimesRedelivered>
             <TimeToLive>0</TimeToLive>
             </DLQConfig>
             </MDBConfig>
             </proxy-factory-config>
             </invoker-proxy-binding>
            
            </invoker-proxy-bindings> <!-- ADD THIS -->
            
            </jboss>
            


            • 3. Re: JBoss 4.0.2 MDB bind to remote MQSeries
              • 4. Re: JBoss 4.0.2 MDB bind to remote MQSeries
                luc.texier

                hmm, the file was correct on my box but invalid in the archive.

                I uploaded a new archive

                If you find anything else, keep posting in this thread

                • 5. Re: JBoss 4.0.2 MDB bind to remote MQSeries

                  Adrian,
                  Thanks for the help - worked like a charm.
                  As long as we're updating that project, you might want to add the following correction:

                  Add the following:

                  <arg value="${doFail}"/>

                  to each of the following ant tasks in build.xml:
                  wsmq-tests
                  wsmq2wsmq
                  wsmq2jboss


                  Thanks again!

                  • 6. Re: JBoss 4.0.2 MDB bind to remote MQSeries
                    luc.texier

                    Done

                    • 7. Re: JBoss 4.0.2 MDB bind to remote MQSeries
                      lucluc

                      It worked for me.
                      Thanks to all.
                      I appreciated the great wiki very much.

                      • 8. Re: JBoss 4.0.2 MDB bind to remote MQSeries
                        brobertarch

                        http://wiki.jboss.org/wiki/Wiki.jsp?page=UsingWebSphereMQSeriesWithJBossASPart2

                        Looking at this post it seems like you can connect the MDB using scenario 2.

                        I am getting this when the MDB is listening to WSMQ (Scenario 2)
                        Scenario one went pretty well (didn't try with XA though)

                        I am using :
                        - jboss-4.0.3RC2
                        - java full version "1.5.0_05-b05"

                        Any help thanks.

                        --------------------------------------------------------------------------------
                        08:38:19,658 INFO [JMSContainerInvoker] Trying to reconnect to JMS provider
                        08:38:21,269 ERROR [JMSContainerInvoker] Reconnect failed: JMS provider failure detected:
                        org.jboss.deployment.DeploymentException: Error during queue setup; - nested throwable: (java.lang.ClassCastException: com.ibm.mq.jms.MQQueue)
                        at org.jboss.deployment.DeploymentException.rethrowAsDeploymentException (DeploymentException.java:39)
                        at org.jboss.ejb.plugins.jms.JMSContainerInvoker.innerStartDelivery(JMSContainerInvoker.java:906)
                        at org.jboss.ejb.plugins.jms.JMSContainerInvoker$ExceptionListenerImpl.run(JMSContainerInvoker.java:1471)
                        at java.lang.Thread.run(Thread.java:595) Caused by: java.lang.ClassCastException: com.ibm.mq.jms.MQQueue
                        at org.jboss.mq.SpyConnectionConsumer.(SpyConnectionConsumer.java:91)
                        at org.jboss.mq.SpyConnection.createConnectionConsumer(SpyConnection.java:168)
                        at org.jboss.ejb.plugins.jms.JMSContainerInvoker.innerStartDelivery(JMSContainerInvoker.java:890)
                        ... 2 more

                        • 9. Re: JBoss 4.0.2 MDB bind to remote MQSeries
                          brobertarch

                          It was a configuration problem.
                          JBoss.xml file should read:

                          <configuration-name>WSMQ Message Driven Bean</configuration-name>

                          instead of:
                          <configuration-name>Standard Message Driven Bean</configuration-name>

                          The tag looks like a comment instead of an ID (i.e. wsmq-mdb-conf-name instead of WSMQ Message Driven Bean)

                          Also Non durable Topics work perfectly, next step is to try Durable Topics using MDB

                          • 10. Re: JBoss 4.0.2 MDB bind to remote MQSeries
                            jboss_mq

                            Adrian and Luc,

                            I have posted my issue elsewhere but it seems this thread is a good place.

                            Using this approach, we got the MDB working but however the MDB stops working after around two hours of idle time.

                            I wrote a java program using WSMQ base class that listens on a WSMQ queue with unlimited wait. It still works even after 10 hours of idle time.

                            I am wondering if there is an EJB setting inside the JBoss container that is disconnecting the MDB after certain idle period?

                            Can you see if you can duplicate this problem? Or you may be able to point me to a solution. Thanks!

                            • 11. Re: JBoss 4.0.2 MDB bind to remote MQSeries

                               

                              "jboss_mq" wrote:
                              Adrian and Luc,

                              I have posted my issue elsewhere but it seems this thread is a good place.


                              http://wiki.jboss.org/wiki/Wiki.jsp?page=BadPostHijack

                              AND DO NOT SEND UNSOLICTED E-MAILS TO PEOPLE!!!

                              • 12. Re: JBoss 4.0.2 MDB bind to remote MQSeries
                                srikanth_vals

                                Hi ,
                                I have written a sample MDB ,please find code below and i could receive message from MQ Queue but could not put in queue.
                                I have followed the steps in http://wiki.jboss.org/wiki/Wiki.jsp?page=UsingWebSphereMQSeriesWithJBossASPart4

                                I need it very urgently, please help



                                TextMessage tm = (TextMessage)m;

                                String text = tm.getText();
                                System.out.println("message " + text + " received");
                                String result = process(text);
                                System.out.println("message processed, result: " + result);

                                conn = getConnection();
                                session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
                                System.out.println("Bef ic");
                                InitialContext ic = new InitialContext();
                                Queue que = (Queue)ic.lookup("newq");
                                System.out.println("Aft ic");

                                Destination replyTo = (Queue)que;
                                System.out.println(replyTo.toString());
                                MessageProducer producer = session.createProducer(replyTo);
                                System.out.println("Aft crt prod");
                                TextMessage reply = session.createTextMessage(result);

                                producer.send(reply);
                                producer.close();