Upon construction of the Xstream class a null pointer exception is thrown. I downloaded the binary 1.2 version of Xstream from the website and it functions correctly. Please note that both lines throw a very similar exception. The following is a small bit of sample code to illustrate the issue. XStream objTemp1 = new XStream(new JsonHierarchicalStreamDriver()); XStream objTemp2 = new XStream(); Exception in thread "main" java.lang.NullPointerException at sun.reflect.AccessorGenerator.getClassName(AccessorGenerator.java:369) at sun.reflect.MethodAccessorGenerator.generate(MethodAccessorGenerator.java:286) at sun.reflect.MethodAccessorGenerator.generateSerializationConstructor(MethodAccessorGenerator.java:95) at sun.reflect.ReflectionFactory.newConstructorForSerialization(ReflectionFactory.java:313) at com.thoughtworks.xstream.converters.reflection.Sun14ReflectionProvider.getMungedConstructor(Sun14ReflectionProvider.java:73) at com.thoughtworks.xstream.converters.reflection.Sun14ReflectionProvider.newInstance(Sun14ReflectionProvider.java:53) at com.thoughtworks.xstream.XStream.setupConverters(XStream.java:530) at com.thoughtworks.xstream.XStream.<init>(XStream.java:371) at com.thoughtworks.xstream.XStream.<init>(XStream.java:316) at edu.callutheran.portlets.staffbirthdays.Driver.main(Driver.java:33) Reproducible: Always Steps to Reproduce: 1. Construct XStream object with or without arguments. 2. Enjoy the stack trace. Actual Results: See stack trace above. Expected Results: Object constructed successfully. This is only an issue with the gentoo package. The package from the website of the same version 1.2.0 works fine. (http://repo1.maven.org/maven2/xstream/xstream/1.2/)
I forgot to add it was compiled -java5 and is being used in a Java 1.4 project.
This works for me compiled with USE="java5" and used in a java-1.4 (blackdown-jdk-1.4) project.
It also works for me under sun-jdk-1.4.2.16 compiled USE="java5".
I will try and compile tomorrow and see if its magically started working...
(In reply to comment #3) > It also works for me under sun-jdk-1.4.2.16 compiled USE="java5". > java version "1.5.0_13" with USE="-java5" == Null Pointer When i compile with use java5 it works fine.... It seems some more work needs to be done with the java5 use flag.... maybe if the system vm is generation 2 it should be enabled or at least toss a bit fat warning that if java5 use flag is not enabled it will ONLY work with a generation 1 vm. This seems to be more of a miss-communication for installation or maybe just due to my ignorance when compiling Java applications that both support generation 1 and 2 vm's. Deal with the bug as you see fit.
Could you please test with 1.3.1 that was just added.
I found (on x86) that 1.3.1 wouldn't compile until the java5 USE flag was enabled for dev-java/xstream. This was not necessary previously.
(In reply to comment #7) > I found (on x86) that 1.3.1 wouldn't compile until the java5 USE flag was > enabled for dev-java/xstream. This was not necessary previously. > That calls for a new bug to opened as it's a different issue instead of using an old bug to track multiple issues.
(In reply to comment #8) > That calls for a new bug to opened as it's a different issue instead of using > an old bug to track multiple issues. Well, the compile problem I highlighted is certainly something that the maintainer will want to address. Just to clarify, my only point in noting the problem as a comment to this bug was because of the suggestion to try 1.3.1 when the effects of the java5 USE flag in different contexts was being discussed.
Closing this bug, java5 USE flag removed from latest xstream that should go stable soon. If you encounter some problems with the *latest* xstream ebuild please reopen or file a new bug.