通过Python访问com.ibm.mq时出错

时间:2018-10-22 13:40:40

标签: java python ibm-mq mq

我正在访问com.ibm.mq IBM MQ软件包的库,并得到此错误。我不知道这是什么意思,因为我是Java新手,将不胜感激。

openOptions = MQC.MQOO_INQUIRE + MQC.MQOO_FAIL_IF_QUIESCING + MQC.MQOO_INPUT_SHARED

mqEnv = MQEnvironment()
mqEnv.hostname = host
mqEnv.port = port
mqEnv.channel = channel

qMgr = MQQueueManager(qManager) ##This is where the Error is seen

错误:

Exception Details:   Location:
    com/ibm/mq/ese/jmqi/ESEJMQI.spiConnect(Ljava/lang/String;Lcom/ibm/mq/jmqi/system/SpiConnectOptions;Lcom/ibm/mq/jmqi/MQCNO;Lcom/ibm/mq/jmqi/handles/Phconn;Lcom/ibm/mq/jmqi/handles/Pint;Lcom/ibm/mq/jmqi/handles/Pint;)V
@63: invokespecial   Reason:
    Type 'com/ibm/mq/jmqi/system/SpiConnectOptions' (current frame, stack[2]) is not assignable to
'com/ibm/mq/jmqi/system/LpiPrivConnStruct'   Current Frame:
    bci: @63
    flags: { }
    locals: { 'com/ibm/mq/ese/jmqi/ESEJMQI', 'java/lang/String', 'com/ibm/mq/jmqi/system/SpiConnectOptions', 'com/ibm/mq/jmqi/MQCNO',
'com/ibm/mq/jmqi/handles/Phconn', 'com/ibm/mq/jmqi/handles/Pint',
'com/ibm/mq/jmqi/handles/Pint' }
    stack: { 'com/ibm/mq/ese/jmqi/ESEJMQI', 'java/lang/String', 'com/ibm/mq/jmqi/system/SpiConnectOptions', 'com/ibm/mq/jmqi/MQCNO',
'com/ibm/mq/jmqi/handles/Phconn', 'com/ibm/mq/jmqi/handles/Pint',
'com/ibm/mq/jmqi/handles/Pint' }   Bytecode:
    0x0000000: b200 0399 002b 2a12 0412 5010 06bd 0006
    0x0000010: 5903 2b53 5904 2c53 5905 2d53 5906 1904
    0x0000020: 5359 0719 0553 5908 1906 53b8 0008 2ab4
    0x0000030: 0002 9a00 1f2a 2b2c 2d19 0419 0519 06b7
    0x0000040: 0051 b200 0399 000b 2a12 0412 50b8 0012
    0x0000050: b12a b400 0cc0 003e 2b2c 2d19 0419 0519
    0x0000060: 06b9 0052 0700 b200 0399 000b 2a12 0412
    0x0000070: 50b8 0012 b1                              Stackmap Table:
    same_frame(@46)
    same_frame(@80)
    same_frame(@81)
    same_frame(@116)


    at java.lang.Class.forName0(Native Method)

    at java.lang.Class.forName(Unknown Source)

    at com.ibm.mq.jmqi.internal.JmqiTools$1.run(JmqiTools.java:864)

    at java.security.AccessController.doPrivileged(Native Method)

    at
com.ibm.mq.jmqi.internal.JmqiTools.dynamicLoadClass(JmqiTools.java:841)

    at
com.ibm.mq.jmqi.JmqiEnvironment.processESESecurity(JmqiEnvironment.java:872)

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

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

    at com.ibm.mq.MQSESSION.<init>(MQSESSION.java:2067)

    at com.ibm.mq.MQSESSION.getSession(MQSESSION.java:2133)

    at
com.ibm.mq.MQManagedConnectionJ11.<init>(MQManagedConnectionJ11.java:202)

    at
com.ibm.mq.MQClientManagedConnectionFactoryJ11._createManagedConnection(MQClientManagedConnectionFactoryJ11.java:505)

    at
com.ibm.mq.MQClientManagedConnectionFactoryJ11.createManagedConnection(MQClientManagedConnectionFactoryJ11.java:547)

    at
com.ibm.mq.StoredManagedConnection.<init>(StoredManagedConnection.java:95)

    at
com.ibm.mq.MQSimpleConnectionManager.allocateConnection(MQSimpleConnectionManager.java:182)

    at
com.ibm.mq.MQQueueManagerFactory.obtainBaseMQQueueManager(MQQueueManagerFactory.java:869)

    at
com.ibm.mq.MQQueueManagerFactory.procure(MQQueueManagerFactory.java:761)

    at
com.ibm.mq.MQQueueManagerFactory.constructQueueManager(MQQueueManagerFactory.java:712)

    at
com.ibm.mq.MQQueueManagerFactory.createQueueManager(MQQueueManagerFactory.java:171)

    at com.ibm.mq.MQQueueManager.<init>(MQQueueManager.java:603)

    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)

    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown
Source)

    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
Source)

    at java.lang.reflect.Constructor.newInstance(Unknown Source)

    at
org.python.core.PyReflectedConstructor.constructProxy(PyReflectedConstructor.java:211)


java.lang.VerifyError: java.lang.VerifyError: Bad type on operand
stack Exception Details:   Location:
    com/ibm/mq/ese/jmqi/ESEJMQI.spiConnect(Ljava/lang/String;Lcom/ibm/mq/jmqi/system/SpiConnectOptions;Lcom/ibm/mq/jmqi/MQCNO;Lcom/ibm/mq/jmqi/handles/Phconn;Lcom/ibm/mq/jmqi/handles/Pint;Lcom/ibm/mq/jmqi/handles/Pint;)V
@63: invokespecial   Reason:
    Type 'com/ibm/mq/jmqi/system/SpiConnectOptions' (current frame, stack[2]) is not assignable to
'com/ibm/mq/jmqi/system/LpiPrivConnStruct'   Current Frame:
    bci: @63
    flags: { }
    locals: { 'com/ibm/mq/ese/jmqi/ESEJMQI', 'java/lang/String', 'com/ibm/mq/jmqi/system/SpiConnectOptions', 'com/ibm/mq/jmqi/MQCNO',
'com/ibm/mq/jmqi/handles/Phconn', 'com/ibm/mq/jmqi/handles/Pint',
'com/ibm/mq/jmqi/handles/Pint' }
    stack: { 'com/ibm/mq/ese/jmqi/ESEJMQI', 'java/lang/String', 'com/ibm/mq/jmqi/system/SpiConnectOptions', 'com/ibm/mq/jmqi/MQCNO',
'com/ibm/mq/jmqi/handles/Phconn', 'com/ibm/mq/jmqi/handles/Pint',
'com/ibm/mq/jmqi/handles/Pint' }   Bytecode:
    0x0000000: b200 0399 002b 2a12 0412 5010 06bd 0006
    0x0000010: 5903 2b53 5904 2c53 5905 2d53 5906 1904
    0x0000020: 5359 0719 0553 5908 1906 53b8 0008 2ab4
    0x0000030: 0002 9a00 1f2a 2b2c 2d19 0419 0519 06b7
    0x0000040: 0051 b200 0399 000b 2a12 0412 50b8 0012
    0x0000050: b12a b400 0cc0 003e 2b2c 2d19 0419 0519
    0x0000060: 06b9 0052 0700 b200 0399 000b 2a12 0412
    0x0000070: 50b8 0012 b1                              Stackmap Table:
    same_frame(@46)
    same_frame(@80)
    same_frame(@81)
    same_frame(@116)

1 个答案:

答案 0 :(得分:0)

看起来像是由于jar文件损坏。可能是由于同一包装的罐子版本不兼容所致。我删除了它们并从源代码中提取了Jar,这有助于解决问题