Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 189758 - dev-java/xstream fails to construct, null pointer exception.
Summary: dev-java/xstream fails to construct, null pointer exception.
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Java (show other bugs)
Hardware: All Linux
: High critical (vote)
Assignee: Java team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-08-21 20:03 UTC by Alex Barker
Modified: 2009-08-17 12:05 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Barker 2007-08-21 20:03:47 UTC
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/)
Comment 1 Alex Barker 2007-08-21 20:05:20 UTC
I forgot to add it was compiled -java5 and is being used in a Java 1.4 project.
Comment 2 Tim Ekl 2007-10-24 11:46:04 UTC
This works for me compiled with USE="java5" and used in a java-1.4 (blackdown-jdk-1.4) project.
Comment 3 Tim Ekl 2007-10-25 12:18:11 UTC
It also works for me under sun-jdk-1.4.2.16 compiled USE="java5".
Comment 4 Alex Barker 2007-10-26 05:23:34 UTC
I will try and compile tomorrow and see if its magically started working...
Comment 5 Alex Barker 2007-12-07 19:11:53 UTC
(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.
Comment 6 Petteri Räty (RETIRED) gentoo-dev 2009-02-11 16:01:21 UTC
Could you please test with 1.3.1 that was just added.
Comment 7 Adrian Bassett 2009-02-17 13:34:39 UTC
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.
Comment 8 Petteri Räty (RETIRED) gentoo-dev 2009-02-17 16:04:33 UTC
(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.
Comment 9 Adrian Bassett 2009-02-19 13:06:37 UTC
(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.

Comment 10 Jean-Noël Rivasseau (RETIRED) gentoo-dev 2009-08-17 12:05:54 UTC
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.