• Post Reply Bookmark Topic Watch Topic
  • New Topic

JMS getMessageData Error  RSS feed

 
Gamb Rockwell
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I keep on getting a getMessageData Error :
java.lang.NoSuchMethodError: getMessageData
at com.ibm.mq.server.MQSESSION._MQPUTMSG2(Native Method)
at com.ibm.mq.server.MQSESSION.MQPUT(MQSESSION.java:2421)
at com.ibm.mq.MQQueue.putMsg2(MQQueue.java:1482)
at com.ibm.mq.jms.MQMessageProducer.sendInternal
(MQMessageProducer.java:1560)
at com.ibm.mq.jms.MQMessageProducer.send(MQMessageProducer.java:1012)
at com.ibm.mq.jms.MQMessageProducer.send(MQMessageProducer.java:1046)
at jmsMsgSndRcvr.TestSender.main(TestSender.java:69)
Exception in thread "main"


My program to send jms message:
....
message = queueSession.createTextMessage();
message.setText(text_test);
queueConnection.start();
queueSender.send(message);
....

I would appreciate any help

[ October 27, 2004: Message edited by: Gamb Rockwell ]
[ October 27, 2004: Message edited by: Gamb Rockwell ]
 
Gaurav Chikara
Ranch Hand
Posts: 413
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is insufficent data to give any remarks
You didn't send code of your sender and receiver
 
Gamb Rockwell
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Right now I am just trying to place a message on the queue supplied at the command line, I have supplied my TestSender.java file which has the code that I am using to accomplish that.

Java code:

package jmsMsgSndRcvr;

import javax.jms.*;
import com.ibm.mq.jms.*;

import javax.naming.*;
import java.io.*;

public class TestSender{

/**
* Main method.
*
* @param args the queue used by the example and,
* optionally, the number of messages to send
*/


public static void main(String[] args) {
String queueName = null;
String texttest = "temp";
Context jndiContext = null;
QueueConnectionFactory queueConnectionFactory = null;
QueueConnection queueConnection = null;
QueueSession queueSession = null;
com.ibm.mq.jms.MQQueue queue = null;
com.ibm.mq.jms.MQQueue replyToQueue = null;
QueueSender queueSender = null;
TextMessage message = null;
final int NUM_MSGS;
int count = 0;


try{
queueConnectionFactory = new MQQueueConnectionFactory();
((MQQueueConnectionFactory)queueConnectionFactory).setQueueManager(args[0]);
queueConnection =
queueConnectionFactory.createQueueConnection();
queueSession =
queueConnection.createQueueSession(false,
Session.AUTO_ACKNOWLEDGE);
queue = (com.ibm.mq.jms.MQQueue) queueSession.createQueue(args[1]);

queue.setTargetClient(JMSC.MQJMS_CLIENT_NONJMS_MQ);

queueSender = queueSession.createSender(queue);


message = queueSession.createTextMessage();
message.setText(texttest);

queueConnection.start();
queueSender.send(message);

}


catch (JMSException e) {
System.out.println("Exception occurred: " +
e.toString());
e.printStackTrace();
} finally {
if (queueConnection != null) {
try {
queueConnection.close();
} catch (JMSException e) {}
}
}
System.out.println("messages sent: " + count);
}
}


The error that I receive is:


java.lang.NoSuchMethodError: getMessageData
at com.ibm.mq.server.MQSESSION._MQPUTMSG2(Native Method)
at com.ibm.mq.server.MQSESSION.MQPUT(MQSESSION.java:2421)
at com.ibm.mq.MQQueue.putMsg2(MQQueue.java:1482)
at com.ibm.mq.jms.MQMessageProducer.sendInternal(MQMessageProducer.java:1560)
at com.ibm.mq.jms.MQMessageProducer.send(MQMessageProducer.java:1012)
at com.ibm.mq.jms.MQMessageProducer.send(MQMessageProducer.java:1046)
at jmsMsgSndRcvr.TestSender.main(TestSender.java:53)
Exception in thread "main"
 
Gaurav Chikara
Ranch Hand
Posts: 413
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You don't need to use IBM MQ Series
the jms package will do the purpose
and Take the Queue from JMS package
Do an lookup of Connection Factory using Naming Context

something like
queueConnectionFactory = (QueueConnectionFactory)
jndiContext.lookup("QueueConnectionFactory");
queue = (Queue) jndiContext.lookup(queueName);

It should work
 
Gamb Rockwell
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The specifications for the program that I need to write requires IBM mqseries v5.3.

Thanks
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!