Xml Root Element; @Xml Root Element public class Customer package example; import LOCATOR LINE NUMBER: 3 COLUMN NUMBER: 25 OFFSET: -1 OBJECT: null NODE: null URL: null EVENT SEVERITY: 1 MESSAGE: cvc-type.3.1.3: The value 'Jane Doe' of element 'name' is not valid. SAXParse Exception: cvc-type.3.1.3: The value 'Jane Doe' of element 'name' is not valid. SAXParse Exception: cvc-complex-type.2.4.d: Invalid content was found starting with element 'customer'. EVENT SEVERITY: 1 MESSAGE: cvc-max Length-valid: Value 'Jane Doe' with length = '8' is not facet-valid with respect to max Length '5' for type 'string With Max Size5'. SAXParse Exception: cvc-max Length-valid: Value 'Jane Doe' with length = '8' is not facet-valid with respect to max Length '5' for type 'string With Max Size5'.Unsupported Operation Exception at v2.runtime.unmarshaller. Unmarshaller Validating(Unmarshaller Impl.java:483) at my Code. Validating JAXBContext.create Unmarshaller(Validating JAXBContext.java:33) at impl.provider.entity. XMLRoot Element From(XMLRoot Element Provider.java:58) at spi.container.
Rather than creating a general validating mechanism it might be better to have a general mechanism you inherit from for specific validating purposes i.e. Trying to follow his instructions, I have implemented a Context Resolver as follows: @Provider public class Validating JAXBContext Resolver implements Context Resolver and a JAXBContext (modeled after the JSONJAXBContext in the jersey source) as: public class Validating JAXBContext extends JAXBContext Now, when I hit a method that would require unmarshalling content from XML, I receive an exception at my call to set Validating: I'm working with a JAXB Validator generated from my schema. The issue I have is that the exception message is way too vague to be usable. Secondly, the error message in the logging statment has no reference to what element it had a problem with. "the value does not match the regular expression "[A-Z][0-9]" isn't going to cut it for the users. There is a logging statement produced but I can't use that.Praveen P * E-mail praveen.mar_at_The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information.If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail.