Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Won't Fix
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
JDK version and platform:jdk 1.4 windows
Description
I was using xstream without any problem unless I created a custom
security manager. When I run my program with security manager
I get the following error in "fromXML()" call.
When I disable security manager everything works fine.
What is the problem?
java.lang.NullPointerException
at com.thoughtworks.xstream.core.TreeUnmarshaller.addInformationTo(TreeUnmarshaller.java:53)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:46)
at com.thoughtworks.xstream.core.ReferenceByXPathUnmarshaller.convertAnother(ReferenceByXPathUnmarshaller.java:39)
at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:99)
at com.thoughtworks.xstream.core.ReferenceByXPathMarshallingStrategy.unmarshal(ReferenceByXPathMarshallingStrategy.java:12)
at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:549)
at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:537)
at com.thoughtworks.xstream.XStream.fromXML(XStream.java:505)
at com.thoughtworks.xstream.XStream.fromXML(XStream.java:496)
Hi Suat,
it is normal for any package, that it might need additional rights if running under a SecurityManager. Especially XStream that makes heavy usage of reflection will need additional rights. To get you some idea, I have created a test case:
http://svn.codehaus.org/trunk/xstream/src/test/com/thoughtworks/acceptance/SecurityManagerTest.java?rev=763&root=xstream&view=markup