[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:
http://www.oracle.com/technology/products/ias/toplink/examples/foundation_examples.zip

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

-Blaise

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 (http://www.oracle.com/technology/products/ias/toplink/technical/tips/ox/index.htm) 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:
eclipselink.jar
moxy/javax.activation_1.1.0.jar
moxy/javax.mail_1.4.0.jar
moxy/javax.xml.bind_2.0.0.jar
moxy/javax.xml.stream_1.0.0.jar
moxy/jaxb-impl.jar
moxy/jaxb-xjc.jar
 
In addition, the 'classes' directory from the EclipseLink sample project is on the classpath, containing the following:
examples
CustomerProject.xml
examples.ox.model.Address.xml
examples.ox.model.Customer.xml
examples.ox.model.PhoneNumber.xml
sessions.xml
 
The required jaxb.properties 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!
 
Regards,
Bill

_______________________________________________ eclipselink-users mailing list eclipselink-users@xxxxxxxxxxx https://dev.eclipse.org/mailman/listinfo/eclipselink-users