Ok - sorry for the repeated of emails, I think I have answered my own
questions.  I believe I know where I would add a XMLErrorHandler, its
to

./rt/core/src/main/java/org/apache/cxf/databinding/source/XMLStreamDataReader.java

The private Element validate(XMLStreamReader input) method is where
the jaxp validator is created.

This method could be enhanced much like
org.apache.cxf.jaxb.io.DataReaderImpl is configured with a jaxb
validation event handler to configure an XMLErrorHandler I should
think.

I might have a play around with it and submit a patch if I come up
with something.

Cheers
Jason


On Wed, Feb 23, 2011 at 10:21 AM, Jason Pell <[email protected]> wrote:
> Ok - this looks like what I need - now to figure out where in cxf I can do 
> this!
>
> http://stackoverflow.com/questions/4864681/jaxb-2-0-schema-validation-problem
>
> I need to register an XMLErrorHandler
>
> Any ideas?
>
> On Wed, Feb 23, 2011 at 10:18 AM, Jason Pell <[email protected]> wrote:
>> It looks like I need to somehow override xerces error handling as this
>> is the partial stack trace from the JAXBEncoderDecoder
>>
>> Caused by: org.xml.sax.SAXParseException: cvc-minInclusive-valid:
>> Value '2009-12-31T23:59:59' is not facet-valid with respect to
>> minInclusive '2010-01-01T00:00:00.0' for type
>> '#AnonType_childSubmissionDatesPerson'.
>>        at 
>> com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
>>        at 
>> com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131)
>>        at 
>> com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:384)
>>        at 
>> com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:318)
>>        at 
>> com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(XMLSchemaValidator.java:417)
>>        at 
>> com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(XMLSchemaValidator.java:3182)
>>        at 
>> com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.elementLocallyValidType(XMLSchemaValidator.java:3097)
>>        at 
>> com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.processElementContent(XMLSchemaValidator.java:3007)
>>        at 
>> com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleEndElement(XMLSchemaValidator.java:2150)
>>        at 
>> com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.endElement(XMLSchemaValidator.java:818)
>>
>> On Wed, Feb 23, 2011 at 9:15 AM, Jason Pell <[email protected]> wrote:
>>> Hi,
>>>
>>> I have the ValidationEventHandler working but this does not actually
>>> appear to allow me to modify the content of the soap fault.   I have
>>> been digging in JAXBEncoderDecoder and can see that the exception from
>>> the jaxb unmarshaller is wrapped in a fault and thrown.  So in cxf
>>> itself there does not appear to be anything I can do to modify the
>>> soap message details (to for example add a line number).
>>>
>>> When I tried to implement my own handler by throwing a run time
>>> exception, jaxb appeared to treat this as though I had returned false
>>> from the handler and completely ignored my exception.
>>>
>>> I will keep digging into the jaxb ri for more insight but if anyone
>>> has anything I would appreciate it.
>>>
>>> Thanks
>>> Jason
>>>
>>
>

Reply via email to