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 » IOException

Post new topic  Reply to topic
 IOException « View previous topic :: View next topic » 
Author Message
Sonal
PostPosted: Thu May 07, 2009 1:35 am    Post subject: IOException Reply with quote

Apprentice

Joined: 20 Mar 2009
Posts: 45

How to fix "An IOException occured whilst writing to the message buffer: java.io.EOFException" exception? I am getting this exception when I try to retrieve a message from the queue using java code.
Back to top
View user's profile Send private message
elvis_gn
PostPosted: Thu May 07, 2009 1:47 am    Post subject: Reply with quote

Padawan

Joined: 08 Oct 2004
Posts: 1905
Location: Dubai

Hi Sonal,

Please paste the lines of code which throw this error, or if you don't know where it's thrown, please put some try catch blocks or print stmts to identify the location.

Regards.
Back to top
View user's profile Send private message Send e-mail
WMBDEV1
PostPosted: Thu May 07, 2009 1:51 am    Post subject: Reply with quote

Sentinel

Joined: 05 Mar 2009
Posts: 888
Location: UK

From your other post you are using the readUTF method on the message.....

http://www.mqseries.net/phpBB2/viewtopic.php?t=48997

You could try readLine() but I have found this can be a little slow for large messages and so I have previously used the readFully method by passing it a byte array (possibly invoking it many times and the length of the array must not be greater than the amount of data left to read).

Also, this has been posted before....
http://www.mqseries.net/phpBB2/viewtopic.php?p=68674&sid=c426862ce3538d3e90d0d05fdd9c468d

Why didnt you bother to search for it?
Back to top
View user's profile Send private message
Vitor
PostPosted: Thu May 07, 2009 2:10 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

WMBDEV1 wrote:
Why didnt you bother to search for it?




I also repeat my comments about reading manuals I made on your other post.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Sonal
PostPosted: Thu May 07, 2009 2:22 am    Post subject: Reply with quote

Apprentice

Joined: 20 Mar 2009
Posts: 45

Hey thanks all the experts...!!
It's working now...
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Thu May 07, 2009 6:20 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Don't exactly understand where you went wrong. Got it fixed, good for you! I hope the next newbie with a similar problem will be able to make sense of it.

In other words ==> Share your solution!
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Sonal
PostPosted: Thu May 07, 2009 10:22 pm    Post subject: Reply with quote

Apprentice

Joined: 20 Mar 2009
Posts: 45

Actually the original problem was java.io.EOFException. The code was retriving the message but was not able to display it. Hence, when second time, I would run the code, it would show error 2033 as no message was available (as it was already been picked).
To fix IOException, I changed readUTF to readLine().
(I got the solution from this forum only.. given in one post)

I am sorry to bug you all people... thanks a ton... without your help I wouldn't have been able to work on MQ.

And, I must say, comments of Vitor really motivates me... Sir, thanks for the inspiration... I wish if my witticism could be like yours:)
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Fri May 08, 2009 3:11 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Sonal wrote:
Actually the original problem was java.io.EOFException. The code was retriving the message but was not able to display it. Hence, when second time, I would run the code, it would show error 2033 as no message was available (as it was already been picked).
To fix IOException, I changed readUTF to readLine().
(I got the solution from this forum only.. given in one post)

I am sorry to bug you all people... thanks a ton... without your help I wouldn't have been able to work on MQ.

And, I must say, comments of Vitor really motivates me... Sir, thanks for the inspiration... I wish if my witticism could be like yours:)


So you learned that readUTF and writeUTF go hand in hand as a pair with the message. (You can only use readUTF if the sending party used writeUTF...)

The better practice is not to rely on UTF and use the standard text message format. This way the conversion can get done and none of the restrictions with writeUTF/readUTF apply....

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ API Support » IOException
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.