Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Basic MOXy Question

Hello Bill,

That particular exception is probably the most encountered exception by MOXy users.  In the particular example you are referring to the default root element is associated with the XML descriptor in step #7.

Possible Causes:
  • A default root element was not specified on the Customer descriptor, see step #7 from the example.
  • Check that the namespace URI associated with the prefix ns1 is correctly set to "urn:customer-example".
  • Check that the root element name/URI from you input document matches those specified in your EclipseLink/TopLink metadata.
Also, a completed version of that How To can be found as part of the TopLink examples (toplink/examples/foundation/non-relational/ox), if you want to compare it to your version:

If the problem still persists could you send me your version of CustomerProject.xml and sessions.xml?


Knotts, Bill wrote:
I'm sure this is a pretty basic question but try as I might I can't seem to get around it.
I am trying to work thru the TopLink OXM example ( using EclipseLink and try as I might, I keep getting the same exception each time...
"[Exception [EclipseLink-25008] (Eclipse Persistence Services - 1.0 (Build 1.0 - 20080707)): org.eclipse.persistence.exceptions.XMLMarshalException
Exception Description: A descriptor with default root element {urn:customer-example}customer was not found in the project]"
1. I've created a JAR containing the sample classes from the TopLink article.
2. I've walked thru all of the EclipseLink steps in the article with no apparent difficulties
My problem starts when I attempting to run the test code from the article.
The jar containing the sample classes is on the classpath, as are the following from EclipseLink:
In addition, the 'classes' directory from the EclipseLink sample project is on the classpath, containing the following:
The required resides under the 'examples/ox/model' subdirectory above.
Exception is being thrown at the following line from the sample code:
Customer customer = (Customer) unmarshaller.unmarshal(file);
Any insight would be greatly appreciated!

_______________________________________________ eclipselink-users mailing list eclipselink-users@xxxxxxxxxxx

Back to the top