Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » DynamicJAXBContext creation fails with NPE
DynamicJAXBContext creation fails with NPE [message #635483] Wed, 27 October 2010 03:22 Go to next message
No real name is currently offline No real name
Messages: 1
Registered: October 2010
Junior Member

It seems like I'm missing something obvious, but I've been unable to create an instance of DynamicJAXBContext using EclipseLink 2.1.1, jxc 2.2.1, and these schema files:

The calling code:
File schema = new File("src/main/resources/DDMS_2.0/ns/DDMS/2.0/DDMS-v2_0.xsd");
StreamSource ss = new StreamSource(schema);
DynamicJAXBContext c = DynamicJAXBContextFactory.createContextFromXSD(ss, null, null, null);

The stack trace:
Exception in thread "main" java.lang.NullPointerException
	at org.eclipse.persistence.jaxb.javamodel.xjc.XJCJavaClassImpl.isEnum(
	at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.preBuildTypeInfo(
	at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.buildNewTypeInfo(
	at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.processXmlJavaTypeAdapter(
	at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.processPropertyAnnotations(
	at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.buildNewProperty(
	at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.getFieldPropertiesForClass(
	at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.getPropertiesForClass(
	at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.buildTypeInfo(
	at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.postBuildTypeInfo(
	at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.processClassesAndProperties(
	at org.eclipse.persistence.jaxb.compiler.Generator.<init>(
	at org.eclipse.persistence.jaxb.dynamic.DynamicJAXBContext.initializeFromXJC(
	at org.eclipse.persistence.jaxb.dynamic.DynamicJAXBContext.initializeFromXSDInputSource(
	at org.eclipse.persistence.jaxb.dynamic.DynamicJAXBContextFactory.createContextFromXSD(
	at foo.FooTest.main(

And the pom.xml
		<id>EclipseLink Repo</id>

I already set up java.endorsed.dirs to point to the jaxb 2.2.1 api and I've tried various versions of EclipseLink. Nothing seems to work. And the source for XJCJavaClassImpl does not seem to be in maven.
Re: DynamicJAXBContext creation fails with NPE [message #635723 is a reply to message #635483] Wed, 27 October 2010 20:31 Go to previous messageGo to next message
Rick Barkhouse is currently offline Rick Barkhouse
Messages: 22
Registered: July 2009
Junior Member
Hello there,

I have looked at this issue, and it is indeed a bug in DynamicJAXB. I have entered a new bug report for this:

We should be able to get this fixed soon in an upcoming nightly build of EclipseLink 2.2.

- Rick
Re: DynamicJAXBContext creation fails with NPE [message #636762 is a reply to message #635483] Tue, 02 November 2010 17:03 Go to previous message
Rick Barkhouse is currently offline Rick Barkhouse
Messages: 22
Registered: July 2009
Junior Member

This bug has been fixed, please try out the latest EclipseLink 2.2 nightly build (20101102) and let us know if you have any more issues.

Thanks for using EclipseLink Dynamic JAXB!

- Rick
Previous Topic:Validation errors for Eclipselink 2.1.1 project.xml
Next Topic:Weaving and OSGi
Goto Forum:

Current Time: Sat Oct 25 01:42:11 GMT 2014

Powered by FUDForum. Page generated in 0.01857 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software