Author |
Message
|
MABeatty1978 |
Posted: Mon Oct 16, 2017 6:51 am Post subject: Unknown constant tag 84 in class file com/ibm/mq/jmqi/JmqiEn |
|
|
Acolyte
Joined: 17 Jul 2014 Posts: 54
|
I've got a java application that is bombing out when trying to connect to MQ. Here is the stack trace:
Exception in thread "main" java.lang.ClassFormatError: Unknown constant tag 84 in class file com/ibm/mq/jmqi/JmqiEnvironment
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:274)
at com.ibm.msg.client.commonservices.componentmanager.ComponentManager$3.run(ComponentManager.java:1241)
at java.security.AccessController.doPrivileged(Native Method)
at com.ibm.msg.client.commonservices.componentmanager.ComponentManager.dynamicLoadClass(ComponentManager.java:1219)
at com.ibm.msg.client.commonservices.componentmanager.ComponentManager.locateComponents(ComponentManager.java:330)
at com.ibm.msg.client.commonservices.componentmanager.ComponentManager.findComponent(ComponentManager.java:239)
at com.ibm.msg.client.commonservices.componentmanager.ComponentManager.access$000(ComponentManager.java:65)
at com.ibm.msg.client.commonservices.componentmanager.ComponentManager$2.run(ComponentManager.java:824)
at java.security.AccessController.doPrivileged(Native Method)
at com.ibm.msg.client.commonservices.componentmanager.ComponentManager.init(ComponentManager.java:820)
at com.ibm.msg.client.commonservices.componentmanager.ComponentManager.init(ComponentManager.java:775)
at com.ibm.msg.client.commonservices.componentmanager.ComponentManager.getInstance(ComponentManager.java:1042)
at com.ibm.msg.client.commonservices.CommonServices.<clinit>(CommonServices.java:103)
at com.ibm.msg.client.commonservices.propertystore.PropertyStore.initialize(PropertyStore.java:507)
at com.ibm.msg.client.commonservices.propertystore.PropertyStore.<clinit>(PropertyStore.java:229)
at com.ibm.msg.client.commonservices.trace.Trace.<clinit>(Trace.java:424)
at com.ibm.msg.client.commonservices.cssystem.WASSupport.<clinit>(WASSupport.java:47)
at com.ibm.mq.internal.MQCommonServices$6.run(MQCommonServices.java:1263)
at com.ibm.mq.internal.MQCommonServices$Helper.runIgnoresNoClass(MQCommonServices.java:1322)
at com.ibm.mq.internal.MQCommonServices.isJmsCommonServicesRequired(MQCommonServices.java:1277)
at com.ibm.mq.internal.MQCommonServices.<clinit>(MQCommonServices.java:265)
at com.ibm.mq.MQSESSION.getJmqiEnv(MQSESSION.java:142)
at com.ibm.mq.MQQueueManagerFactory.<init>(MQQueueManagerFactory.java:85)
at com.ibm.mq.MQQueueManagerFactory.getInstance(MQQueueManagerFactory.java:112)
at com.ibm.mq.MQQueueManager.<clinit>(MQQueueManager.java:155)
at com.sherwin.protocolhandler.ProtocolHandler.startup(ProtocolHandler.java:90)
at com.sherwin.protocolhandler.ProtocolHandler.main(ProtocolHandler.java:56)
From what I'm reading on this exception, the class file is corrupt? How could I correct this? |
|
Back to top |
|
 |
mqjeff |
Posted: Mon Oct 16, 2017 7:29 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
That's not anything about a corrupt class file.
It says that there's a constant being passed in that has a value of 84, and the listed class doesn't know about it.
Which, if you start at the back of the stack trace, says that
com.sherwin.protocolhandler.ProtocolHandler.startup(ProtocolHandler.java:90)
is passing a bad value to
com.ibm.mq.MQQueueManager.<clinit>(MQQueueManager.java:155)
Potentially, you're using a constructor or passing in options that require newer versions of the MQ classes you are using. Perhaps you're using MQv7 classes and trying to pass in MQV8 parameters. _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
MABeatty1978 |
Posted: Mon Oct 16, 2017 7:43 am Post subject: |
|
|
Acolyte
Joined: 17 Jul 2014 Posts: 54
|
mqjeff wrote: |
That's not anything about a corrupt class file.
It says that there's a constant being passed in that has a value of 84, and the listed class doesn't know about it.
Which, if you start at the back of the stack trace, says that
com.sherwin.protocolhandler.ProtocolHandler.startup(ProtocolHandler.java:90)
is passing a bad value to
com.ibm.mq.MQQueueManager.<clinit>(MQQueueManager.java:155)
Potentially, you're using a constructor or passing in options that require newer versions of the MQ classes you are using. Perhaps you're using MQv7 classes and trying to pass in MQV8 parameters. |
I'm not sure how that could be possible: The call is pretty straight forward:
Code: |
MQQueueManager qmgr = null;
try {
qmgr = new MQQueueManager(System.getenv("QMGR"));
} catch (MQException ex){
if (ex.getReason()== 2059){
PCHLog.log("Queue Manager Not Available. Exiting");
}
else {
PCHLog.log(new RCReply("C5027", ex));
}
System.exit(1);
} |
It is MQ version 7, but this code is running in thousands of locations with all the same software, this is the only one experiencing the issue. Are the java classes that are being used typically located in /opt/mqm/java/lib? |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Oct 16, 2017 8:22 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
MABeatty1978 wrote: |
Are the java classes that are being used typically located in /opt/mqm/java/lib? |
Yes they are.  _________________ MQ & Broker admin |
|
Back to top |
|
 |
MABeatty1978 |
Posted: Mon Oct 16, 2017 8:43 am Post subject: |
|
|
Acolyte
Joined: 17 Jul 2014 Posts: 54
|
fjb_saper wrote: |
MABeatty1978 wrote: |
Are the java classes that are being used typically located in /opt/mqm/java/lib? |
Yes they are.  |
So if the libraries are identical in a working and nonworking location, then I can rule the library themselves out? |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Oct 16, 2017 9:05 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
MABeatty1978 wrote: |
fjb_saper wrote: |
MABeatty1978 wrote: |
Are the java classes that are being used typically located in /opt/mqm/java/lib? |
Yes they are.  |
So if the libraries are identical in a working and nonworking location, then I can rule the library themselves out? |
Only if the file comparison shows the same content and not additional jars are found in those locations (mix of versions)...
You might also need to look at the so libraries in those locations as they are use to connect in "bindings" mode.
However I'd believe that you are trying to use a feature from a later release not present in the current setup. Like a constant value not yet present in MQConstants?
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
mqjeff |
Posted: Tue Oct 17, 2017 4:13 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
You should also look at how this code is being run, that is the shell environment that it is being launched from.
If there is more than one MQ Installation on the machine, and you are not actually at MQ v7.0.x but 7.1.x or 7.5.x, then you might not be using the default installation.
If so, you need to make sure that your code is running in a shell that is tied to the right version of MQ.
Well, this could be true even if you are at 7.0.x - if the admin has set things up so that all applications run under the never version context. _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
|