1.1 --- a/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/XsiTypeLoader.java Thu Aug 08 10:10:38 2013 -0700 1.2 +++ b/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/XsiTypeLoader.java Fri Aug 23 09:57:21 2013 +0100 1.3 @@ -92,12 +92,15 @@ 1.4 return defaultBeanInfo; 1.5 1.6 beanInfo = context.getJAXBContext().getGlobalType(type); 1.7 - if(beanInfo==null) { 1.8 - String nearest = context.getJAXBContext().getNearestTypeName(type); 1.9 - if(nearest!=null) 1.10 - reportError(Messages.UNRECOGNIZED_TYPE_NAME_MAYBE.format(type,nearest),true); 1.11 - else 1.12 - reportError(Messages.UNRECOGNIZED_TYPE_NAME.format(type),true); 1.13 + if(beanInfo==null) { // let's report an error 1.14 + if (context.parent.hasEventHandler() // is somebody listening? 1.15 + && context.shouldErrorBeReported()) { // should we report error? 1.16 + String nearest = context.getJAXBContext().getNearestTypeName(type); 1.17 + if(nearest!=null) 1.18 + reportError(Messages.UNRECOGNIZED_TYPE_NAME_MAYBE.format(type,nearest),true); 1.19 + else 1.20 + reportError(Messages.UNRECOGNIZED_TYPE_NAME.format(type),true); 1.21 + } 1.22 } 1.23 // TODO: resurrect the following check 1.24 // else