我試圖連接到運行在Sun 1.7 JDK中的Linux 64位上的Websphere MQ 6。通過LDAP連接到Websphere MQ java.lang.UnsatisfiedLinkError:java.library.pat中沒有mqjbnd
我試圖通過JNDI連接到MQServer,在LDAP中查找對象,因爲我的應用程序服務器與MQ服務器是分開的,因此我無法使用文件系統JNDI。
這一切工作正常,在我的開發框,但我有1)Windows和2)已安裝MQ服務器。
我可以通過Websphere MQ Explorer連接到LDAP並在LDAP中創建綁定對象。
Java應用程序可以訪問JNDI對象,並嘗試建立一個連接,但我得到一個錯誤java.lang.UnsatisfiedLinkError中:在任何的java.library.path mqjbnd
我從here
安裝7.5客戶端LD_LIBRARY_PATH運行命令後設置爲默認值
. /opt/mqm/bin/setmqenv -s -l
實際路徑是
LD_LIBRARY_PATH = /usr/java/default/jre/lib/i386:/opt/mqm/lib64/compat:/opt/mqm/lib/compat
我還在JVM上明確設置了-Djava.library.path = $ LD_LIBRARY_PATH。
但是,當我看看路徑/ opt/mqm/lib64/compat:/ opt/mqm/lib/compat時,我看不到mqjbnd或類似的東西。
許多帖子和技術討論說,客戶端中沒有mqjbnd只安裝服務器。我感到困惑,因爲我只想查找QueueManager並通過JNDI使用隊列項 - 我應該只需要安裝客戶端而不是服務器?
LDAP方法是否適合我使用?我試圖使用com.ibm.mq.jms.context.WMQInitialContextFactory,但永遠無法爲此獲得安全權限。
對不起,但這是做我的頭它 - 我不能幫助比較這與易於連接到ActiveMQ - 我必須在這裏做錯了什麼。
例外是
[2013-03-13 14:32:41,389] ERROR - ServiceTaskManager Error acquiring a JMS connection to : cn=ConnectionFactoryLdap using JNDI properties : {java.naming.factory.initial=com.sun.jndi.ldap.LdapCtxFactory, java.naming.provider.url=ldap://LDAPSERVER:10389/dc=example,dc=com, transport.jms.ConnectionFactory=ibmMQQueueConnectionFactory, transport.jms.ConnectionFactoryType=queue, serviceType=proxy}
com.ibm.msg.client.jms.DetailedJMSException: JMSFMQ6312: An exception occurred in the Java(tm) MQI.
The Java(tm) MQI has thrown an exception describing the problem.
See the linked exception for further information.
at sun.reflect.GeneratedConstructorAccessor30.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at com.ibm.msg.client.commonservices.j2se.NLSServices.createException(NLSServices.java:319)
at com.ibm.msg.client.commonservices.nls.NLSServices.createException(NLSServices.java:233)
at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createV7ProviderConnection(WMQConnectionFactory.java:6863)
at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createProviderConnection(WMQConnectionFactory.java:6254)
at com.ibm.msg.client.jms.admin.JmsConnectionFactoryImpl.createConnection(JmsConnectionFactoryImpl.java:285)
at com.ibm.mq.jms.MQConnectionFactory.createCommonConnection(MQConnectionFactory.java:6189)
at com.ibm.mq.jms.MQConnectionFactory.createConnection(MQConnectionFactory.java:6218)
at org.apache.axis2.transport.jms.JMSUtils.createConnection(JMSUtils.java:555)
at org.apache.axis2.transport.jms.ServiceTaskManager$MessageListenerTask.createConnection(ServiceTaskManager.java:824)
at org.apache.axis2.transport.jms.ServiceTaskManager$MessageListenerTask.getConnection(ServiceTaskManager.java:706)
at org.apache.axis2.transport.jms.ServiceTaskManager$MessageListenerTask.receiveMessage(ServiceTaskManager.java:496)
at org.apache.axis2.transport.jms.ServiceTaskManager$MessageListenerTask.run(ServiceTaskManager.java:420)
at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)
Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2495;AMQ8568: The native JNI library 'mqjbnd' was not found. For a client installation this is expected. [3=mqjbnd]
at com.ibm.mq.jmqi.local.LocalMQ$1.run(LocalMQ.java:304)
at java.security.AccessController.doPrivileged(Native Method)
at com.ibm.mq.jmqi.local.LocalMQ.initialise_inner(LocalMQ.java:268)
at com.ibm.mq.jmqi.local.LocalMQ.initialise(LocalMQ.java:231)
at com.ibm.mq.jmqi.local.LocalMQ.<init>(LocalMQ.java:1194)
at com.ibm.mq.jmqi.local.LocalServer.<init>(LocalServer.java:206)
at sun.reflect.GeneratedConstructorAccessor29.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at com.ibm.mq.jmqi.JmqiEnvironment.getInstance(JmqiEnvironment.java:732)
at com.ibm.mq.jmqi.JmqiEnvironment.getMQI(JmqiEnvironment.java:666)
at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createV7ProviderConnection(WMQConnectionFactory.java:6855)
... 13 more
Caused by: java.lang.UnsatisfiedLinkError: no mqjbnd in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1860)
at java.lang.Runtime.loadLibrary0(Runtime.java:845)
at java.lang.System.loadLibrary(System.java:1084)
at com.ibm.mq.jmqi.local.LocalMQ.loadLib(LocalMQ.java:1138)
at com.ibm.mq.jmqi.local.LocalMQ$1.run(LocalMQ.java:279)
... 24 more
此鏈接討論與MQ v7類似的問題。可能對你有幫助。 http://www-01.ibm.com/support/docview.wss?uid=swg21413508 – Shashi 2013-03-13 05:42:03
謝謝你,但我沒有提到文件/opt/mqm/java/lib/libmqjbnd.so - 所以也許我需要服務器安裝或我的應用程序服務器上的東西? – Steve666 2013-03-13 07:32:06
這部分異常讓我感到困惑_對於客戶端安裝,這是expected_ – Steve666 2013-03-13 07:33:09