Community
Participate
Working Groups
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)
Created attachment 214734 [details] Patch
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
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink