ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Java / JMS » The native JNI library 'mqjbnd' was not found

Post new topic  Reply to topic
 The native JNI library 'mqjbnd' was not found « View previous topic :: View next topic » 
Author Message
shellj
PostPosted: Mon Nov 07, 2011 8:46 am    Post subject: The native JNI library 'mqjbnd' was not found Reply with quote

Newbie

Joined: 07 Nov 2011
Posts: 5

Hello, I am trying to compile and run the MQSample program that comes with the MQ client. It compiles fine, but throws exceptions when it runs.

This seems to indicate that I am missing mqjbnd. I have googled for similar problems but nothing has helped so far. There is a doc from IBM about this occurring on 64-bit here: "AMQ8568 RC=2495 mqjbnd was not found" (can't post the link apparently), but that does not help me as I am running on 32-bit windows for my client and server (different machines).

Other searches indicate that this problem occurs when the MQ client is not installed and the jars were copied into the environment, but I installed the client without problem.

When I run dspmqver I get this output:

Code:
>dspmqver -p 7

Name:        WebSphere MQ
Version:     7.0.1.6
CMVC level:  p701-106-110725
BuildType:   IKAP - (Production)

Name:        WebSphere MQ classes for Java
Version:     7.0.1.6
CMVC Level:  k701-106-110721
Build Type:  Production

Name:        Java Message Service Client
Version:     7.0.1.6
CMVC Level:  k701-106-110721
Build Type:  Production

Name:        WebSphere MQ classes for Java Message Service
Version:     7.0.1.6
CMVC Level:  k701-106-110721
Build Type:  Production

Name:        IBM WebSphere MQ
Version:     7.0.1.6
CMVC Level:  k701-106-110721 mqjbnd=CC=2;RC=2495;AMQ8568: The native JNI library 'mqjbnd' was not found. [3=mqjbnd]::no mqjbnd in java.library.path
Build Type:  Production

Name:        Common Services for Java Platform, Standard Edition
Version:     7.0.1.6
CMVC Level:  k701-106-110721
Build Type:  Production


I searched for mqjbnd on my system and found 0 files, could the file be missing?

I've found suggestions saying that this could be a CLASSPATH issue, but I have modified it to include all of the provided jar files as someone suggested without any luck.

Any help would be much appreciated, I have been struggling to get this working for a while and can't get rid of this error.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Mon Nov 07, 2011 10:22 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
Location: LI,NY

You WILL get this error message if you have the client installed but are trying to do a server connection instead of a client connection.

Here are a few things to check
  • What type of connection are you trying to do (client / server)?
  • What software have you installed (client / server)?
  • Do you have your environment setup correctly (libpath)?
  • Is the qmgr you are trying to connect to located on the same box?


Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
shellj
PostPosted: Mon Nov 07, 2011 11:12 am    Post subject: Reply with quote

Newbie

Joined: 07 Nov 2011
Posts: 5

Thank you so much! Apparently the sample java application was trying to connect to itself, I thought it would use the environment variable that the tutorials had me set prior for the server info, but I guess java needs it explicitly set.

I resolved this issue by including com.ibm.mq.MQEnvironment and setting MQEnvironment.hostname and MQEnvironment.channel.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Mon Nov 07, 2011 12:22 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
Location: LI,NY

shellj wrote:
Thank you so much! Apparently the sample java application was trying to connect to itself, I thought it would use the environment variable that the tutorials had me set prior for the server info, but I guess java needs it explicitly set.

I resolved this issue by including com.ibm.mq.MQEnvironment and setting MQEnvironment.hostname and MQEnvironment.channel.

Environment variable for MQServer does not work in Java.
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
pelife
PostPosted: Tue May 08, 2012 4:51 am    Post subject: Reply with quote

Novice

Joined: 15 Mar 2012
Posts: 10
Location: Rio de Janeiro - BR

May you show us your code? Now I am facing the same problem but I can see what I am doing wrong.

I am trying to run with a really simple code I found in the IBM website:
Code:


package application;

import java.util.Hashtable;

import javax.jms.Connection;
import javax.jms.DeliveryMode;
import javax.jms.Destination;
import javax.jms.JMSException;
import javax.jms.MessageProducer;
import javax.jms.Session;
import javax.jms.TextMessage;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;

public class Program {

   private static final String JMSQ_JNDI_NAME = "TesteDestination";
   private static final String JMSCF_JNDI_NAME = "TesteFactory";

   public static void main(String [] rgstring) {
   
      Hashtable<String, Object> hashtableEnviroment = new Hashtable<String, Object>();
        String messageText = null;
       
       
      try {
         
         hashtableEnviroment.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.fscontext.RefFSContextFactory");
         hashtableEnviroment.put(Context.PROVIDER_URL,"file:C:/temp/JMSAdmin");
               
         Context context = new InitialContext(hashtableEnviroment);

         // Finding the WAS QueueConnectionFactory
         javax.jms.ConnectionFactory qcf = (javax.jms.ConnectionFactory) context.lookup(JMSCF_JNDI_NAME);
         
          // Finding the Queue Destination
           Destination q = (Destination) context.lookup(JMSQ_JNDI_NAME);

           // Create JMS Connection
           Connection connection = qcf.createConnection();

           // Create JMS Session
           Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);

        // Create MessageProducer and TextMessage
           MessageProducer queueSender = session.createProducer(q);
           TextMessage outMessage = session.createTextMessage();
          
           messageText = "Hello World";
         outMessage.setText(messageText);

           // Set type and destination and send
           outMessage.setJMSType("package_received");
           outMessage.setJMSDestination(q);
           queueSender.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
           queueSender.send(outMessage);
          
           connection.close();   
         //Connection connection = factory.createConnection();
         //connection.close();
         
         System.out.println("PRESS <ENTER> TO QUIT");
         //System.console().readLine();
         
      } catch (NamingException e) {
         // TODO Auto-generated catch block
         e.printStackTrace();
      } catch (JMSException e) {
         // TODO Auto-generated catch block
         e.printStackTrace();
      }
      
   }   
}


