|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Help Urgently!!readUTF in java throws EOFException |
« View previous topic :: View next topic » |
Author |
Message
|
vykalra |
Posted: Wed Aug 11, 2004 10:57 pm Post subject: Help Urgently!!readUTF in java throws EOFException |
|
|
Newbie
Joined: 09 Aug 2004 Posts: 2
|
Hi All,
Plz. help me solve this problem. I have installed MQSeries 5.3 on Windows XP. Have included the necessary files in classpath to run sample java programs. But my sample java program is giving EOFException.
Following is the code snippet..................
int openOptions = MQC.MQOO_INPUT_SHARED;
//Opening a Queue
MQQueue q = new MQQueue(qm,args[0],openOptions,"","","");
// Creating message Object
System.out.println("Creating message object");
MQMessage msg=new MQMessage();
//Get Message in the queue
q.get(msg);
System.out.println("Get success ");
System.out.println("Message : " + msg.readUTF()); //problem here
q.close();
System.out.println("Queue closed ");
When i run this code I get the following java exception...............
Settting the Environment to connect in bind mode
Connecting to a queue manager
Connection success
Creating message object
Get success
Error: java.io.EOFException
java.io.EOFException
at java.io.DataInputStream.readUnsignedShort(DataInputStream.java:400)
at java.io.DataInputStream.readUTF(DataInputStream.java:633)
at java.io.DataInputStream.readUTF(DataInputStream.java:610)
at com.ibm.mq.MQMessage.readUTF(MQMessage.java:779)
at Get.main(Get.java:53)
Please help me solve this problem urgently..................
Any help would be higly appreciated................
Anticipating a quick response,,,,,,,,,
Thanks,
Vishal. |
|
Back to top |
|
 |
bower5932 |
Posted: Thu Aug 12, 2004 8:14 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
I don't see the code that actually puts the message. UTF messages are prefixed with a 2 byte length string followed by the data. My guess would be that your not actually reading a UTF message. |
|
Back to top |
|
 |
vykalra |
Posted: Thu Aug 12, 2004 9:06 pm Post subject: Problem solved. |
|
|
Newbie
Joined: 09 Aug 2004 Posts: 2
|
Hey thanks,
i used readLine() and the problem is solved....................
Actually i dont know the funda of readUTF() so made a mistake.........
Thanks anyways.
Take care |
|
Back to top |
|
 |
kirani |
Posted: Fri Aug 13, 2004 8:51 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
[moved to java forum] _________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
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
|
|
|
|