Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

ByteMessage readUTF get truncated message

qjvictorOct 1 2012 — edited Oct 2 2012
When trying to call ByteMessage.readUTF() to convert the byteMessage to String text, in most cases, it works perfect.
But we found if the message is bigger (for example, 500K), ByteMessage.readUTF() will truncate the message into bad format.

For example, in my test case, I expect a byteMessage with XML content, however, it gives me a malformed xml:
first line: <xml version="1.0" encoding="utf-8"?>
becomes" xml version="1.0" encoding="utf-8"?>, without the starting '<'
and the xml is truncated - the filesize seems to be limited as 16k.

this problem happens for MQ and Weblogic JMS, so I believe it is not 3rd party library or service provider specific, seems it is from JDK.

btw, I am using JDK 1.6+.

any idea how this could happen? any solution for this?

Edited by: qjvictor on Oct 1, 2012 1:12 PM

Edited by: qjvictor on Oct 1, 2012 1:12 PM
This post has been answered by jtahlborn on Oct 1 2012
Jump to Answer

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Oct 30 2012
Added on Oct 1 2012
10 comments
5,396 views