Here you can find the source of getUnmarshaller()
public static Unmarshaller getUnmarshaller() throws JAXBException
//package com.java2s; /*/*from w ww . ja v a 2s .com*/ * ==================================================================== * * This code is subject to the freebxml License, Version 1.1 * * Copyright (c) 2001 - 2003 freebxml.org. All rights reserved. * * $Header: /cvs/hyperjaxb3/samples/po-ws/src/main/java/org/jvnet/hyperjaxb3/samples/pows/common/BindingUtility.java,v 1.1 2007/05/31 01:23:31 najmi Exp $ * ==================================================================== */ import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBException; import javax.xml.bind.Unmarshaller; import javax.xml.bind.ValidationEvent; import javax.xml.bind.ValidationEventHandler; public class Main { public static JAXBContext jaxbContext; public static Unmarshaller getUnmarshaller() throws JAXBException { Unmarshaller unmarshaller = jaxbContext.createUnmarshaller(); //unmarshaller.setValidating(true); unmarshaller.setEventHandler(new ValidationEventHandler() { public boolean handleEvent(ValidationEvent event) { boolean keepOn = false; return keepOn; } }); return unmarshaller; } }