My Oracle Support Banner

NullPointerException When Instantiating a JAXB Context (Doc ID 1617708.1)

Last updated on JUNE 01, 2018

Applies to:

Oracle TopLink - Version 11.1.1.6.0 and later
Oracle WebLogic Server - Version 10.3.6 and later
Information in this document applies to any platform.

Symptoms

With Toplink 11.1.1.6.0 (Eclipselink 2.3.1 )  in 10.3.6  Weblogic Server :
when creating a JAXBContext as the following :

 

try {
  JAXBContext.newInstance(new Class[] { Script.class });
  
  } catch (Exception e) {
  {
   e.printStackTrace ();
  
  }
  }


--
the NullPointerException Exception occurs as the following :

..
[java.lang.NullPointerException]
  at org.eclipse.persistence.jaxb.JAXBContext$TypeMappingInfoInput.createContextState(JAXBContext.java:8
25)
  at org.eclipse.persistence.jaxb.JAXBContext.(JAXBContext.java:136)
  at org.eclipse.persistence.jaxb.JAXBContextFactory.createContext(JAXBContextFactory.java:142)
  at org.eclipse.persistence.jaxb.JAXBContextFactory.createContext(JAXBContextFactory.java:129)
...
Caused by: java.lang.NullPointerException
  at org.eclipse.persistence.jaxb.compiler.MappingsGenerator.generateChoiceCollectionMapping(MappingsGen
erator.java:699)
  at org.eclipse.persistence.jaxb.compiler.MappingsGenerator.generateMapping(MappingsGenerator.java:442)

  at org.eclipse.persistence.jaxb.compiler.MappingsGenerator.generateMappings(MappingsGenerator.java:202
2)
  at org.eclipse.persistence.jaxb.compiler.MappingsGenerator.generateMappings(MappingsGenerator.java:198
3)
  at org.eclipse.persistence.jaxb.compiler.MappingsGenerator.generateProject(MappingsGenerator.java:193)

  at org.eclipse.persistence.jaxb.compiler.Generator.generateProject(Generator.java:174)
  at org.eclipse.persistence.jaxb.JAXBContext$TypeMappingInfoInput.createContextState(JAXBContext.java:8
30)
  at org.eclipse.persistence.jaxb.JAXBContext$TypeMappingInfoInput.createContextState(JAXBContext.java:8
23)

--
  This problem does not occur when using JAXB com Sun implementation .
  This problem does not occur when using toplink 11.1.1.4.0 (Eclipselink 2.1 , in 10.3.4 WLS) .
  
Note that applying:

Patch 17052278: NULLPOINTEREXCEPTION IN JAXB GENERATECHOICECOLLECTIONMAPPING

to toplink 11.1.1.6.0  does not solve the issue.



Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Symptoms
Cause
Solution
References


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.