ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Java / JMS » Help Urgently!!readUTF in java throws EOFException

Post new topic  Reply to topic
 Help Urgently!!readUTF in java throws EOFException « View previous topic :: View next topic » 
Author Message
vykalra
PostPosted: Wed Aug 11, 2004 10:57 pm    Post subject: Help Urgently!!readUTF in java throws EOFException Reply with quote

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
View user's profile Send private message Yahoo Messenger
bower5932
PostPosted: Thu Aug 12, 2004 8:14 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
vykalra
PostPosted: Thu Aug 12, 2004 9:06 pm    Post subject: Problem solved. Reply with quote

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
View user's profile Send private message Yahoo Messenger
kirani
PostPosted: Fri Aug 13, 2004 8:51 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » Help Urgently!!readUTF in java throws EOFException
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.