1

I am working with Websphere Application Server version 7.0 and Websphere MQ version 7.5.0.2. I have built a .war file and deployed it on the server but when I try to send an MQ message things blow up and I receive the below error message...

[6/6/16 13:28:53:849 CDT] 0000001a ServletWrappe E com.ibm.ws.webcontainer.servlet.ServletWrapper 
service SRVE0068E: Uncaught exception created in one of the service methods of the servlet action in application xxxx_war. Exception created : 
java.lang.NoSuchMethodError: com/ibm/mq/jmqi/handles/Hconn.getQmgrSplCapability()Lcom/ibm/mq/constants/QmgrSplCapability;
at com.ibm.mq.ese.jmqi.InterceptedJmqiImpl.jmqiConnect(InterceptedJmqiImpl.java:313)

I have already checked the .war file and the class definetly exists in there. I'm a noob with WAS, could this potentially be some issue with my WAS configuration? I know this isn't a lot of information to go on but I am just looking for the right direction on where to look to fix this kind of thing.

Any help would be appreciated.

Gas
  • 17,601
  • 4
  • 46
  • 93
Jason
  • 1,371
  • 4
  • 21
  • 44
  • Its very hard to tell what are you trying to do. Add code from your servlet to the question. In general you should not pack MQ related jars with your application and use JNDI to lookup MQ resources and JMS API to send/receive messages. – Gas Jun 07 '16 at 07:35

2 Answers2

4

The problem here is simple. You have bundled WebSphere MQ client jar files within your application. This is unsupported and can cause all kinds of problems (mixed versions of classes loaded, strange behaviour, ClassNotFoundError etc etc). It is also not supported in any way.

The mixed versioning is the exact problem as you have a combined both MQ V7.5 Java client classes (in your app) and the V7.0.1 classes included in WebSphere Application Server (WSAS) V7.0 itself. The ese.intercept classes exist in your bundled V7.5 jars but they are trying to lookup a constant in a V7.0.1 class which does not have it defined.

WSAS ships a component called the WebSphere MQ JCA Resource Adapter (WMQ RA). It handles all communication to an MQ queue manager and supports both the classes for JMS API and the classes for Java API (though the former one should be used where possible). Even though WSAS V7.0 ships a version of the WMQ V7.0.1 Java client classes, they can cannot to any version of queue manager. WSAS makes all the MQ classes for JMS/Java classes within the WMQ RA available to deployed applications.

So, unpack your .war application, remove the MQ Java client jars you have in there, repackage, redeploy and try again.

Hope this helps!

a_cornish_pasty
  • 816
  • 4
  • 10
0

I was getting the same issue with camel and IBM MQ, where by I am using a custom inhouse jar which import differnet ibm mq version as compared to the one which I imported in my project. align the version to dependant jar and this resolve the issue.

Mike
  • 615
  • 1
  • 6
  • 10