users@jaxb.java.net

NullPointerException: at com.sun.xml.bind.v2.util.ByteArrayOutputStreamEx.readFrom(ByteArrayOutputStreamEx.java:76)

From: Farrukh Najmi <farrukh_at_wellfleetsoftware.com>
Date: Tue, 21 Apr 2009 18:23:33 -0400

Dear JAXB dev team,

I am seeing the following stack trace when marshalling a JAXB bean that
has a text/plain file (with just the sring "hi") embeded within it. The
version I am using is jaxb-impl-2.1.10 (latest released version).

Is this a known issue? Are there known worarounds? Any advice would be
greatly appreciated. Thanks.

java.lang.NullPointerException
    at
com.sun.xml.bind.v2.util.ByteArrayOutputStreamEx.readFrom(ByteArrayOutputStreamEx.java:76)
    at
com.sun.xml.bind.v2.runtime.unmarshaller.Base64Data.get(Base64Data.java:189)
    at
com.sun.xml.bind.v2.runtime.unmarshaller.Base64Data.length(Base64Data.java:218)
    at com.sun.xml.bind.v2.runtime.output.SAXOutput.text(SAXOutput.java:172)
    at
com.sun.xml.bind.v2.runtime.XMLSerializer.leafElement(XMLSerializer.java:344)
    at
com.sun.xml.bind.v2.model.impl.RuntimeBuiltinLeafInfoImpl$PcdataImpl.writeLeafElement(RuntimeBuiltinLeafInfoImpl.java:177)
    at
com.sun.xml.bind.v2.runtime.MimeTypedTransducer.writeLeafElement(MimeTypedTransducer.java:92)
    at
com.sun.xml.bind.v2.runtime.reflect.TransducedAccessor$CompositeTransducedAccessorImpl.writeLeafElement(TransducedAccessor.java:250)
    at
com.sun.xml.bind.v2.runtime.property.SingleElementLeafProperty.serializeBody(SingleElementLeafProperty.java:98)
    at
com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeBody(ClassBeanInfoImpl.java:332)
    at
com.sun.xml.bind.v2.runtime.XMLSerializer.childAsXsiType(XMLSerializer.java:698)
    at
com.sun.xml.bind.v2.runtime.property.ArrayElementNodeProperty.serializeItem(ArrayElementNodeProperty.java:65)
    at
com.sun.xml.bind.v2.runtime.property.ArrayElementProperty.serializeListBody(ArrayElementProperty.java:168)
    at
com.sun.xml.bind.v2.runtime.property.ArrayERProperty.serializeBody(ArrayERProperty.java:152)
    at
com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeBody(ClassBeanInfoImpl.java:332)
    at
com.sun.xml.bind.v2.runtime.XMLSerializer.childAsXsiType(XMLSerializer.java:698)
    at
com.sun.xml.bind.v2.runtime.property.SingleElementNodeProperty.serializeBody(SingleElementNodeProperty.java:152)
    at
com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeBody(ClassBeanInfoImpl.java:332)
    at
com.sun.xml.bind.v2.runtime.XMLSerializer.childAsSoleContent(XMLSerializer.java:592)
    at
com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeRoot(ClassBeanInfoImpl.java:320)
    at
com.sun.xml.bind.v2.runtime.XMLSerializer.childAsRoot(XMLSerializer.java:493)
    at
com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:325)
    at
com.sun.xml.bind.v2.runtime.MarshallerImpl.marshal(MarshallerImpl.java:254)

-- 
Regards,
Farrukh
Web: http://www.wellfleetsoftware.com