You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Michael Szalay <mi...@basis06.ch> on 2012/04/19 10:54:18 UTC

Camel XSLT Problem

Hi all

Because of bug https://issues.apache.org/jira/browse/CAMEL-4913 I tried to migrate
from Camel 2.8.4 to Camel 2.9.2.

Now, all my "xslt:"-endpoints do not work anymore. We load the xslt as a resource
from classpath, i.e. "xslt:com.mycompany/test.xsl".

This worked in 2.8.4, but does not work in 2.9.2 anymore.

Caused by: java.io.FileNotFoundException: Cannot find resource in classpath for URI: com.mycompany/test.xsl
        at org.apache.camel.util.ResourceHelper.resolveMandatoryResourceAsUrl(ResourceHelper.java:122)
        at org.apache.camel.component.xslt.XsltEndpoint.loadResource(XsltEndpoint.java:67)
        at org.apache.camel.component.xslt.XsltEndpoint.<init>(XsltEndpoint.java:51)
        at org.apache.camel.component.xslt.XsltComponent.createEndpoint(XsltComponent.java:131)
        at org.apache.camel.impl.DefaultComponent.createEndpoint(DefaultComponent.java:91)
        at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:437)

Has anything changed in the resource loading from Camel 2.8.4 to 2.9.2?

Regards Michael

-- 
Michael Szalay
Senior Software Engineer

basis06 AG, Birkenweg 61, CH-3013 Bern - Fon +41 31 311 32 22
http://www.basis06.ch - source of smart business 

Re: Camel XSLT Problem

Posted by Willem Jiang <wi...@gmail.com>.
Can you fill a JIRA and submit a simple test case to reproduce the 
error?
It could be helpful for us to trace the issue.

On Thu Apr 19 22:05:46 2012, Michael Szalay wrote:
> Now there is the same error, the message is
>
> Caused by: java.io.FileNotFoundException: Cannot find resource in classpath for URI: com/mycompany/test.xsl
>            at org.apache.camel.util.ResourceHelper.resolveMandatoryResourceAsUrl(ResourceHelper.java:122)
>            at org.apache.camel.component.xslt.XsltEndpoint.loadResource(XsltEndpoint.java:67)
>            at org.apache.camel.component.xslt.XsltEndpoint.<init>(XsltEndpoint.java:51)
>            at org.apache.camel.component.xslt.XsltComponent.createEndpoint(XsltComponent.java:131)
>            at org.apache.camel.impl.DefaultComponent.createEndpoint(DefaultComponent.java:91)
>            at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:437)
>
> For my point of view, it really should by com.mycompany/test.xsl, because the directory in the src/main/resources is called com.mycompany...
>
>
> Regards Michael
>



--
Willem
----------------------------------
CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com
FuseSource
Web: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)
         http://jnn.javaeye.com (Chinese)
Twitter: willemjiang
Weibo: willemjiang


Re: Camel XSLT Problem

Posted by Claus Ibsen <cl...@gmail.com>.
On Thu, Apr 19, 2012 at 4:05 PM, Michael Szalay
<mi...@basis06.ch> wrote:
> Now there is the same error, the message is
>
> Caused by: java.io.FileNotFoundException: Cannot find resource in classpath for URI: com/mycompany/test.xsl
>          at org.apache.camel.util.ResourceHelper.resolveMandatoryResourceAsUrl(ResourceHelper.java:122)
>          at org.apache.camel.component.xslt.XsltEndpoint.loadResource(XsltEndpoint.java:67)
>          at org.apache.camel.component.xslt.XsltEndpoint.<init>(XsltEndpoint.java:51)
>          at org.apache.camel.component.xslt.XsltComponent.createEndpoint(XsltComponent.java:131)
>          at org.apache.camel.impl.DefaultComponent.createEndpoint(DefaultComponent.java:91)
>          at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:437)
>
> For my point of view, it really should by com.mycompany/test.xsl, because the directory in the src/main/resources is called com.mycompany...
>

Don't use dots in directories which is in the classpath, this is just
asking for trouble!
When resources is loaded from classpath, dots is interpreated as separators.


>
> Regards Michael
>
> --
> Michael Szalay
> Senior Software Engineer
>
> basis06 AG, Birkenweg 61, CH-3013 Bern - Fon +41 31 311 32 22
> http://www.basis06.ch - source of smart business
>
> ----- Ursprüngliche Mail -----
> Von: "Willem Jiang" <wi...@gmail.com>
> An: users@camel.apache.org
> Gesendet: Donnerstag, 19. April 2012 15:49:55
> Betreff: Re: Camel XSLT Problem
>
> XsltComponent was moved the camel-core from camel-spring since Camel
> 2.9.0.
> But I don't think it break the resource loading from class path.
> Can you try to use the uri like this ?
>  "xslt:com/mycompany/test.xsl".
>
> On Thu Apr 19 16:54:18 2012, Michael Szalay wrote:
>> Hi all
>>
>> Because of bug https://issues.apache.org/jira/browse/CAMEL-4913 I tried to migrate
>> from Camel 2.8.4 to Camel 2.9.2.
>>
>> Now, all my "xslt:"-endpoints do not work anymore. We load the xslt as a resource
>> from classpath, i.e. "xslt:com.mycompany/test.xsl".
>>
>> This worked in 2.8.4, but does not work in 2.9.2 anymore.
>>
>> Caused by: java.io.FileNotFoundException: Cannot find resource in classpath for URI: com.mycompany/test.xsl
>>          at org.apache.camel.util.ResourceHelper.resolveMandatoryResourceAsUrl(ResourceHelper.java:122)
>>          at org.apache.camel.component.xslt.XsltEndpoint.loadResource(XsltEndpoint.java:67)
>>          at org.apache.camel.component.xslt.XsltEndpoint.<init>(XsltEndpoint.java:51)
>>          at org.apache.camel.component.xslt.XsltComponent.createEndpoint(XsltComponent.java:131)
>>          at org.apache.camel.impl.DefaultComponent.createEndpoint(DefaultComponent.java:91)
>>          at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:437)
>>
>> Has anything changed in the resource loading from Camel 2.8.4 to 2.9.2?
>>
>> Regards Michael
>>
>
>
>
> --
> Willem
> ----------------------------------
> CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com
> FuseSource
> Web: http://www.fusesource.com
> Blog:    http://willemjiang.blogspot.com (English)
>         http://jnn.javaeye.com (Chinese)
> Twitter: willemjiang
> Weibo: willemjiang



-- 
Claus Ibsen
-----------------
CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Re: Camel XSLT Problem

Posted by Michael Szalay <mi...@basis06.ch>.
Now there is the same error, the message is 

Caused by: java.io.FileNotFoundException: Cannot find resource in classpath for URI: com/mycompany/test.xsl
          at org.apache.camel.util.ResourceHelper.resolveMandatoryResourceAsUrl(ResourceHelper.java:122)
          at org.apache.camel.component.xslt.XsltEndpoint.loadResource(XsltEndpoint.java:67)
          at org.apache.camel.component.xslt.XsltEndpoint.<init>(XsltEndpoint.java:51)
          at org.apache.camel.component.xslt.XsltComponent.createEndpoint(XsltComponent.java:131)
          at org.apache.camel.impl.DefaultComponent.createEndpoint(DefaultComponent.java:91)
          at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:437)

For my point of view, it really should by com.mycompany/test.xsl, because the directory in the src/main/resources is called com.mycompany...


Regards Michael

-- 
Michael Szalay
Senior Software Engineer

basis06 AG, Birkenweg 61, CH-3013 Bern - Fon +41 31 311 32 22
http://www.basis06.ch - source of smart business 

----- Ursprüngliche Mail -----
Von: "Willem Jiang" <wi...@gmail.com>
An: users@camel.apache.org
Gesendet: Donnerstag, 19. April 2012 15:49:55
Betreff: Re: Camel XSLT Problem

XsltComponent was moved the camel-core from camel-spring since Camel 
2.9.0.
But I don't think it break the resource loading from class path.
Can you try to use the uri like this ?
 "xslt:com/mycompany/test.xsl".

On Thu Apr 19 16:54:18 2012, Michael Szalay wrote:
> Hi all
>
> Because of bug https://issues.apache.org/jira/browse/CAMEL-4913 I tried to migrate
> from Camel 2.8.4 to Camel 2.9.2.
>
> Now, all my "xslt:"-endpoints do not work anymore. We load the xslt as a resource
> from classpath, i.e. "xslt:com.mycompany/test.xsl".
>
> This worked in 2.8.4, but does not work in 2.9.2 anymore.
>
> Caused by: java.io.FileNotFoundException: Cannot find resource in classpath for URI: com.mycompany/test.xsl
>          at org.apache.camel.util.ResourceHelper.resolveMandatoryResourceAsUrl(ResourceHelper.java:122)
>          at org.apache.camel.component.xslt.XsltEndpoint.loadResource(XsltEndpoint.java:67)
>          at org.apache.camel.component.xslt.XsltEndpoint.<init>(XsltEndpoint.java:51)
>          at org.apache.camel.component.xslt.XsltComponent.createEndpoint(XsltComponent.java:131)
>          at org.apache.camel.impl.DefaultComponent.createEndpoint(DefaultComponent.java:91)
>          at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:437)
>
> Has anything changed in the resource loading from Camel 2.8.4 to 2.9.2?
>
> Regards Michael
>



--
Willem
----------------------------------
CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com
FuseSource
Web: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)
         http://jnn.javaeye.com (Chinese)
Twitter: willemjiang
Weibo: willemjiang

Re: Camel XSLT Problem

Posted by Willem Jiang <wi...@gmail.com>.
XsltComponent was moved the camel-core from camel-spring since Camel 
2.9.0.
But I don't think it break the resource loading from class path.
Can you try to use the uri like this ?
 "xslt:com/mycompany/test.xsl".

On Thu Apr 19 16:54:18 2012, Michael Szalay wrote:
> Hi all
>
> Because of bug https://issues.apache.org/jira/browse/CAMEL-4913 I tried to migrate
> from Camel 2.8.4 to Camel 2.9.2.
>
> Now, all my "xslt:"-endpoints do not work anymore. We load the xslt as a resource
> from classpath, i.e. "xslt:com.mycompany/test.xsl".
>
> This worked in 2.8.4, but does not work in 2.9.2 anymore.
>
> Caused by: java.io.FileNotFoundException: Cannot find resource in classpath for URI: com.mycompany/test.xsl
>          at org.apache.camel.util.ResourceHelper.resolveMandatoryResourceAsUrl(ResourceHelper.java:122)
>          at org.apache.camel.component.xslt.XsltEndpoint.loadResource(XsltEndpoint.java:67)
>          at org.apache.camel.component.xslt.XsltEndpoint.<init>(XsltEndpoint.java:51)
>          at org.apache.camel.component.xslt.XsltComponent.createEndpoint(XsltComponent.java:131)
>          at org.apache.camel.impl.DefaultComponent.createEndpoint(DefaultComponent.java:91)
>          at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:437)
>
> Has anything changed in the resource loading from Camel 2.8.4 to 2.9.2?
>
> Regards Michael
>



--
Willem
----------------------------------
CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com
FuseSource
Web: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)
         http://jnn.javaeye.com (Chinese)
Twitter: willemjiang
Weibo: willemjiang