Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 316366

Summary: MOXy - NPE occurs when xml-path for attribute doesn't contain @
Product: z_Archived Reporter: David McCann <david.mccann>
Component: EclipselinkAssignee: Matt MacIvor <matt.macivor>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: matt.macivor
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
proposed fix and updated tests none

Description David McCann CLA 2010-06-09 15:37:13 EDT
When configuring a direct mapping to an attribute via external metadata if the xml-path does not contain an '@' a null pointer exception will occur.  See the following trace:


Caused by: java.lang.NullPointerException
	at org.eclipse.persistence.internal.oxm.XMLDirectMappingNodeValue.marshalSingleValue(XMLDirectMappingNodeValue.java:76)
	at org.eclipse.persistence.internal.oxm.XMLDirectMappingNodeValue.marshal(XMLDirectMappingNodeValue.java:57)
	at org.eclipse.persistence.internal.oxm.NodeValue.marshal(NodeValue.java:104)
	at org.eclipse.persistence.internal.oxm.record.ObjectMarshalContext.marshal(ObjectMarshalContext.java:60)
	at org.eclipse.persistence.internal.oxm.XPathNode.marshal(XPathNode.java:336)
	at org.eclipse.persistence.internal.oxm.XPathNode.marshal(XPathNode.java:324)
	at org.eclipse.persistence.internal.oxm.TreeObjectBuilder.buildRow(TreeObjectBuilder.java:327)
	at org.eclipse.persistence.oxm.XMLMarshaller.marshal(XMLMarshaller.java:919)
	at org.eclipse.persistence.oxm.XMLMarshaller.marshal(XMLMarshaller.java:734)
	... 21 more
Comment 1 Matt MacIvor CLA 2010-06-11 09:42:42 EDT
Created attachment 171723 [details]
proposed fix and updated tests
Comment 2 Matt MacIvor CLA 2010-06-11 11:29:07 EDT
Attached patch checked into trunk branch in SVN
Leaving bug open pending check in into 2.1.1

Reviewed by Blaise Doughan
Comment 3 Matt MacIvor CLA 2010-06-24 14:44:51 EDT
Fix backported into 2.1 stream.
Comment 4 Eclipse Webmaster CLA 2022-06-09 10:08:39 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink