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

Bug 349058

Summary: Improve error message for incorrect jaxb.index
Product: z_Archived Reporter: Rick Barkhouse <rick.barkhouse>
Component: EclipselinkAssignee: Nobody - feel free to take it <nobody>
Status: RESOLVED INVALID QA Contact:
Severity: enhancement    
Priority: P4 CC: blaise.doughan, david.twelves
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Rick Barkhouse CLA 2011-06-10 11:22:47 EDT
One of the ways to bootstrap a MOXy JAXBContext is from a context path:

JAXBContext ctx = JAXBContext.newInstance("ctxpath", ClassLoader.getSystemClassLoader(), null);

One of the checks that we do is to see if that context path contains a jaxb.index file, containing a list of Classes to bootstrap with.

However, if the classes in that list cannot be found, we throw the generic error:

"The context path ctxpath contains no ObjectFactory or jaxb.index, no external metadata was found in properties Map, and no sessions.xml was found."

However, in this case, a jaxb.index WAS found, but no classes from it could be found.
Comment 1 Rick Barkhouse CLA 2012-05-02 11:14:35 EDT
Since this bug was entered, the error that is thrown in this case (jaxb.index found but can't load one of its classes) has changed.

We now throw "A descriptor for class typelevelns.Person was not found in the project.  For JAXB, if the JAXBContext was bootstrapped using TypeMappingInfo[] you must call a marshal method that accepts TypeMappingInfo as an input parameter."

This is fine, because at least it is telling the user which class it was unable to load.  Closing this.
Comment 2 Eclipse Webmaster CLA 2022-06-09 10:21:47 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink