Author |
Message
|
mathew_m |
Posted: Tue Nov 13, 2007 5:43 am Post subject: no mqjbnd05 in java.library.path |
|
|
Novice
Joined: 14 Oct 2007 Posts: 11
|
I am using JAVA code to connect my MQSERVER. Both server and client are in WINDOWS platform. But while running my JSP i am getting the follwoing error. I could not find the file called mqjbnd05 in my system where client is installed. Any help ?
java.lang.UnsatisfiedLinkError: no mqjbnd05 in java.library.path
java.lang.ClassLoader.loadLibrary(ClassLoader.java:1682)
java.lang.Runtime.loadLibrary0(Runtime.java:822)
java.lang.System.loadLibrary(System.java:992)
com.ibm.mq.MQSESSION.loadLib(MQSESSION.java:1088)
com.ibm.mq.server.MQSESSION$1.run(MQSESSION.java:232)
java.security.AccessController.doPrivileged(Native Method)
com.ibm.mq.server.MQSESSION.<clinit>(MQSESSION.java:226) |
|
Back to top |
|
 |
Vitor |
Posted: Tue Nov 13, 2007 5:56 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Are you trying to create a bindings connection or a client connection?
If you're creating a bindings connection, are you sure all the paths are set correctly? If it's a client connection, have you done a client installation or just put the jar files in the path? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
mathew_m |
Posted: Tue Nov 13, 2007 6:00 am Post subject: |
|
|
Novice
Joined: 14 Oct 2007 Posts: 11
|
This is a client connection. I have downloaded(trial version) mq windows client and installed in my machine.
I could not locate the file mqjbnd05 in my PC !
Pls help |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Nov 13, 2007 6:06 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You're trying to establish a bindings connection.
You need to change your code to create a client connection, instead. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
Vitor |
Posted: Tue Nov 13, 2007 6:07 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
mathew_m wrote: |
This is a client connection. I have downloaded(trial version) mq windows client and installed in my machine. |
For the record, I suspect that's the full client. I'm not aware of a trial version of the client, only the server package. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
mathew_m |
Posted: Tue Nov 13, 2007 6:24 am Post subject: |
|
|
Novice
Joined: 14 Oct 2007 Posts: 11
|
Please dont beat me up
I used the following code(class). Could you suggest what changes i should make it to create a client connection ?
import com.ibm.mq.*; // Include the MQ package
import java.io.*;
import java.lang.*;
public class MQClass {
public MQMessage myMessage = new MQMessage();
private MQQueueManager qMgr;
/**********************************************************/
/* This program doesn't have any specific initialization. */
/* If it did, it could go here. */
/**********************************************************/
public void init() {
}
public void start() {
try {
qMgr = new MQQueueManager("Q1MGRVIN");
int openOptions = MQC.MQOO_INPUT_EXCLUSIVE | MQC.MQOO_BROWSE;
MQQueue myQueue = qMgr.accessQueue("Q1", openOptions,
null, null, null);
MQGetMessageOptions gmo = new MQGetMessageOptions();
gmo.options = MQC.MQGMO_WAIT | MQC.MQGMO_BROWSE_FIRST;
// MQMessage myMessage = new MQMessage();
boolean done = false;
do {
try {
myMessage.clearMessage();
myMessage.correlationId = MQC.MQCI_NONE;
myMessage.messageId = MQC.MQMI_NONE;
myQueue.get(myMessage, gmo);
String msg = myMessage.readString(myMessage.getMessageLength());
System.out.println("Actually getting the message");
gmo.options = MQC.MQGMO_MSG_UNDER_CURSOR;
myQueue.get(myMessage, gmo);
System.out.println(myMessage);
done = true;
gmo.options = MQC.MQGMO_WAIT | MQC.MQGMO_BROWSE_NEXT;
} catch (MQException ex) {
done = true;
} catch (java.io.IOException ex) {
System.out.println("Java exception: " + ex);
done = true;
}
} while (!done);
/**********************************************************/
/* Before the program ends, the open queue will be closed */
/* and the queue manager will be disconnected. */
/**********************************************************/
myQueue.close();
qMgr.disconnect();
}
catch (MQException ex) {
System.out.println("MQ exception: CC = " + ex.completionCode
+ " RC = " + ex.reasonCode);
}
}
} |
|
Back to top |
|
 |
Vitor |
Posted: Tue Nov 13, 2007 6:34 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
mathew_m wrote: |
Please dont beat me up  |
This is nothing. When we start to beat you up, you'll know....
I'd use one of the methods in the Using Java manual or the Clients manual to establish that your application should use a client connection. An MQEnvironment object for example (but only as an example - select the method which best meets your requirements) _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Nov 13, 2007 6:56 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Yes. The basics are you need to set MQEnvironment.port, MQEnvironment.hostname and MQEnvironment.channel.
And then use
Code: |
new MQQueueManager() |
.
Start with Using Java or the samples. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
bower5932 |
Posted: Tue Nov 13, 2007 7:01 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
|
Back to top |
|
 |
|