Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 359746 - NPE thrown when creating a DynanicJAXBContext with OXM listing no classes
Summary: NPE thrown when creating a DynanicJAXBContext with OXM listing no classes
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-03 14:24 EDT by Blaise Doughan CLA
Modified: 2022-06-09 10:30 EDT (History)
1 user (show)

See Also:


Attachments
MOXy - Test Cases (3.07 KB, patch)
2011-10-03 14:25 EDT, Blaise Doughan CLA
no flags Details | Diff
MOXy - Fix (1.07 KB, patch)
2011-10-03 14:25 EDT, Blaise Doughan CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Blaise Doughan CLA 2011-10-03 14:24:17 EDT
A NPE ia thrown when creating a JAXBContext on an OXM specifying no classes:

java.lang.NullPointerException
	at org.eclipse.persistence.jaxb.compiler.XMLProcessor.processXML(XMLProcessor.java:359)
	at org.eclipse.persistence.jaxb.compiler.Generator.<init>(Generator.java:102)
	at org.eclipse.persistence.jaxb.dynamic.DynamicJAXBContext$MetadataContextInput.createContextState(DynamicJAXBContext.java:235)
	at org.eclipse.persistence.jaxb.JAXBContext.<init>(JAXBContext.java:162)
	at org.eclipse.persistence.jaxb.dynamic.DynamicJAXBContext.<init>(DynamicJAXBContext.java:70)
	at org.eclipse.persistence.jaxb.dynamic.DynamicJAXBContextFactory.createContextFromOXM(DynamicJAXBContextFactory.java:334)
	at org.eclipse.persistence.testing.jaxb.dynamic.EmptyContextTestCases.testEmptyContext(EmptyContextTestCases.java:35)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at junit.framework.TestCase.runTest(TestCase.java:168)
	at junit.framework.TestCase.runBare(TestCase.java:134)
	at junit.framework.TestResult$1.protect(TestResult.java:110)
	at junit.framework.TestResult.runProtected(TestResult.java:128)
	at junit.framework.TestResult.run(TestResult.java:113)
	at junit.framework.TestCase.run(TestCase.java:124)
	at junit.framework.TestSuite.runTest(TestSuite.java:243)
	at junit.framework.TestSuite.run(TestSuite.java:238)
	at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Comment 1 Blaise Doughan CLA 2011-10-03 14:25:20 EDT
Created attachment 204466 [details]
MOXy - Test Cases
Comment 2 Blaise Doughan CLA 2011-10-03 14:25:44 EDT
Created attachment 204467 [details]
MOXy - Fix
Comment 3 Blaise Doughan CLA 2011-10-03 14:53:59 EDT
Fix checked into trunk at rev: 10202

Fix Details:
Added in the appropriate null check to guard against the NPE

Code reviewed by:
Rick Barkhouse
Comment 4 Eclipse Webmaster CLA 2022-06-09 10:14:26 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink
Comment 5 Eclipse Webmaster CLA 2022-06-09 10:30:32 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink