users@jaxb.java.net

Error Message during Validation

From: Suresh Madhavan <msureshp_at_vsnl.com>
Date: Tue, 11 Mar 2003 12:36:27 -0700

Hi all,

I have an XSD file and used the xjc to generate the java files. I created a JAXBContent object. Used the setter methods to put the data into the object.
When I called the validator, the errors messages returned by the validator doesn't specify exactly where the error has occured.


JAXBContext jc = JAXBContext.newInstance( "cardAddress");
Validator validate = jc.createValidator();
Address cardAddress = objFactory.createAddress();
cardAddress.setCOUNTRY("US");
cardAddress.setADDRESSLINE2("Testing address line 2");
cardAddress.setADDRESSLINE1("Testing address line 1");
cardAddress.setPOSTCODE("10010");
validate.setEventHandler(errorCollector);
validate.validateRoot(cardAddress);

When I see the events from the EventCollector, I get the below

Message :the value does not match the regular expression "ISSUE".
Object:null
Node:null
urlnull
getLineNumber-1
getColumnNumber-1
getOffset-1

I tried using the locator and also the LinkedException. Both didn't help me to find where the error was.

And also I was not able to find information how to do the Fail-Fast Validation.

Thanks in Advance
Suresh