Skip to main content

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

Hi Matt,
 
Both you and Blaise were dead on in your analysis of my issue.  Thanks for the help!
 
 
Regards,
Bill


From: eclipselink-users-bounces@xxxxxxxxxxx [mailto:eclipselink-users-bounces@xxxxxxxxxxx] On Behalf Of Matt MacIvor
Sent: Monday, July 28, 2008 4:18 PM
To: EclipseLink User Discussions
Subject: Re: [eclipselink-users] Basic MOXy Question

Hi Bill,

This error usually indicates that there was no DefaultRootElement configured in your project that matches the root element of the XML document you're trying to unmarshal. Setting up the default root element would be done in step 7 of the How-To article. Is it possible you missed this step or the root element you specified contains a typo?

If not, then if you can send your files, I can take a look and see if I can find the issue.

-Matt

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

Back to the top