7 Replies Latest reply on Feb 15, 2019 6:42 AM by alesch74

    MQ Howto?

    thinusp

      Hi All

       

      Pretty new to the whole JBoss thing.

       

      I am looking for a Howto or something on getting MQ and Message Driven Beans to play nice. I've installed MQ (7.1.0-2) and latest nightly build of JBoss 7.2. (there is a bug in 7.1.1 where MDB's where not activated when a message is placed on a Queue).

       

      I've deployed the resource adapter and it seems to deploy sucessfully. My MDB has an activation config via annotations. Upon deployment of the EAR project I get a RemoteFAP<init> NoSuchMethodException referring to the constructor for the RemoteFAP class. I have inspected the jar file (JMQI MQ jar file) and the constructor is definitly there.

       

      So my initial questions are:

      * Is there a step by step tutorial somewhere that shows how to get MQ working with JBoss for the above mentioned versions?

      * Failing that, which MQ jars should be included in my EAR? (currently I have the com.ibm.mq, jmqi and jms jars included at this point in time).

       

      Currently I have no idea where the issues may be hiding (is it MQ or the fact that I'm trying to use the nightly JBoss build). Any pointers would be appreciated.

       

      Thinus

        • 1. Re: MQ Howto?
          thinusp

          Hi everyone

           

          I am still stuck with this issue. MQ 7.1 patched to .02 and atill getting the NoSuchMethodException on the constructor of RemoteFAP. The full exception:

           

          08:03:07,173 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 121) MSC00001: Failed to start service jboss.deployment.subunit."CRMEAR.ear"."CRM.jar".component.AccountPublishMDB.START: org.jboss.msc.service.StartException in service jboss.deployment.subunit."CRMEAR.ear"."CRM.jar".component.AccountPublishMDB.START: java.lang.RuntimeException: com.ibm.mq.connector.DetailedResourceAdapterInternalException: MQJCA1011: Failed to allocate a JMS connection., error code: MQJCA1011 An internal error caused an attempt to allocate a connection to fail. See the linked exception for details of the failure.

                    at org.jboss.as.ee.component.ComponentStartService$1.run(ComponentStartService.java:57) [jboss-as-ee-7.2.0.Alpha1-SNAPSHOT.jar:7.2.0.Alpha1-SNAPSHOT]

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

                    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) [rt.jar:1.7.0_09]

                    at java.util.concurrent.FutureTask.run(FutureTask.java:166) [rt.jar:1.7.0_09]

                    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_09]

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

                    at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_09]

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

          Caused by: java.lang.RuntimeException: com.ibm.mq.connector.DetailedResourceAdapterInternalException: MQJCA1011: Failed to allocate a JMS connection., error code: MQJCA1011 An internal error caused an attempt to allocate a connection to fail. See the linked exception for details of the failure.

                    at org.jboss.as.ejb3.component.messagedriven.MessageDrivenComponent.start(MessageDrivenComponent.java:177)

                    at org.jboss.as.ee.component.ComponentStartService$1.run(ComponentStartService.java:54) [jboss-as-ee-7.2.0.Alpha1-SNAPSHOT.jar:7.2.0.Alpha1-SNAPSHOT]

                    ... 7 more

          Caused by: com.ibm.mq.connector.DetailedResourceAdapterInternalException: MQJCA1011: Failed to allocate a JMS connection., error code: MQJCA1011 An internal error caused an attempt to allocate a connection to fail. See the linked exception for details of the failure.

                    at com.ibm.mq.connector.services.JCAExceptionBuilder.buildException(JCAExceptionBuilder.java:129)

                    at com.ibm.mq.connector.services.JCAExceptionBuilder.buildException(JCAExceptionBuilder.java:100)

                    at com.ibm.mq.connector.inbound.ConnectionHandler.allocateConnection(ConnectionHandler.java:299)

                    at com.ibm.mq.connector.inbound.MessageEndpointDeployment.acquireConnection(MessageEndpointDeployment.java:270)

                    at com.ibm.mq.connector.inbound.MessageEndpointDeployment.<init>(MessageEndpointDeployment.java:222)

                    at com.ibm.mq.connector.ResourceAdapterImpl.endpointActivation(ResourceAdapterImpl.java:397)

                    at org.jboss.jca.core.rar.EndpointImpl.activate(EndpointImpl.java:164)

                    at org.jboss.as.ejb3.component.messagedriven.MessageDrivenComponent.start(MessageDrivenComponent.java:175)

                    ... 8 more

          Caused by: com.ibm.msg.client.jms.DetailedJMSException: JMSFMQ6312: An exception occurred in the Java(tm) MQI.

          The Java(tm) MQI has thrown an exception describing the problem.

          See the linked exception for further information.

                    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [rt.jar:1.7.0_09]

                    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) [rt.jar:1.7.0_09]

                    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [rt.jar:1.7.0_09]

                    at java.lang.reflect.Constructor.newInstance(Constructor.java:525) [rt.jar:1.7.0_09]

                    at com.ibm.msg.client.commonservices.j2se.NLSServices.createException(NLSServices.java:314)

                    at com.ibm.msg.client.commonservices.nls.NLSServices.createException(NLSServices.java:228)

                    at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createV7ProviderConnection(WMQConnectionFactory.java:6759)

                    at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createProviderConnection(WMQConnectionFactory.java:6151)

                    at com.ibm.msg.client.jms.admin.JmsConnectionFactoryImpl.createConnection(JmsConnectionFactoryImpl.java:280)

                    at com.ibm.mq.jms.MQConnectionFactory.createCommonConnection(MQConnectionFactory.java:6143)

                    at com.ibm.mq.jms.MQConnectionFactory.createConnection(MQConnectionFactory.java:6199)

                    at com.ibm.mq.connector.inbound.ConnectionHandler.allocateConnection(ConnectionHandler.java:205)

                    ... 13 more

          Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2195;AMQ9546: Error return code received. [1=java.lang.NoSuchMethodException[com.ibm.mq.jmqi.remote.api.RemoteFAP.<init>(com.ibm.mq.jmqi.JmqiEnvironment, int)],3=Class.getConstructor0]

                    at com.ibm.mq.jmqi.JmqiEnvironment.getInstance(JmqiEnvironment.java:795)

                    at com.ibm.mq.jmqi.JmqiEnvironment.getMQI(JmqiEnvironment.java:651)

                    at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createV7ProviderConnection(WMQConnectionFactory.java:6751)

                    ... 18 more

          Caused by: java.lang.NoSuchMethodException: com.ibm.mq.jmqi.remote.api.RemoteFAP.<init>(com.ibm.mq.jmqi.JmqiEnvironment, int)

                    at java.lang.Class.getConstructor0(Class.java:2721) [rt.jar:1.7.0_09]

                    at java.lang.Class.getConstructor(Class.java:1674) [rt.jar:1.7.0_09]

                    at com.ibm.mq.jmqi.JmqiEnvironment.getInstance(JmqiEnvironment.java:713)

                    ... 20 more

           

          This is driving me crazy, what am I missing here? When I browse the RemoteFAP class using eclipse the constructor is there, and it takes the proper arguments. It doesn't look like there is more than one RemoteFAP class on my classpath.

           

          Kind regards

          Thinus

          • 2. Re: MQ Howto?
            vrastsel

            Hi, did you resolve this issue? I have the same problem now.

            Regards, Vladimir

            • 3. Re: MQ Howto?
              vrastsel

              Resolved. There was a classloading problem. A MDB, packed in .ear, need to have explicit dependency on deployed .rar archive.

              • 4. Re: MQ Howto?
                gurpreetsingh1430

                How did you explicitly declare dependency on .rar flle from MDB?? Did you use any annotation tag??

                • 5. Re: MQ Howto?
                  johnson.tuscano

                  Hi Vladimir,

                  Could you please provide the details of resolution? I'm encountering similar issue. How to add explicit dependency for MDB on deployed .rar archive?

                   

                  Thanks

                  Johnson

                  • 6. Re: MQ Howto?
                    vnktsh

                    can someone post the resolution. I am facing the same exception.

                    • 7. Re: MQ Howto?
                      alesch74

                      our solution was to make an explicit entry in the EAR "META-INF/jboss-deployment-structure.xml" file:

                       

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

                        <ear-subdeployments-isolated>false</ear-subdeployments-isolated>

                        <sub-deployment name="your-ejb.jar">

                         <dependencies>

                         <module name="deployment.wmq.jmsra.rar" export="true" />

                         </dependencies>

                        </sub-deployment>

                        <!--
                        . . . 
                        -->
                      </jboss-deployment-structure>