Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » JAXBErrorHandler#warning(JAXBErrorHandler#warning implementation)
JAXBErrorHandler#warning [message #1231843] Wed, 15 January 2014 09:42 Go to next message
Pëtr Andreev is currently offline Pëtr Andreev
Messages: 3
Registered: January 2014
Junior Member
Hi there, i`m evaluation a MOXy org.eclipse.persistence:org.eclipse.persistence.moxy:jar:2.6.0-SNAPSHOT
and implemented custom javax.xml.bind.ValidationEventHandler as described in Using a ValidationEventHandler. Works fine, but i discovered, that while validating against a schema the JAXBErrorHandler#warning#L51 notifies the EventHandler with a severity ERROR instead of WARNING if some attribute is OXM-unmapped (from UnmarshalRecordImpl.startUnmappedElement). The problem is that i don`t want to OXM-map every element in the XML-data, but just validate against schema. The XML-data are perfectly valid, i validated them using 3rd party tools. It`s kind of confusing, since the data is valid, the OXM is valid, the unmarshalling works, but the validation fails. Should i open a JIRA issue for that? Thanks for the good job on MOXy!
Re: JAXBErrorHandler#warning [message #1232365 is a reply to message #1231843] Thu, 16 January 2014 14:25 Go to previous messageGo to next message
Blaise Doughan is currently offline Blaise Doughan
Messages: 163
Registered: July 2009
Senior Member

A JAXB implementation will always throw a ValidationEvent with severity ERROR when an unmapped element is encountered (whether XML schema validation is enabled or not). This is because that element is not valid against the JAXB metadata. Note that by default a JAXB impl will not fail on ERROR only on FATAL_ERROR.
Re: JAXBErrorHandler#warning [message #1239106 is a reply to message #1232365] Mon, 03 February 2014 06:23 Go to previous message
Pëtr Andreev is currently offline Pëtr Andreev
Messages: 3
Registered: January 2014
Junior Member
Thank you for the explanation, im glad its not a bug(Wink.Generally im excited about features MOXy offers (type safety and dynamic entity bindings)!Can you please take a look, may be you can help me: http://www.eclipse.org/forums/index.php/m/1239105/
Previous Topic:Versioning with OXM
Next Topic:Using DescriptorEventAdapter in @EntityListeners correct
Goto Forum:
  


Current Time: Sun Apr 20 12:25:26 EDT 2014

Powered by FUDForum. Page generated in 0.02668 seconds