Community
Participate
Working Groups
If a document that contains an unmapped CDATA section is unmarshalled the following NPE is thrown: Exception in thread "main" java.lang.NullPointerException at org.eclipse.persistence.oxm.record.UnmarshalRecord.startCDATA(UnmarshalRecord.java:1105) at org.eclipse.persistence.internal.oxm.record.XMLReader$LexicalHandlerWrapper.startCDATA(XMLReader.java:263) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startCDATA(Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) at org.eclipse.persistence.internal.oxm.record.XMLReader.parse(XMLReader.java:171) at org.eclipse.persistence.internal.oxm.record.SAXUnmarshaller.unmarshal(SAXUnmarshaller.java:573) at org.eclipse.persistence.internal.oxm.record.SAXUnmarshaller.unmarshal(SAXUnmarshaller.java:482) at org.eclipse.persistence.oxm.XMLUnmarshaller.unmarshal(XMLUnmarshaller.java:560) at org.eclipse.persistence.jaxb.JAXBUnmarshaller.unmarshal(JAXBUnmarshaller.java:322) at blog.weather.YahooDemo.main(YahooDemo.java:32)
Created attachment 203607 [details] MOXy - Test Cases
Created attachment 203609 [details] Core - Fix
Fix checked into 2.3.1 at rev: 10115 Fix checked into trunk at rev: 10116 Code reviewed by: Denise Smith Fix Details: In UnmarshalRecord.startCDATA I check to see if the xPathNode is not null before performing actions on it. It would be null for unmapped content.
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink