-
Bug
-
Resolution: Won't Do
-
Major
-
None
-
jbossws-native-3.1.2
-
None
If a message received suffers an error converting a value the error is silently dropped and the field is left initialised with the default value.
i.e. if an NumberFormatExceptions are thrown converting Strings to longs then the NumberFormatException is dropped and the field left to the default value.
The Unmarshaller should by default terminate for the first error or fatal error, currently it only terminates for a fatal error: -
This is a JAXB issue as raised here: -
https://jaxb.dev.java.net/issues/show_bug.cgi?id=655
A workaround could be to add a ValidationEventHandler with this behaviour to our JAXBDeserializer: -
Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
unmarshaller.setAttachmentUnmarshaller( new AttachmentUnmarshallerImpl());
unmarshaller.setEventHandler(new ValidationEventHandler() {
public boolean handleEvent(final ValidationEvent event)
{ int severity = event.getSeverity(); return (severity != ValidationEvent.FATAL_ERROR && severity != ValidationEvent.ERROR); }});
JAXBElement jbe = unmarshaller.unmarshal(xmlFragment, javaType);
value = jbe.getValue();
- blocks
-
JBWS-2682 Incorrect Parsing of Badly Formed int
- Closed
- is incorporated by
-
JBPAPP-2121 Sun JAXB Accepts Message Despite Failure During Parsing
- Closed
-
JBPAPP-2162 Sun JAXB Accepts Message Despite Failure During Parsing
- Closed
- is related to
-
JBWS-2302 Verify dependencies on outstanding Sun issues
- Closed