[ 
https://issues.apache.org/jira/browse/QPID-1830?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12791479#action_12791479
 ] 

Rajith Attapattu commented on QPID-1830:
----------------------------------------

I looked at the issue closely and the diff, and I don't think the change I made 
is the cause.
Infact I am not sure how this worked before either.

This is due to the way in AbstractJMSMessage is designed.
The reason why you get the MessageNotReadableException is due to 
"_readableMessage" being false in the AbstractJMSMessage
There are only 3 places where "_readableMessage" could get updated in 
AbstractJMSMessage.
The two constructors set it to false if the content passed in is null and true 
if otherwise. This is what is being called when we received messages from the 
broker.
Also it is set to false in the clearBody()
Otherwise this is only set to true in reset() in JMSBytesMessage.

So it seems to me that either
1. The JMSBytesMessage was not designed to be readable before being sent
2. Or this is a bug

I would like to know the answer to the above question before proceeding any 
further.

> BytesMessage is unreadable
> --------------------------
>
>                 Key: QPID-1830
>                 URL: https://issues.apache.org/jira/browse/QPID-1830
>             Project: Qpid
>          Issue Type: Bug
>          Components: Java Client
>    Affects Versions: 0.6, 0.7
>            Reporter: Aidan Skinner
>            Assignee: Rajith Attapattu
>            Priority: Critical
>             Fix For: 0.6
>
>
> This can easily be seen running the interop coordinator:
> 2009-04-28 14:24:38,377 INFO  [main] distributedtesting.Coordinator 
> (Coordinator.java:285) - Found distributed test case: 
> org.apache.qpid.interop.testcases.InteropTestCase4P2PMessageSize
> javax.jms.MessageNotReadableException: You need to call reset() to make the 
> message readable
>         at 
> org.apache.qpid.client.message.AbstractJMSMessage.checkReadable(AbstractJMSMessage.java:433)
>         at 
> org.apache.qpid.client.message.AbstractBytesMessage.toBodyString(AbstractBytesMessage.java:89)
>         at 
> org.apache.qpid.client.message.AbstractJMSMessage.toString(AbstractJMSMessage.java:371)
>         at java.lang.String.valueOf(String.java:2827)
>         at java.lang.StringBuilder.append(StringBuilder.java:115)
>         at 
> org.apache.qpid.test.utils.ConversationFactory$Conversation.send(ConversationFactory.java:263)
>         at 
> org.apache.qpid.test.framework.distributedtesting.Coordinator.start(Coordinator.java:366)
>         at 
> org.apache.qpid.test.framework.distributedtesting.Coordinator.main(Coordinator.java:315)
> 2009-04-28 14:24:39,690 INFO  [main] distributedtesting.Coordinator 
> (Coordinator.java:330) - javax.jms.MessageNotReadableException: You need to 
> call reset() to make the message readable
> java.lang.RuntimeException: javax.jms.MessageNotReadableException: You need 
> to call reset() to make the message readable
>         at 
> org.apache.qpid.client.message.AbstractJMSMessage.toString(AbstractJMSMessage.java:407)
>         at java.lang.String.valueOf(String.java:2827)
>         at java.lang.StringBuilder.append(StringBuilder.java:115)
>         at 
> org.apache.qpid.test.utils.ConversationFactory$Conversation.send(ConversationFactory.java:263)
>         at 
> org.apache.qpid.test.framework.distributedtesting.Coordinator.start(Coordinator.java:366)
>         at 
> org.apache.qpid.test.framework.distributedtesting.Coordinator.main(Coordinator.java:315)
> Caused by: javax.jms.MessageNotReadableException: You need to call reset() to 
> make the message readable
>         at 
> org.apache.qpid.client.message.AbstractJMSMessage.checkReadable(AbstractJMSMessage.java:433)
>         at 
> org.apache.qpid.client.message.AbstractBytesMessage.toBodyString(AbstractBytesMessage.java:89)
>         at 
> org.apache.qpid.client.message.AbstractJMSMessage.toString(AbstractJMSMessage.java:371)
>         ... 5 more
> This works on the 0.5-release branch, so is presumably a recentish break. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscr...@qpid.apache.org

Reply via email to