|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
client connection using Java |
« View previous topic :: View next topic » |
Author |
Message
|
hdjur |
Posted: Thu Dec 02, 2004 9:53 am Post subject: client connection using Java |
|
|
Centurion
Joined: 16 Sep 2004 Posts: 116 Location: Zagreb
|
Hello!
I use to work using C++, but recently I got request to make an MQ client application using Java. C++ makes difference between client and binding connection, by linking with different libraries.
I have set MQEnvironment.hostname as documentation says:
The TCP/IP hostname of the machine on which the MQSeries server resides. If the hostname is not set, and no overriding properties are set, bindings mode is used to connect to the local queue manager.
Further, to ensure client connection I have set :
MQEnvironment.properties.put(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_CLIENT);
Finally I have set MQEnvironment.channel to the name of the server connection channel on the remote queue manager, even MQEnvironment.port=1414; although it is default, but I still receive this:
java.lang.NoClassDefFoundError: com/ibm/mq/MQSESSIONServer
at com.ibm.mq.MQQueueManager.<init>(MQQueueManager.java:241)
at drugi.MQSample.main(MQSample.java:31)
Exception in thread "main"
I do not have installed this class, since I have installed only MQSeries client for Windows, but I do have com/ibm/mq/MQSESSIONClient class imported and included. Why does not the application try to use this class, instead off looking for MQSESSIONServer?
What am I missing? Help please.
Thank you in advance. |
|
Back to top |
|
 |
bower5932 |
Posted: Thu Dec 02, 2004 11:21 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
|
Back to top |
|
 |
hdjur |
Posted: Fri Dec 03, 2004 12:57 am Post subject: |
|
|
Centurion
Joined: 16 Sep 2004 Posts: 116 Location: Zagreb
|
Hello!
First of all, sorry about double post.
I did copy mqhash.java example and it does not work too,
it gives the same error report.
Any ideas? |
|
Back to top |
|
 |
bower5932 |
Posted: Fri Dec 03, 2004 6:14 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
My guess would be that you have your classpath messed up or you are running with older jar files. I'm running at WMQ 5.3 CSD8 and my classpath looks like:
Code: |
set CLASSPATH=C:\WMQ\Java\lib\providerutil.jar;
C:\WMQ\Java\lib\com.ibm.mqjms.jar;
C:\WMQ\Java\lib\ldap.jar;
C:\WMQ\Java\lib\jta.jar;
C:\WMQ\Java\lib\jndi.jar;
C:\WMQ\Java\lib\jms.jar;
C:\WMQ\Java\lib\connector.jar;
C:\WMQ\Java\lib\fscontext.jar;
C:\WMQ\Java\lib\com.ibm.mq.jar;.; |
You probably don't need all of these. I run jms as well as base java so I include its jars as well. |
|
Back to top |
|
 |
hdjur |
Posted: Thu Dec 30, 2004 4:04 am Post subject: |
|
|
Centurion
Joined: 16 Sep 2004 Posts: 116 Location: Zagreb
|
Hello bower5932!
I see I didn't post any new information on this.
Yes, everything works fine with WMQ 5.3 client for Windows, it
didn't work with MQ 5.1 client. Key of the problem was connector.jar.
For me this definition is sufficient:
set CLASSPATH=.\;C:\Program Files\IBM\WebSphere MQ\Java\lib\connector.jar;C:\Program Files\IBM\WebSphere MQ\Java\lib\com.ibm.mq.jar;
Thank you for your effort. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|