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

Bug 364487

Summary: with JDK 1.5, from test-jaxb, ContentTypeTestCase failed while marshalling
Product: z_Archived Reporter: Praba Vijayaratnam <prabaharan.vijayaratnam>
Component: EclipselinkAssignee: Rick Barkhouse <rick.barkhouse>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: blaise.doughan, david.twelves
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Patch none

Description Praba Vijayaratnam CLA 2011-11-22 11:20:21 EST
3 instances of following test failed with ConversionException:
org.eclipse.persistence.testing.jaxb.attachments.contenttype.ContentTypeTestCases.testNoMimeTypeSpecied_ContentTypeImageGif
-------------
javax.xml.bind.MarshalException
- with linked exception:
[Exception [EclipseLink-3001] (Eclipse Persistence Services - 2.3.2.v20111117-r10404): org.eclipse.persistence.exceptions.ConversionException
Exception Description: The object [BufferedImage@37dde9: type = 4 DirectColorModel: rmask=ff gmask=ff00 bmask=ff0000 amask=0 IntegerInterleavedRaster: width = 1 height = 1 #Bands = 3 xOff = 0 yOff = 0 dataOffset[0] 0], of class [class java.awt.image.BufferedImage], could not be converted to [class [B].
Internal Exception: Exception [EclipseLink-25022] (Eclipse Persistence Services - 2.3.2.v20111117-r10404): org.eclipse.persistence.exceptions.XMLMarshalException
Exception Description: Unable to marshal Image. No encoder available for mimeType image/gif.]
at org.eclipse.persistence.jaxb.JAXBMarshaller.marshal(JAXBMarshaller.java:490)
at org.eclipse.persistence.testing.jaxb.attachments.contenttype.ContentTypeTestCases.testNoMimeTypeSpecied_ContentTypeImageGif(ContentTypeTestCases.java:60)
Caused by: Exception [EclipseLink-3001] (Eclipse Persistence Services - 2.3.2.v20111117-r10404): org.eclipse.persistence.exceptions.ConversionException
Exception Description: The object [BufferedImage@37dde9: type = 4 DirectColorModel: rmask=ff gmask=ff00 bmask=ff0000 amask=0 IntegerInterleavedRaster: width = 1 height = 1 #Bands = 3 xOff = 0 yOff = 0 dataOffset[0] 0], of class [class java.awt.image.BufferedImage], could not be converted to [class [B].
Internal Exception: Exception [EclipseLink-25022] (Eclipse Persistence Services - 2.3.2.v20111117-r10404): org.eclipse.persistence.exceptions.XMLMarshalException
Exception Description: Unable to marshal Image. No encoder available for mimeType image/gif.
at org.eclipse.persistence.exceptions.ConversionException.couldNotBeConverted(ConversionException.java:79)
at org.eclipse.persistence.internal.oxm.XMLBinaryDataHelper.getBytesFromImage(XMLBinaryDataHelper.java:174)
at org.eclipse.persistence.internal.oxm.XMLBinaryDataHelper.getBytesForBinaryValue(XMLBinaryDataHelper.java:104)
at org.eclipse.persistence.internal.oxm.XMLBinaryDataMappingNodeValue.marshalSingleValue(XMLBinaryDataMappingNodeValue.java:149)
at org.eclipse.persistence.internal.oxm.XMLBinaryDataMappingNodeValue.marshal(XMLBinaryDataMappingNodeValue.java:71)
at org.eclipse.persistence.internal.oxm.record.ObjectMarshalContext.marshal(ObjectMarshalContext.java:60)
at org.eclipse.persistence.internal.oxm.XPathNode.marshal(XPathNode.java:327)
at org.eclipse.persistence.internal.oxm.TreeObjectBuilder.buildRow(TreeObjectBuilder.java:369)
at org.eclipse.persistence.oxm.XMLMarshaller.marshal(XMLMarshaller.java:937)
at org.eclipse.persistence.oxm.XMLMarshaller.marshal(XMLMarshaller.java:577)
at org.eclipse.persistence.jaxb.JAXBMarshaller.marshal(JAXBMarshaller.java:488)
Caused by: Exception [EclipseLink-25022] (Eclipse Persistence Services - 2.3.2.v20111117-r10404): org.eclipse.persistence.exceptions.XMLMarshalException
Exception Description: Unable to marshal Image. No encoder available for mimeType image/gif.
at org.eclipse.persistence.exceptions.XMLMarshalException.noEncoderForMimeType(XMLMarshalException.java:239)
at org.eclipse.persistence.internal.oxm.XMLBinaryDataHelper.getBytesFromImage(XMLBinaryDataHelper.java:169)
Comment 1 Rick Barkhouse CLA 2012-04-27 15:54:20 EDT
Created attachment 214734 [details]
Patch
Comment 2 Rick Barkhouse CLA 2012-04-30 09:27:08 EDT
These three test cases were already coded to potentially encounter a NO_ENCODER_FOR_MIME_TYPE exception - however the exception chain that the test was looking for was incorrect.

Was looking for

MarshalException -> MarshalException

But actually is

MarshalException -> ConversionException -> MarshalException
Comment 3 Eclipse Webmaster CLA 2022-06-09 10:07:36 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink