Author |
Message
|
Sonal |
Posted: Thu May 07, 2009 1:35 am Post subject: IOException |
|
|
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 |
|
 |
elvis_gn |
Posted: Thu May 07, 2009 1:47 am Post subject: |
|
|
 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 |
|
 |
WMBDEV1 |
Posted: Thu May 07, 2009 1:51 am Post subject: |
|
|
Sentinel
Joined: 05 Mar 2009 Posts: 888 Location: UK
|
|
Back to top |
|
 |
Vitor |
Posted: Thu May 07, 2009 2:10 am Post subject: |
|
|
 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 |
|
 |
Sonal |
Posted: Thu May 07, 2009 2:22 am Post subject: |
|
|
Apprentice
Joined: 20 Mar 2009 Posts: 45
|
Hey thanks all the experts...!!
It's working now...  |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu May 07, 2009 6:20 pm Post subject: |
|
|
 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 |
|
 |
Sonal |
Posted: Thu May 07, 2009 10:22 pm Post subject: |
|
|
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 |
|
 |
fjb_saper |
Posted: Fri May 08, 2009 3:11 am Post subject: |
|
|
 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 |
|
 |
|