Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 351115 - test-jaxb JDK1.7 two failures in DynamicJAXB
Summary: test-jaxb JDK1.7 two failures in DynamicJAXB
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: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-04 15:24 EDT by Rick Barkhouse CLA
Modified: 2022-06-09 10:26 EDT (History)
0 users

See Also:


Attachments
Patch (3.27 KB, patch)
2011-07-04 15:47 EDT, Rick Barkhouse CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Rick Barkhouse CLA 2011-07-04 15:24:20 EDT
Dynamic JAXB: Context Creation: testNewInstanceXSDImportError  	Error  	javax.xml.bind.JAXBException cannot be cast to org.eclipse.persistence.exceptions.JAXBException

java.lang.ClassCastException: javax.xml.bind.JAXBException cannot be cast to org.eclipse.persistence.exceptions.JAXBException
at org.eclipse.persistence.testing.jaxb.dynamic.DynamicJAXBContextCreationTestCases.testNewInstanceXSDImportError(DynamicJAXBContextCreationTestCases.java:234)

Dynamic JAXB: Context Creation: testNewInstanceXSDExternalBindingError 	Failure 	Unexpected exception thrown. javax.xml.bind.JAXBException: Provider org.eclipse.persistence.jaxb.dynamic.DynamicJAXBContextFactory could not be instantiated: javax.xml.bind.JAXBException - with linked exception: [Exception [EclipseLink-50078] (Eclipse Persistence Services - 2.4.0.v20110701-r9654): org.eclipse.persistence.exceptions.JAXBException Exception Description: Cannot process external bindings files (XJB). To use external bindings files, both XSD and XJB must be provided as javax.xml.transform.Sources.] - with linked exception: [javax.xml.bind.JAXBException - with linked exception: [Exception [EclipseLink-50078] (Eclipse Persistence Services - 2.4.0.v20110701-r9654): org.eclipse.persistence.exceptions.JAXBException Exception Description: Cannot process external bindings files (XJB). To use external bindings files, both XSD and XJB must be provided as javax.xml.transform.Sources.]]
Comment 1 Rick Barkhouse CLA 2011-07-04 15:47:27 EDT
Created attachment 199069 [details]
Patch
Comment 2 Rick Barkhouse CLA 2011-07-04 15:52:24 EDT
Fixed.

It seems that XJC throws slightly different exceptions in JDK1.7 vs JDK1.6 under the following error conditions:

- using an external bindings file that is not a Source
- non-Source schema imports another schema

JDK 1.6:  JAXBException --linked--> EclipseLinkException
JDK 1.7:  JAXBException --linked--> JAXBException --linked--> EclipseLinkException


Changed test code to walk exception tree to look for an EclipseLink exception, instead of assuming it is one level deep.
Comment 3 Eclipse Webmaster CLA 2022-06-09 10:26:34 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink