Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] MOXY: XMLCompositeObjectMapping bug when using current node as XPath?

Hi Magnus,

This sounds like it could be a bug if it was working in a previous version. Could you send me a sample of the XML document you're trying to read in when the error occurs, and a general overview of the object model? I can try to reproduce the issue and track down the cause of the failure.

Thanks,

-Matt

Magnus Heino wrote:

This mapping:

        XMLCompositeObjectMapping versionInterval = new XMLCompositeObjectMapping();
        versionInterval.setAttributeName("versionInterval");
        versionInterval.setXPath(".");
        versionInterval.setReferenceClass(VersionInterval.class);
        descriptor.addMapping(versionInterval);

that is working just fine with 1.1.3 breaks with 2.0.1:

java.lang.NullPointerException
at org.eclipse.persistence.internal.oxm.XMLCompositeObjectMappingNodeValue.endSelfNodeValue(XMLCompositeObjectMappingNodeValue.java:382)
at org.eclipse.persistence.oxm.record.UnmarshalRecord.endDocument(UnmarshalRecord.java:487)
at org.apache.xerces.parsers.AbstractSAXParser.endDocument(Unknown Source)
at org.apache.xerces.impl.XMLDocumentScannerImpl.endEntity(Unknown Source)
at org.apache.xerces.impl.XMLEntityManager.endEntity(Unknown Source)
at org.apache.xerces.impl.XMLEntityScanner.load(Unknown Source)
at org.apache.xerces.impl.XMLEntityScanner.skipSpaces(Unknown Source)
at org.apache.xerces.impl.XMLDocumentScannerImpl$TrailingMiscDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at org.eclipse.persistence.internal.oxm.record.XMLReader.parse(XMLReader.java:103)
at org.eclipse.persistence.internal.oxm.record.SAXUnmarshaller.unmarshal(SAXUnmarshaller.java:639)
at org.eclipse.persistence.internal.oxm.record.SAXUnmarshaller.unmarshal(SAXUnmarshaller.java:241)
at org.eclipse.persistence.internal.oxm.record.SAXUnmarshaller.unmarshal(SAXUnmarshaller.java:424)
at org.eclipse.persistence.internal.oxm.record.SAXUnmarshaller.unmarshal(SAXUnmarshaller.java:454)
at org.eclipse.persistence.oxm.XMLUnmarshaller.unmarshal(XMLUnmarshaller.java:532)

It's the . as xpath _expression_ for current node that cause it. If I set it some something else like "foo", it doesn't crash, but then the xml isn't the way i want it to be.

Bug? New feature? Workaround?

Thanks!

--

 /Magnus Heino

_______________________________________________ eclipselink-users mailing list eclipselink-users@xxxxxxxxxxx https://dev.eclipse.org/mailman/listinfo/eclipselink-users

Back to the top