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

Bug 351115

Summary: test-jaxb JDK1.7 two failures in DynamicJAXB
Product: z_Archived Reporter: Rick Barkhouse <rick.barkhouse>
Component: EclipselinkAssignee: 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:
Description Flags
Patch none

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