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 API Support » Facing problem using readUTF

Post new topic  Reply to topic
 Facing problem using readUTF « View previous topic :: View next topic » 
Author Message
Blackberry
PostPosted: Fri Jul 21, 2006 3:54 am    Post subject: Facing problem using readUTF Reply with quote

Apprentice

Joined: 12 Jul 2006
Posts: 28

Hi,
I am new to this technology. Can any one help me?
I am trying to read a message from Queue using MQMessage.readUTF() method. I am using base java and queue is opened using option MQC.MQOO_INPUT_SHARED.I am using default get message options.
The Exception i have received when i am trying to get the message content using MQMessage.readUTF() is
"An IOException occured whilst writing to the message buffer: java.io.EOFException"

But MQMessage.readLine() is working fine.

Thanks in advance
Blackberry
Back to top
View user's profile Send private message
bower5932
PostPosted: Fri Jul 21, 2006 4:04 am    Post subject: Reply with quote

Jedi Knight

Joined: 27 Aug 2001
Posts: 3023
Location: Dallas, TX, USA

Did you write your message using writeUTF? The UTF methods have a length at the front of the data.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
Blackberry
PostPosted: Fri Jul 21, 2006 4:17 am    Post subject: Reply with quote

Apprentice

Joined: 12 Jul 2006
Posts: 28

Yes i am using the MQMessage.writeUTF() method to write the whole string content of a file.

Here is my writeQueue code
Code:
MQMessage msg = new MQMessage();
msg.writeUTF(freader.getFileContent("C:\\input\\CLEAN_AP010_INPUT1A.txt"));


freader.getFileContent(String ) method is reading String content of a file.
Back to top
View user's profile Send private message
Blackberry
PostPosted: Fri Jul 21, 2006 4:53 am    Post subject: Reply with quote

Apprentice

Joined: 12 Jul 2006
Posts: 28

There is NO length parameter in the writeUTF() method.
The signature is like that

Code:
public void writeUTF(String str) throws IOException;


can any one help?
Back to top
View user's profile Send private message
bower5932
PostPosted: Fri Jul 21, 2006 6:06 am    Post subject: Reply with quote

Jedi Knight

Joined: 27 Aug 2001
Posts: 3023
Location: Dallas, TX, USA

From the Using Java manual:
Quote:
The writeUTF() method of MQMessage automatically encodes the length of the string as well as the Unicode bytes it contains. When your message will be read by another Java program (using readUTF()), this is the simplest way to send string information.

How big is your file? I believe the limit of a UTF message is 64K.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ API Support » Facing problem using readUTF
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.