Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-3296

SpyObjectMessage loses original cause of exception when message payload has non-serializable fields

XMLWordPrintable

      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.

              dandread1@redhat.com Dimitrios Andreadis
              davidmboon_jira davidmboon (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: