I am running this code on windows with websphere mq v5.3, I will increment the counter but the program fails before that part.
 
thanks

"Jay H. Lang" <[EMAIL PROTECTED]> wrote:
I have your code running......since it is a NATIVE error, I think that you are missing something in your lib or libpath.  What platform are you on?

Also, you never increment the counter so it shows messages sent:   0   even when one was sent.

--
Jay H. Lang
Chief Technologist
Distributed Computing Professionals Inc.
IBM Certified Specialist - WebSphere MQ
651 406-2131 - USPS Office
303 277-1873 - Colorado Office
303 807-9700 - Cell Phone
 

GP wrote:

I am trying to use JMS to send a message to a queue but I just keep on getting the following error: 
java.lang.NoSuchMethodError: getMessageData<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

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 testSender.TestSender2.main(TestSender2.java:56)

Exception in thread "main"  
 
 
 
 

My program is:package testSender;import javax.jms.*;
import com.ibm.mq.jms.*;import javax.naming.*;
import java.io.*;public class TestSender2 {    /**
     * 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";
        String myQueue="ORANGE.QUEUE";
        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);

   queueConnection.close();
       }
 

  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);
    }
} Any help will be appreciated. 


Do you Yahoo!?
Check out the new Yahoo! Front Page. www.yahoo.com

 
 


Do you Yahoo!?
Check out the new Yahoo! Front Page. www.yahoo.com

Reply via email to