| Summary: | Error unmarshalling when JAXB Context is created from both byte[].class and DataHandler.class | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Matt MacIvor <matt.macivor> | ||||||
| Component: | Eclipselink | Assignee: | Nobody - feel free to take it <nobody> | ||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P3 | ||||||||
| Version: | unspecified | ||||||||
| Target Milestone: | --- | ||||||||
| Hardware: | PC | ||||||||
| OS: | Windows XP | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
Created attachment 206281 [details]
Proposed Fix and Tests
Created attachment 206289 [details]
proposed fix and test
Proposed fix has been submitted into trunk and 2.3 streams The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink |
If we create a JAXBContext containing both byte[] and DataHandler classes, we get an unmarshal error trying to unmarshal a DOM node containing base64Binary data as a byte[]. If we remove DataHandler.class from the JAXBContext, it works fine. Exception [EclipseLink-3001] (Eclipse Persistence Services - 2.3.1.v20111019-r10246): org.eclipse.persistence.exceptions.ConversionException Exception Description: The object [4xuxMDM=], of class [class java.lang.String], could not be converted to [class [B]. at org.eclipse.persistence.exceptions.ConversionException.couldNotBeConverted(Con versionException.java:71) at org.eclipse.persistence.internal.helper.Helper.buildBytesFromHexString(Helper. java:237) at org.eclipse.persistence.internal.helper.ConversionManager.convertObjectToByteA rray(ConversionManager.java:316) at org.eclipse.persistence.internal.helper.ConversionManager.convertObject(Conver sionManager.java:133) at org.eclipse.persistence.internal.oxm.XMLConversionManager.convertObject(XMLCon versionManager.java:183) at org.eclipse.persistence.oxm.record.XMLRootRecord.getCurrentObject(XMLRootRecor d.java:80) at org.eclipse.persistence.internal.oxm.record.SAXUnmarshaller.unmarshal(SAXUnmar shaller.java:444) at org.eclipse.persistence.internal.oxm.record.SAXUnmarshaller.unmarshal(SAXUnmar shaller.java:389) at org.eclipse.persistence.oxm.XMLUnmarshaller.unmarshal(XMLUnmarshaller.java:496 ) at org.eclipse.persistence.jaxb.JAXBUnmarshaller.unmarshal(JAXBUnmarshaller.java: 262) at testing.DomTest.main(DomTest.java:27) WORKAROUND: ----------- TESTCASE DETAILS (REQUIRED): ---------------------------- Note the actual failing code in JRF creates the JAXBContext using the other API and properly configured service providers, but with the same issue: jaxbContext = (org.eclipse.persistence.jaxb.JAXBContext) JAXBContextFactory.createContext(schemaContentClasses, properties);