Я делаю программу java для подключения к QMGR в z / OS, поэтому я использую соединение в режиме привязки, потому что режим клиента не включен внутри ОС. Когда я запускаю файл jar, он выбрасывает следующую трассировку стека:
com.ibm.mq.MQException: MQJE001: Completion Code '2', Reason '2195'.
at com.ibm.mq.MQSESSION.<init>(MQSESSION.java:2064)
at com.ibm.mq.MQSESSION.getSession(MQSESSION.java:2104)
at com.ibm.mq.MQManagedConnectionJ11.<init>(MQManagedConnectionJ11.java:213)
at com.ibm.mq.MQBindingsManagedConnectionFactoryJ11._createManagedConnection(MQBindingsManagedConnectionFactoryJ11.java:191)
at com.ibm.mq.MQBindingsManagedConnectionFactoryJ11.createManagedConnection(MQBindingsManagedConnectionFactoryJ11.java:237)
at com.ibm.mq.StoredManagedConnection.<init>(StoredManagedConnection.java:97)
at com.ibm.mq.MQSimpleConnectionManager.allocateConnection(MQSimpleConnectionManager.java:194)
at com.ibm.mq.MQQueueManagerFactory.obtainBaseMQQueueManager(MQQueueManagerFactory.java:874)
at com.ibm.mq.MQQueueManagerFactory.procure(MQQueueManagerFactory.java:822)
at com.ibm.mq.MQQueueManagerFactory.constructQueueManager(MQQueueManagerFactory.java:764)
at com.ibm.mq.MQQueueManagerFactory.createQueueManager(MQQueueManagerFactory.java:200)
at com.ibm.mq.MQQueueManager.<init>(MQQueueManager.java:871)
со следующей возможной причиной:
Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2195;AMQ9546: Error return code received. [1=java.lang.NullPointerException[null],3=LocalMQ.get390Adapter64]
at com.ibm.mq.jmqi.JmqiEnvironment.getInstance(JmqiEnvironment.java:804)
at com.ibm.mq.jmqi.JmqiEnvironment.getMQI(JmqiEnvironment.java:676)
at com.ibm.mq.MQSESSION.<init>(MQSESSION.java:2057)
... 59 more
Caused by: java.lang.NullPointerException
at com.ibm.mq.jmqi.local.LocalMQ.get390Adapter64(LocalMQ.java:826)
at com.ibm.mq.jmqi.local.LocalMQ$1.run(LocalMQ.java:276)
at java.security.AccessController.doPrivileged(AccessController.java:678)
at com.ibm.mq.jmqi.local.LocalMQ.initialise_inner(LocalMQ.java:258)
at com.ibm.mq.jmqi.local.LocalMQ.initialise(LocalMQ.java:220)
at com.ibm.mq.jmqi.local.LocalMQ.<init>(LocalMQ.java:1261)
at com.ibm.mq.jmqi.local.LocalServer.<init>(LocalServer.java:230)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:83)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:57)
at java.lang.reflect.Constructor.newInstance(Constructor.java:437)
at com.ibm.mq.jmqi.JmqiEnvironment.getInstance(JmqiEnvironment.java:742)
... 61 more
Это код java для создания QMGR и очереди connection:
MQEnvironment.CCSID=500;
MQEnvironment.properties.put(MQConstants.TRANSPORT_PROPERTY, MQConstants.TRANSPORT_MQSERIES_BINDINGS);
MQEnvironment.properties.put(MQConstants.APPNAME_PROPERTY, "DLQReport");
//Crete the queue manager connection
queueManager = new MQQueueManager(mqQMGR);
//Set the mq queue manager options connection. This connection will be in browse mode only without delete the messages
//in the queue.
int openOptions = MQConstants.MQOO_FAIL_IF_QUIESCING | MQConstants.MQOO_BROWSE;
//Set the get message options
gmo.options = MQConstants.MQGMO_WAIT | MQConstants.MQGMO_BROWSE_FIRST;
gmo.matchOptions = MQConstants.MQMO_NONE;
gmo.waitInterval = 5000;
//Create the queue connection
MQQueue queue = queueManager.accessQueue(dlqName, openOptions);
Кажется, я решил эту проблему, изменив следующую строку:
MQEnvironment.properties.put(MQConstants.TRANSPORT_PROPERTY, MQConstants.MQCNO_STANDARD_BINDING);
Но сейчас у меня есть эта проблема:
java.lang.NullPointerException
at com.ibm.mq.MQQueueManagerFactory.determineTransport(MQQueueManagerFactory.java:917)
at com.ibm.mq.MQQueueManagerFactory.obtainBaseMQQueueManager(MQQueueManagerFactory.java:864)
at com.ibm.mq.MQQueueManagerFactory.procure(MQQueueManagerFactory.java:822)
at com.ibm.mq.MQQueueManagerFactory.constructQueueManager(MQQueueManagerFactory.java:764)
at com.ibm.mq.MQQueueManagerFactory.createQueueManager(MQQueueManagerFactory.java:200)
at com.ibm.mq.MQQueueManager.<init>(MQQueueManager.java:871)
Есть идеи?