0

I am trying to put a message into queue from my Java code(in my local machine). I am getting the error:

java.lang.UnsatisfiedLinkError: no mqjbnd05 in java.library.path.

This is my code :

qMgr = new MQQueueManager(qManager);
int openOptions = MQC.MQOO_INPUT_AS_Q_DEF | MQC.MQOO_OUTPUT ;

MQQueue queue = qMgr.accessQueue("Q1",openOptions); 
MQMessage msg = new MQMessage();
msg.writeUTF("this is a test message"); 

MQPutMessageOptions pmo = new MQPutMessageOptions();
queue.put(msg, pmo); 

MQMessage retrievedMessage = new MQMessage();
retrievedMessage.messageId = msg.messageId;

MQGetMessageOptions gmo = new MQGetMessageOptions();
queue.get(retrievedMessage, gmo);
String msgText = retrievedMessage.readUTF();
System.out.println("The message is: " + msgText);

queue.close();
qMgr.disconnect();

My Queue Manager is QM_FORD and queue name is Q1. Listener port is 1414. The environment variables are set properly. Can anyone please guide me on this?

1

2 Answers 2

1

The problem is not in your Java code. Unsatisfied Link Error means a native library (.dll in Windows, .so in Unix) is not being found. It's either missing, or not referenced in an environment variable: PATH (Windows) or LD_LIBRARY_PATH or LIBPATH, etc, depending on what operating system this is in.

googling may give you a few ideas

Sign up to request clarification or add additional context in comments.

Comments

0

The problem here is the missing LIBRARY PATH. Set your LD_LIBRARY_PATH to "MQ_INSTALLATION_DIR"/java/lib (For Unix)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.