|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
msgToken error on MQV6 |
« View previous topic :: View next topic » |
Author |
Message
|
Al Pacino |
Posted: Wed May 16, 2007 12:52 pm Post subject: msgToken error on MQV6 |
|
|
 Centurion
Joined: 19 Aug 2005 Posts: 114
|
Hi folks ,
I just migrated one of our test servers from 5.3 CSD 10 to V. 6 MQ , it is runing on windows server 2003 . the install went fine and I can see all queue managers ,, no problem at all . However when I tried to run a small test program which only put a message to a queue , I keep getting the following error :
Exception in thread "main" java.lang.NoSuchFieldError: msgToken
at com.ibm.mq.server.MQSESSION.init_conversion(Native Method)
at com.ibm.mq.server.MQSESSION.<clinit>(MQSESSION.java:254)
at com.ibm.mq.MQSESSIONServer.getMQSESSION(MQSESSIONServer.java:6
at com.ibm.mq.MQSESSION.getSession(MQSESSION.java:493)
at com.ibm.mq.MQManagedConnectionJ11.<init>(MQManagedConnectionJ11.java:155)
at com.ibm.mq.MQBindingsManagedConnectionFactoryJ11._createManagedConnection(MQBindingsManagedConnectionFactoryJ11.java:153)
at com.ibm.mq.MQBindingsManagedConnectionFactoryJ11.createManagedConnection(MQBindingsManagedConnectionFactoryJ11.java:189)
at com.ibm.mq.StoredManagedConnection.<init>(StoredManagedConnection.java:80)
at com.ibm.mq.MQSimpleConnectionManager.allocateConnection(MQSimpleConnectionManager.java:171)
at com.ibm.mq.MQQueueManager.obtainBaseMQQueueManager(MQQueueManager.java:754)
at com.ibm.mq.MQQueueManager.construct(MQQueueManager.java:688)
at com.ibm.mq.MQQueueManager.<init>(MQQueueManager.java:417)
at MSender.main(MSender.java:4
*********************************
the test program :
import com.ibm.mq.*;
import java.io.*;
public class MSender {
private static MQQueueManager qMgr;
public MSender() {
super();
}
public static void main(String args[]) {
try {
if (args.length < 1) {
System.out.println("Missing queue name: "
+ "MSender <queue name> <qmgr name (optional)>");
} else {
System.out.println("MSender started...");
// create a new instance of the sample program
MSender mSender = new MSender();
if (args.length > 1) {
qMgr = new MQQueueManager(args[1]);
} else {
qMgr = new MQQueueManager("");
}
int openOptions = MQC.MQOO_OUTPUT;
MQQueue q =
qMgr.accessQueue(args[0], openOptions, null, null, null);
// call method to send messages
mSender.mPut(qMgr, q);
// clean up connection
q.close();
qMgr.disconnect();
System.out.println("MSender ended...");
}
} catch (MQException ex) {
System.out.println(
"WMQ exception occurred : Completion code "
+ ex.completionCode
+ " Reason code "
+ ex.reasonCode);
}
}
/*************************************/
/* This method takes two parameters: */
/* qMgr - a WMQ QueueManager object */
/* q - a WMQ Queue object */
/*************************************/
public void mPut(MQQueueManager qMgr, MQQueue q) {
try {
// Define a MQ message buffer
MQMessage mBuf = new MQMessage();
// create message options
MQPutMessageOptions pmo = new MQPutMessageOptions();
// accept defaults
pmo.options = MQC.MQPMO_NONE; // use defaults
System.out.println("Enter text to send, blank line to exit");
InputStreamReader isr = new InputStreamReader(System.in);
BufferedReader br = new BufferedReader(isr);
String runShow;
do {
runShow = br.readLine();
if (runShow.length() > 0) {
mBuf.clearMessage(); // reset the buffer
mBuf.correlationId = MQC.MQCI_NONE; // set correlationId
mBuf.messageId = MQC.MQMI_NONE; // set messageId
mBuf.writeString(runShow); // set actual message
System.out.println("--> writing message to queue");
q.put(mBuf, pmo); // put the message out on the queue
}
} while (runShow.length() > 0);
} catch (MQException ex) {
System.out.println(
"MQ exception occurred : Completion code "
+ ex.completionCode
+ " Reason code "
+ ex.reasonCode);
} catch (java.io.IOException ex) {
System.out.println(
"An error occurred reading from message buffer: " + ex);
}
}
} _________________ "We can't solve problems by using the same kind of thinking we used
when we created them." |
|
Back to top |
|
 |
Al Pacino |
Posted: Thu May 17, 2007 6:47 am Post subject: |
|
|
 Centurion
Joined: 19 Aug 2005 Posts: 114
|
this issue is no longer there , I have to point the app to the new install where the correct libraries are. Once , I did the migration from 5.3 , I was still pointion to the 5.3 libraries. _________________ "We can't solve problems by using the same kind of thinking we used
when we created them." |
|
Back to top |
|
 |
balaji_mqdev |
Posted: Thu Aug 02, 2007 2:03 am Post subject: Connect to a Remote QM in windows. |
|
|
Newbie
Joined: 16 Jul 2007 Posts: 1
|
[color=blue]Hi,
I want to know "In windows i have a MQ server running in IP say 200.22.11.11" and port "1418" , MQManager Name be : M_BQ and Queue which i need to post is : M_LQ .
In java how can i find the THIS PARTICULAR MQMANAGER AND QUEUE TO POST A MESSAGE.
In concise : how to connect to a remote queue manager using java in windows..?
[b]Thnx in advance[/b][/color][/b] _________________ Balaji |
|
Back to top |
|
 |
Vitor |
Posted: Thu Aug 02, 2007 2:16 am Post subject: Re: Connect to a Remote QM in windows. |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
balaji_mqdev wrote: |
Hi,
I want to know "In windows i have a MQ server running in IP say 200.22.11.11" and port "1418" , MQManager Name be : M_BQ and Queue which i need to post is : M_LQ .
In java how can i find the THIS PARTICULAR MQMANAGER AND QUEUE TO POST A MESSAGE.
In concise : how to connect to a remote queue manager using java in windows..?
Thnx in advance[/b] |
This has nothing to do with the existing post - you should have started a new thread.
All the answers you need are in the Clients manual (for general information on connecting to a remote queue manager) and the Using Java manual (for how this information specifically relates to a Java app) _________________ Honesty is the best policy.
Insanity is the best defence. |
|
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
|
|
|
|