Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » MOXy JAXB with dynamic entities
MOXy JAXB with dynamic entities [message #969491] Sat, 03 November 2012 09:04 Go to next message
harry rajan is currently offline harry rajan
Messages: 5
Registered: October 2012
Junior Member
I am trying to use MOXy JAXB but cannot get it to work to generate xml from dynamic entities. I don't have the xsd for the entities, so i used SchemaOutputResolver to generate the xml schema for the dynamic entity classes at runtime.

javax.xml.bind.MarshalException
- with linked exception:
[Exception [EclipseLink-25003] (Eclipse Persistence Services - 2.4.1.v20121003-ad44345): org.eclipse.persistence.exceptions.XMLMarshalException
Exception Description: An error occurred marshalling the object
Internal Exception: Exception [EclipseLink-25007] (Eclipse Persistence Services - 2.4.1.v20121003-ad44345): org.eclipse.persistence.exceptions.XMLMarshalException
Exception Description: A descriptor for class schema.User 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.]
at org.eclipse.persistence.jaxb.JAXBMarshaller.marshal(JAXBMarshaller.java:391)

Re: MOXy JAXB with dynamic entities [message #972375 is a reply to message #969491] Mon, 05 November 2012 15:26 Go to previous message
Rick Barkhouse is currently offline Rick Barkhouse
Messages: 22
Registered: July 2009
Junior Member
Hello Harry,

If you do not have an XSD to start with, you may be better off creating an EclipseLink OXM bindings file describing the entities you want, instead of trying to craft a schema in-memory.

You can see an example of this on the EclipseLink documentation center at:
http://www.eclipse.org/eclipselink/documentation/2.4/moxy/dynamic_jaxb004.htm#BGBGHCHJ

For more information about the OXM format, and Dynamic JAXB in general, see:
http://www.eclipse.org/eclipselink/documentation/2.4/moxy/dynamic_jaxb.htm#sthref191
http://www.eclipse.org/eclipselink/documentation/2.4/moxy/runtime003.htm#CACHCHAE

If that is not an option for you, I will need you to provide some test code that shows how you're doing this and reproduces the error you are seeing. Providing a full stack trace will also help.

- Rick
Previous Topic:Map Mapping fails if there are duplicate values
Next Topic:OSGI Load Time Weaver
Goto Forum:
  


Current Time: Wed Oct 22 06:26:54 GMT 2014

Powered by FUDForum. Page generated in 0.45992 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software