[infinispan-issues] [JBoss JIRA] Commented: (ISPN-155) Marshalling code to provide more helpful stacktraces

Galder Zamarreno (JIRA) jira-events at lists.jboss.org
Mon Sep 14 12:11:23 EDT 2009


    [ https://jira.jboss.org/jira/browse/ISPN-155?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12485672#action_12485672 ] 

Galder Zamarreno commented on ISPN-155:
---------------------------------------

I've been working with David for this jira and JBMAR-75. Here's some output that shows how marshalling and unmarshalling exceptions will be reported from now on. Please note that toString() representations and classloader information will only be added to the stacktrace if debug logging is enabled. This is to avoid overloading exceptions in production environments.

java.io.IOException: Injected failue!
	at org.infinispan.marshall.VersionAwareMarshallerTest$1.readExternal(VersionAwareMarshallerTest.java:426)
	at org.jboss.marshalling.river.RiverUnmarshaller.doReadNewObject(RiverUnmarshaller.java:1172)
	at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:273)
	at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:210)
	at org.jboss.marshalling.AbstractUnmarshaller.readObject(AbstractUnmarshaller.java:85)
	at org.infinispan.marshall.jboss.JBossMarshaller.objectFromObjectStream(JBossMarshaller.java:210)
	at org.infinispan.marshall.VersionAwareMarshaller.objectFromByteBuffer(VersionAwareMarshaller.java:104)
	at org.infinispan.marshall.VersionAwareMarshaller.objectFromByteBuffer(VersionAwareMarshaller.java:177)
	at org.infinispan.marshall.VersionAwareMarshallerTest.testErrorUnmarshalling(VersionAwareMarshallerTest.java:431)
Caused by: an exception which occurred:
	in object of type org.infinispan.marshall.VersionAwareMarshallerTest$1
		-> classloader hierarchy:
		-> type classloader = sun.misc.Launcher$AppClassLoader at 198dfaf
		->...file:/opt/eclipse/configuration/org.eclipse.osgi/bundles/285/1/.cp/eclipse-testng.jar
		->...file:/opt/eclipse/configuration/org.eclipse.osgi/bundles/285/1/.cp/lib/testng-jdk15.jar
		->...file:/home/galder/jboss/infinispan/code/trunk/core/target/test-classes/
		->...file:/home/galder/jboss/infinispan/code/trunk/core/target/classes/
		->...file:/home/galder/.m2/repository/org/testng/testng/5.9/testng-5.9-jdk15.jar
		->...file:/home/galder/.m2/repository/net/jcip/jcip-annotations/1.0/jcip-annotations-1.0.jar
		->...file:/home/galder/.m2/repository/org/easymock/easymockclassextension/2.4/easymockclassextension-2.4.jar
		->...file:/home/galder/.m2/repository/org/easymock/easymock/2.4/easymock-2.4.jar
		->...file:/home/galder/.m2/repository/cglib/cglib-nodep/2.1_3/cglib-nodep-2.1_3.jar
		->...file:/home/galder/.m2/repository/javax/xml/bind/jaxb-api/2.1/jaxb-api-2.1.jar
		->...file:/home/galder/.m2/repository/javax/xml/stream/stax-api/1.0-2/stax-api-1.0-2.jar
		->...file:/home/galder/.m2/repository/javax/activation/activation/1.1/activation-1.1.jar
		->...file:/home/galder/.m2/repository/jgroups/jgroups/2.8.0.CR1/jgroups-2.8.0.CR1.jar
		->...file:/home/galder/.m2/repository/org/jboss/javaee/jboss-transaction-api/1.0.1.GA/jboss-transaction-api-1.0.1.GA.jar
		->...file:/home/galder/.m2/repository/org/jboss/marshalling/river/1.2.0.CR4-SNAPSHOT/river-1.2.0.CR4-SNAPSHOT.jar
		->...file:/home/galder/.m2/repository/org/jboss/marshalling/marshalling-api/1.2.0.CR4-SNAPSHOT/marshalling-api-1.2.0.CR4-SNAPSHOT.jar
		->...file:/home/galder/.m2/repository/org/jboss/jboss-common-core/2.2.14.GA/jboss-common-core-2.2.14.GA.jar
		->...file:/home/galder/.m2/repository/org/jboss/logging/jboss-logging-spi/2.0.5.GA/jboss-logging-spi-2.0.5.GA.jar
		->...file:/home/galder/.m2/repository/log4j/log4j/1.2.14/log4j-1.2.14.jar
		->...file:/home/galder/.m2/repository/com/thoughtworks/xstream/xstream/1.2/xstream-1.2.jar
		->...file:/home/galder/.m2/repository/xpp3/xpp3_min/1.1.3.4.O/xpp3_min-1.1.3.4.O.jar
		->...file:/home/galder/.m2/repository/com/sun/xml/bind/jaxb-impl/2.1.3/jaxb-impl-2.1.3.jar
		-> parent classloader = sun.misc.Launcher$ExtClassLoader at 1858610
		->...file:/usr/java/jdk1.5.0_19/jre/lib/ext/localedata.jar
		->...file:/usr/java/jdk1.5.0_19/jre/lib/ext/sunpkcs11.jar
		->...file:/usr/java/jdk1.5.0_19/jre/lib/ext/sunjce_provider.jar
		->...file:/usr/java/jdk1.5.0_19/jre/lib/ext/dnsns.jar
