Community
Participate
Working Groups
When XMLChoiceCollectionMapping is used with the DOMPlatform a NPE is thrown if the collection property is null. javax.xml.bind.MarshalException - with linked exception: [java.lang.NullPointerException] at org.eclipse.persistence.jaxb.JAXBBinder.marshal(JAXBBinder.java:79) at org.eclipse.persistence.testing.jaxb.listofobjects.NullContainerTestCases.testBinderMarshal(NullContainerTestCases.java:36) 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) Caused by: java.lang.NullPointerException at org.eclipse.persistence.internal.queries.CollectionContainerPolicy.iteratorFor(CollectionContainerPolicy.java:150) at org.eclipse.persistence.oxm.mappings.XMLChoiceCollectionMapping.writeFromObjectIntoRow(XMLChoiceCollectionMapping.java:281) at org.eclipse.persistence.internal.oxm.XMLObjectBuilder.writeOutMappings(XMLObjectBuilder.java:347) at org.eclipse.persistence.internal.oxm.XMLObjectBuilder.buildRow(XMLObjectBuilder.java:325) at org.eclipse.persistence.oxm.XMLMarshaller.objectToXML(XMLMarshaller.java:1288) at org.eclipse.persistence.oxm.XMLBinder.marshal(XMLBinder.java:137) at org.eclipse.persistence.jaxb.JAXBBinder.marshal(JAXBBinder.java:76) ... 20 more
Created attachment 208327 [details] MOXy - Test Cases
Created attachment 208328 [details] Core - Fix
Fix checked into trunk at rev: 10588 Code reviewed by: Rick Barkhouse Fix Description In XMLChoiceCollectionMapping make sure the attributeValue is not null before asking the container policy for an iterator.
Back port fix to 2.3.3
Created attachment 208638 [details] Core - Fix (2.3.3)
Fix checked into 2.3.3 at rev: 10607
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink