[ http://jira.codehaus.org/browse/XFIRE-771?page=comments#action_84612 ]
Frank Grupe commented on XFIRE-771:
-----------------------------------
Hi Tomasz,
perhaps there has happend a mistake when checking in the fix?
Because I get the same problem as described here in version 1.2.4:
Instead of information about the nested validation Exception there appears only
the "Unmarshal" Exception at the client side when a validation error occurs:
<soap:Fault>
<faultcode>soap:Server</faultcode>
<faultstring>Could not unmarshall type.</faultstring>
</soap:Fault>
I'd also prefer to see something like this instead, so that the caller can
react himself:
<soap:Fault>
<faultcode>soap:Server</faultcode>
<faultstring>org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid
content was found starting with element 'width'. One of '{"":length}' is
expected.</faultstring>
</soap:Fault>
Could you please check what went wrong?
Thanks,
Frank
> Schema validation in JAXB does not return validation errors to the client
> -------------------------------------------------------------------------
>
> Key: XFIRE-771
> URL: http://jira.codehaus.org/browse/XFIRE-771
> Project: XFire
> Issue Type: Improvement
> Components: JAXB 2.0
> Affects Versions: 1.2.2
> Reporter: Alexander Ananiev
> Assigned To: Tomasz Sztelak
> Fix For: 1.2.3
>
> Attachments: JaxbType.java
>
>
> When schema validation is enabled for JAXB unmarshaling and it fails, the
> following code is used in org.codehaus.xfire.jaxb2.JaxbType.readObject:
> catch (JAXBException e)
> {
> throw new XFireFault("Could not unmarshall type.", e,
> XFireFault.RECEIVER);
> }
> JAXBException in this case is the "Unmarshalling" exception, the actual
> validation exception is its cause. Hence, this code looses the cause
> exception since XFireFault does not handle exception chains.
> I use the following patch instead:
> catch (JAXBException jaxbEx)
> {
> Throwable ex = jaxbEx;
> if (jaxbEx.getLinkedException()!=null)
> ex=jaxbEx.getLinkedException();
>
> //throw new XFireFault("Could not unmarshall type.", ex,
> XFireFault.RECEIVER);
> throw new XFireFault( ex );
> }
> But a better solution would be to change XfireFault so it collects messages
> from all exceptions in a chain, not just from the top one.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email