... Removed 22 stack frames
FAILED: testNestedNonSerializable
java.io.NotSerializableException: java.lang.Object
	at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:857)
	at org.jboss.marshalling.AbstractMarshaller.writeObject(AbstractMarshaller.java:407)
	at org.infinispan.marshall.exts.ReplicableCommandExternalizer.writeObject(ReplicableCommandExternalizer.java:54)
	at org.infinispan.marshall.jboss.ConstantObjectTable$ExternalizerAdapter.writeObject(ConstantObjectTable.java:267)
	at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:143)
	at org.jboss.marshalling.AbstractMarshaller.writeObject(AbstractMarshaller.java:407)
	at org.infinispan.marshall.jboss.JBossMarshaller.objectToObjectStream(JBossMarshaller.java:167)
	at org.infinispan.marshall.VersionAwareMarshaller.objectToBuffer(VersionAwareMarshaller.java:92)
	at org.infinispan.marshall.VersionAwareMarshaller.objectToByteBuffer(VersionAwareMarshaller.java:170)
	at org.infinispan.marshall.VersionAwareMarshallerTest.testNestedNonSerializable(VersionAwareMarshallerTest.java:415)
Caused by: an exception which occurred:
	in object java.lang.Object at b40ec4
		-> toString = java.lang.Object at b40ec4
	in object org.infinispan.commands.write.PutKeyValueCommand at df661da7
		-> toString = PutKeyValueCommand{key=k, value=java.lang.Object at b40ec4, putIfAbsent=false, lifespanMillis=0, maxIdleTimeMillis=0}
... Removed 22 stack frames
FAILED: testNonSerializable
java.io.NotSerializableException: java.lang.Object
	at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:857)
	at org.jboss.marshalling.AbstractMarshaller.writeObject(AbstractMarshaller.java:407)
	at org.infinispan.marshall.jboss.JBossMarshaller.objectToObjectStream(JBossMarshaller.java:167)
	at org.infinispan.marshall.VersionAwareMarshaller.objectToBuffer(VersionAwareMarshaller.java:92)
	at org.infinispan.marshall.VersionAwareMarshaller.objectToByteBuffer(VersionAwareMarshaller.java:170)
	at org.infinispan.marshall.VersionAwareMarshallerTest.testNonSerializable(VersionAwareMarshallerTest.java:419)
Caused by: an exception which occurred:
	in object java.lang.Object at 19e215b
		-> toString = java.lang.Object at 19e215b
... Removed 22 stack frames

> Marshalling code to provide more helpful stacktraces
> ----------------------------------------------------
>
>                 Key: ISPN-155
>                 URL: https://jira.jboss.org/jira/browse/ISPN-155
>             Project: Infinispan
>          Issue Type: Task
>          Components: RPC
>            Reporter: Galder Zamarreno
>            Assignee: Galder Zamarreno
>             Fix For: 4.0.0.CR1
>
>
> Try to make marshaller code more friendly so that more helpful stacktraces are presented. Example: http://pastie.org/580184
> IRC chat with Manik:
> <manik> galderz ping
> <galderz> hi manik 
> <manik> hi there
> <manik> any chance of wrapping up the marshaller code to provide more helpful stack traces?   :-)
> <galderz> yeah, why not?
> <galderz> any suggestion in particular?
> <manik> e.g.
> <manik> http://pastie.org/580184
> <manik> doesn't tell me what it is trying to marshall when it fails
> <manik> So it's kinda hard for me to locate where the problem is
> <galderz> right, ic ur point
> <galderz> let me create a jira for this
> <manik> well, its clearly trying to read a stream and something should be logged on the sender (or any generator of that stream) so we can trace what it is
> <galderz> we have to be careful about what we log since this code is used v heavily
> <galderz> i'll investigate this further
> * clebert1 (n=clebert at cpe-70-112-88-39.austin.res.rr.com) has joined #infinispan
> <galderz> wrt the exception, there's something in the SuccessfulResponse sent back that the requester doesn't know what it is

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

        


More information about the infinispan-issues mailing list