Hi,
I'm getting an expection while unmarshalling using JAXB. The error is as follows :
DefaultValidationEventHandler: [ERROR]: unexpected element (uri:"http://www.etrade.com/ee/systemdomainao/search", local:"Context_Id"). Expected elements are <{}contextId>,<{}predicateInterceptor>,<{}isDefaultsearch>,<{}implicitContextSQL>,<{}contextName>,<{}searchId>,<{}implicitContextText>
I've generated JAXB classes using xjc command from my schema. The root element is Search object which has a List of Searchcontext and Columlist object. When I'm trying to unmarshall the XML, I'm getting the above exception. What is baffling, if I comment out the <tns:SearchContext> entry from the XML, unmarshall doesn't throw any exception and populates the columnlist properly. Columnlist and Searchcontext have little difference except that columnlist contains more elements.
Here'e the unmarshall code,
URL metadataURL = this.getClass().getClassLoader().getResource("metadata/search/PARTICIPANT.xml");
JAXBContext jc = JAXBContext.newInstance("com.etrade.ee.systemdomainao.search.domain");
Unmarshaller unmarshaller = jc.createUnmarshaller();
unmarshaller.setEventHandler(new javax.xml.bind.helpers.DefaultValidationEventHandler());
Search search = (Search)unmarshaller.unmarshal(metadataURL);
Any pointers will be highly appreciated.
Thanks