Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 349058 - Improve error message for incorrect jaxb.index
Summary: Improve error message for incorrect jaxb.index
Status: RESOLVED INVALID
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P4 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-10 11:22 EDT by Rick Barkhouse CLA
Modified: 2022-06-09 10:21 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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