Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 337882 - NULL POINTER EXCEPTION MARSHALING JAXBELEMENT CONTAINING NULL OBJECT
Summary: NULL POINTER EXCEPTION MARSHALING JAXBELEMENT CONTAINING NULL OBJECT
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: Matt MacIvor CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-22 13:49 EST by Matt MacIvor CLA
Modified: 2022-06-09 10:09 EDT (History)
0 users

See Also:


Attachments
Proposed Fix. (1.22 KB, patch)
2011-02-22 13:52 EST, Matt MacIvor CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matt MacIvor CLA 2011-02-22 13:49:09 EST
A null pointer exception occurs when marshalling a null wrapped in a JAXBElement through EclipseLink JAXB.

java.lang.NullPointerException
at
org.eclipse.persistence.jaxb.JAXBMarshaller.wrapObjectInXMLRoot(JAXBMarshaller
.java:464)
at
org.eclipse.persistence.jaxb.JAXBMarshaller.wrapObject(JAXBMarshaller.java:453
)
at
org.eclipse.persistence.jaxb.JAXBMarshaller.marshal(JAXBMarshaller.java:377)
at testing.JaxbElementNull.main(JaxbElementNull.java:65) 

This is due to a missing null check when determining if the value wrapped the the JAXBElement is a binary type.
Comment 1 Matt MacIvor CLA 2011-02-22 13:52:23 EST
Created attachment 189527 [details]
Proposed Fix.
Comment 2 Matt MacIvor CLA 2011-02-23 13:18:45 EST
Attached patch checked in to SVN
Reviewed by David McCann
Comment 3 Eclipse Webmaster CLA 2022-06-09 10:09:09 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink