You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (Jira)" <ji...@apache.org> on 2022/03/26 10:33:00 UTC

[jira] [Commented] (CAMEL-17857) camel-validator: remote xsd import not usable

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

Claus Ibsen commented on CAMEL-17857:
-------------------------------------

Its bad practice IMHO to have remote XSD imports as that makes your app depedent on that remote service being online.

> camel-validator: remote xsd import not usable
> ---------------------------------------------
>
>                 Key: CAMEL-17857
>                 URL: https://issues.apache.org/jira/browse/CAMEL-17857
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-validator
>    Affects Versions: 3.16.0
>            Reporter: Federico Mariani
>            Priority: Minor
>             Fix For: 3.17.0
>
>
> camel-validator concat imports from xsd to the base endpoint, ex.
> {code:java}
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
>             targetNamespace="http://example.org/ord"
>             xmlns="http://example.org/ord"
>             xmlns:prod="http://example.org/prod">
>   <xs:include schemaLocation="https://raw.githubusercontent.com/Croway/test-xsd/main/chapter04ord2.xsd"/>
>   <xs:include schemaLocation="https://raw.githubusercontent.com/Croway/test-xsd/main/chapter04cust.xsd"/>
>   <xs:import namespace="http://example.org/prod"
>                  schemaLocation="https://raw.githubusercontent.com/Croway/test-xsd/main/chapter04prod.xsd"/>
> ...
> {code}
> with a route like 
> {code:java}
> ...
> .toD("validator:https://raw.githubusercontent.com/Croway/test-xsd/main/chapter04ord1.xsd")
> ...
> {code}
> the validator component concat the base endpoint with the import one, for example: _https://raw.githubusercontent.com/Croway/test-xsd/main/https://raw.githubusercontent.com/Croway/test-xsd/main/chapter04prod.xsd _ and the following exception is thrown
> {code}
> Caused by: java.io.FileNotFoundException: https://raw.githubusercontent.com/Croway/test-xsd/main/https:/raw.githubusercontent.com/Croway/test-xsd/main/chapter04ord2.xsd
> 	at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1993)
> 	at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1589)
> 	at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:224)
> 	at org.apache.camel.impl.engine.DefaultResourceResolvers$HttpsResolver$1.getInputStream(DefaultResourceResolvers.java:202)
> ...
> {code}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)