and here is the stack trace

Quote:

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.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 com.ibm.msg.client.commonservices.j2se.NLSServices.createException(NLSServices.java:314)
at com.ibm.msg.client.commonservices.nls.NLSServices.createException(NLSServices.java:228)
at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createV7ProviderConnection(WMQConnectionFactory.java:6759)
at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createProviderConnection(WMQConnectionFactory.java:6264)
at com.ibm.msg.client.jms.admin.JmsConnectionFactoryImpl.createConnection(JmsConnectionFactoryImpl.java:280)
at com.ibm.mq.jms.MQConnectionFactory.createCommonConnection(MQConnectionFactory.java:6138)
at com.ibm.mq.jms.MQConnectionFactory.createConnection(MQConnectionFactory.java:6167)
at application.Program.main(Program.java:41)
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:296)
at java.security.AccessController.doPrivileged(Native Method)
at com.ibm.mq.jmqi.local.LocalMQ.initialise_inner(LocalMQ.java:260)
at com.ibm.mq.jmqi.local.LocalMQ.initialise(LocalMQ.java:222)
at com.ibm.mq.jmqi.local.LocalMQ.<init>(LocalMQ.java:1156)
at com.ibm.mq.jmqi.local.LocalServer.<init>(LocalServer.java:193)
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 com.ibm.mq.jmqi.JmqiEnvironment.getInstance(JmqiEnvironment.java:701)
at com.ibm.mq.jmqi.JmqiEnvironment.getMQI(JmqiEnvironment.java:638)
at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createV7ProviderConnection(WMQConnectionFactory.java:6751)
... 5 more
Caused by: java.lang.UnsatisfiedLinkError: no mqjbnd in java.library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at com.ibm.mq.jmqi.local.LocalMQ.loadLib(LocalMQ.java:1123)
at com.ibm.mq.jmqi.local.LocalMQ$1.run(LocalMQ.java:275)
... 17 more



and Yes, I am running both server and client at the same machine.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » The native JNI library 'mqjbnd' was not found
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.