CDV ❯ NPOE messages for never shareable classes list the name of the field as null in the message
-
Bug
-
Status: Closed
-
2 Major
-
Resolution: Fixed
-
-
-
cdennis
-
Reporter: tgautier
-
February 26, 2009
-
0
-
Watchers: 1
-
April 10, 2009
-
March 03, 2009
Description
See here: http://forums.terracotta.org/forums/posts/list/1846.page
Notice the message displays the word null in it. It should have read:
Caused by: com.tc.exception.TCNonPortableObjectError: ******************************************************************************* […] Referring class : org.codehaus.groovy.runtime.metaclass.MemoryAwareConcurrentReadMap Referring field : org.codehaus.groovy.runtime.metaclass.MemoryAwareConcurrentReadMap.queue Thread : main JVM ID : VM(8) Unshareable class: java.lang.ref.ReferenceQueue […]
2) Mark the offending field as transient (and thus not shared)
* edit your tc-config.xml file
* locate the
* if there is already a
Comments
Alex Miller 2009-02-26
Chris Dennis 2009-03-03
The troublesome reference name is now added as a detail of the NonPortableReason by the TraverseTest to supplement the information provided by the initial context.
nadeem ghani 2009-04-06
Fixed on rev12431
com.tc.exception.TCNonPortableObjectError: ******************************************************************************* Attempt to set the field of a shared object to an instance of a non-portable class. This unshareable class is a JVM- or host machine-specific resource. Please ensure that instances of this class don’t enter the shared object graph.
For more information on this issue, please visit our Troubleshooting Guide at: http://terracotta.org/kit/troubleshooting
Thread : main JVM ID : VM(0) Non-portable field name: Main.root Unshareable class : java.lang.Thread
Action to take:
1) Change your application code * Ensure that no instances of java.lang.Thread are added to any shared object graph
- OR -
2) Mark the offending field as transient (and thus not shared)
* edit your tc-config.xml file
* locate the
<transient-fields>
<field-name>Main.root</field-name>
</transient-fields>
* if there is already a
*******************************************************************************
There are 3 different versions of this message. Unfortunately the reason part is snipped out so I’ll just make an educated guess that the reason is that the class is not adaptable (since the others deal with super classes and this class doesn’t have one).
The message is in NonPortableReason.properties (classNotAdaptable.field.instructions) and the code is in NonPortableReason.java. It looks like the message is formatted properly and the code is passing something in for the variable. However, the code can end up as null here if it doesn’t have enough info (first arg in the last call):
That’s all I can tell from a quick troll through the code. Need to write a test to learn more but I thought it was worth putting the notes here at least.