[jboss-jira] [JBoss JIRA] Closed: (JBAS-3296) SpyObjectMessage loses original cause of exception when message payload has non-serializable fields

Dimitris Andreadis (JIRA) jira-events at jboss.com
Thu Jul 20 13:12:11 EDT 2006


     [ http://jira.jboss.com/jira/browse/JBAS-3296?page=all ]

Dimitris Andreadis closed JBAS-3296.
------------------------------------

    Resolution: Done
      Assignee: Dimitris Andreadis

Done

> SpyObjectMessage loses original cause of exception when message payload has non-serializable fields
> ---------------------------------------------------------------------------------------------------
>
>                 Key: JBAS-3296
>                 URL: http://jira.jboss.com/jira/browse/JBAS-3296
>             Project: JBoss Application Server
>          Issue Type: Bug
>          Components: JMS service
>    Affects Versions: JBossAS-4.0.4.GA
>         Environment: jboss 3.2.7, java 1.4.2
>            Reporter: David
>         Assigned To: Dimitris Andreadis
>            Priority: Minor
>             Fix For: JBossAS-5.0.0.Beta, JBossAS-4.0.5.CR1, JBossAS-3.2.8.SP2
>
>
> In setObject() of SpyObjectMessage there is a catch block for IOException.  This catch block throws MessageFormatException with a reason of "Object cannot be serialized".  Not a very good reason.  If the original exception was logged, or chained with the MessageFormatException, at the very least you could find out which field was not serializable.
> Suggest a fix like: 
>  catch (IOException e)
>       {
>          e.printStackTrace();
>          MessageFormatException mfe = new MessageFormatException("Object cannot be serialized: " + e.getMessage());
>          mfe.setLinkedException(e);
>          throw mfe;
>       }
> Original stack trace:
> javax.jms.MessageFormatException: Object cannot be serialized
> 	at org.jboss.mq.SpyObjectMessage.setObject(SpyObjectMessage.java:88)
> 	at com.elementk.service.event.Event.send(Event.java:55)
> 	at com.elementk.service.event.Event.send(Event.java:77)
> 	at com.elementk.lms.product.Product.update(Product.java:244)
> 	at com.elementk.lms.contentacl.ContentAclSoupToNutsTest.testProductStatusChange(ContentAclSoupToNutsTest.java:408)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:324)
> 	at junit.framework.TestCase.runTest(TestCase.java:154)
> 	at junit.framework.TestCase.runBare(TestCase.java:127)
> 	at junit.framework.TestResult$1.protect(TestResult.java:106)
> 	at junit.framework.TestResult.runProtected(TestResult.java:124)
> 	at junit.framework.TestResult.run(TestResult.java:109)
> 	at junit.framework.TestCase.run(TestCase.java:118)
> 	at junit.framework.TestSuite.runTest(TestSuite.java:208)
> 	at junit.framework.TestSuite.run(TestSuite.java:203)
> 	at com.elementk.test.UnitTestMBean$UnitTestThread.run(UnitTestMBean.java:280)
> 	at java.lang.Thread.run(Thread.java:534)
> 2006.06.07 15:27:31.422 EDT ERROR [n/a] [Product.update:247] could not update product in product catalog
> java.lang.RuntimeException: Failed to send JMS Message
> 	at com.elementk.service.event.Event.send(Event.java:69)
> 	at com.elementk.service.event.Event.send(Event.java:77)
> 	at com.elementk.lms.product.Product.update(Product.java:244)
> 	at com.elementk.lms.contentacl.ContentAclSoupToNutsTest.testProductStatusChange(ContentAclSoupToNutsTest.java:408)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:324)
> 	at junit.framework.TestCase.runTest(TestCase.java:154)
> 	at junit.framework.TestCase.runBare(TestCase.java:127)
> 	at junit.framework.TestResult$1.protect(TestResult.java:106)
> 	at junit.framework.TestResult.runProtected(TestResult.java:124)
> 	at junit.framework.TestResult.run(TestResult.java:109)
> 	at junit.framework.TestCase.run(TestCase.java:118)
> 	at junit.framework.TestSuite.runTest(TestSuite.java:208)
> 	at junit.framework.TestSuite.run(TestSuite.java:203)
> 	at com.elementk.test.UnitTestMBean$UnitTestThread.run(UnitTestMBean.java:280)
> 	at java.lang.Thread.run(Thread.java:534)
> Caused by: javax.jms.MessageFormatException: Object cannot be serialized
> 	at org.jboss.mq.SpyObjectMessage.setObject(SpyObjectMessage.java:88)
> 	at com.elementk.service.event.Event.send(Event.java:55)
> At the time of this defect, this issue has not been reported nor fixed, I checked in version 1.19 of SpyObjectMessage.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list