1

I am working on a spring boot JMS application which connects to IBM MQ to send and receive JMS message. I have used the following maven dependencies for the same

    <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-databind</artifactId>
    </dependency>

    <dependency>
        <groupId>com.ibm.mq</groupId>
        <artifactId>mq-jms-spring-boot-starter</artifactId>
        <version>0.0.3</version>
    </dependency>

I deployed the wmq.jmsra.rar to the Payara 4 server, configured all the queue connection factory JNDI and Queue admin objects. After this when I deploy the war file of the application I am getting an error

org.springframework.jms.UncategorizedJmsException: Uncategorized exception occurred during JMS processing; nested exception is com.ibm.msg.client.jms.DetailedJMSException: MQJCA1011: Failed to allocate a JMS connection.
An internal error caused an attempt to allocate a connection to fail.
See the linked exception for details of the failure.
at org.springframework.jms.support.JmsUtils.convertJmsAccessException(JmsUtils.java:316)

With the root cause as

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:3082)
at java.lang.Class.getConstructor(Class.java:1825)
at com.ibm.mq.jmqi.JmqiEnvironment.getInstance(JmqiEnvironment.java:702)
... 112 common frames omitted

I am not sure what the issue could be. I checked many online forums however couldn't find any solution, it seems to be related to some JAR conflict but I am not sure.

James Z
  • 12,209
  • 10
  • 24
  • 44
coder
  • 400
  • 1
  • 7
  • 19
  • You said you deployed the `wmq.jmsra.rar`, this includes all the `com.ibm.*` jar files required to connect to MQ. By specifying the `com.ibm.mq` entry in the maven dependencies, does that mean in addition to what the rar provided you are importing some other `com.ibm.mq.*` jar files (ex: `com.ibm.mq.jar`)? If you are then that is probably your problem. Just let Payara 4 pick up what the `wmq.jmsra.rar` provides. – JoshMc Sep 07 '18 at 18:16
  • I tried setting the scope of the maven dependency as provided, still got the same error – coder Sep 07 '18 at 18:19
  • What version of MQ is the rar from. – JoshMc Sep 07 '18 at 18:26
  • The version is " Implementation-Version: 9.0.0.0-p900-L160512.4' – coder Sep 07 '18 at 18:28
  • Do you directly have any other mq jars in the classpath? Note most start with com.ibm.mq* but the are others that are Oracle provided jars: jms.jar this must be jms 2.0 for mq v8 or later. If you use binding files there is also fscontext.jar and providerutil.jar. These should all be in the rar, remove any that are not sourcing from the rar. Note versions of mq prior to 8 also included connector.jar and dbhcore.jar, these are no longer required for v8 or later, I have had issues if these are in the class path with v9. – JoshMc Sep 07 '18 at 19:16
  • I do not have any other jar in the classpath – coder Sep 07 '18 at 19:22
  • You could try to collect a IBM MQ JMS trace. Add these as java system properties `-Dcom.ibm.msg.client.commonservices.trace.status=ON -Dcom.ibm.msg.client.commonservices.trace.outputName=/director/for/tracefile/mqjms.trc`. Not sure how you would accomplish that with Payara 4. – JoshMc Sep 07 '18 at 19:57
  • Looks like you can add these to the `domail.xml` like `` and `` – JoshMc Sep 07 '18 at 20:01
  • I am not able to set these properties, I am facing this issue in the company servers and the system properties are restricted – coder Sep 07 '18 at 20:27
  • I tried in the local payara server however the issue is not replicable in local – coder Sep 07 '18 at 20:28

1 Answers1

1

I replaced the maven dependencies to resolve the issue. There was a conflict with one of the jar files from mq-jms-spring-boot-starter dependency which was causing the problem

    <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-databind</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-jms</artifactId>
        <version>4.3.12.RELEASE</version>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>javax.jms</groupId>
        <artifactId>javax.jms-api</artifactId>
        <version>2.0.1</version>
        <scope>provided</scope>
    </dependency>
coder
  • 400
  • 1
  • 7
  • 19