[ 
https://issues.apache.org/jira/browse/CXF-3917?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13151236#comment-13151236
 ] 

Pablo Kraan commented on CXF-3917:
----------------------------------

Hi Freeman,

Thanks for the answer.
I took a look and the problem is not the same.
Also I review the sonar report at 
https://analysis.apache.org/drilldown/measures/5429?metric=coverage&rids%5B%5D=5431&rids%5B%5D=5718
 and the code that is causing the problem is not covered by your tests.

The problem is in ResolvingGrammarReaderController#resolveEntity which always 
returns null. Javadoc from ResolvingGrammarReaderController says: "Catch error 
messages and resolve schema locations"... should it be in charge of resolve 
them in the resolveEntity method as the provided patch does?

I should provide a test to reproduce the problem but that is not easy for me.
                
> Schema validation does not resolve relative schema locations
> ------------------------------------------------------------
>
>                 Key: CXF-3917
>                 URL: https://issues.apache.org/jira/browse/CXF-3917
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.3.1
>            Reporter: Pablo Kraan
>         Attachments: cxfRelativeSchemaValidation.patch
>
>
> Relative schema location works OK when schema validation is not enabled, but 
> when is enabled the validator is not able to properly resolve the relative 
> schema locations.
> The problem is simple: the ResolvingGrammarReaderController does not try to 
> resolve the relative schema files, it just returns null every time is 
> invoked, so the relative schema files are not resolved using the WSDL base 
> path, they are attempted to be resolved using the base path of the running 
> application. The fix is just to pass the base URI and use a URIResolver to 
> resolve the entities.
> We are using CXF inside Mule and I have no experience working with CXF alone, 
> so I don't have a way to reproduce this and the wstx-msv-validation module 
> does not have any test that I can use as an example... but the fix was tested 
> from our side and works :)
> NOTE: the problem was detected using CXF 2.3.1 but the relevant code in trunk 
> is still the same.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to