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 2012/04/26 14:02:24 UTC

[jira] [Commented] (CAMEL-5223) Cannot find resource in classpath using OSGi blueprint

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

Claus Ibsen commented on CAMEL-5223:
------------------------------------

Resource loading works fine for me.

I moved the XML file into the src/main/resources/OSGI-INF/blueprint directory, which is the standard for blueprint XML files.
I removed the string template endpoint, so the route only did the xstl.

I installed the application on Fuse ESB which supports offically Camel 2.9, and it worked fine
I copied a test file and it was processed and from the shell I can get details
{code}
FuseESB:karaf@root> camel:route-info helloWorld 
Camel Route helloWorld
	Camel Context: 165-camel-3

Properties
		id = helloWorld
		parent = 37fe883b

Statistics
	Exchanges Total: 1
	Exchanges Completed: 1
	Exchanges Failed: 0
	Min Processing Time: 62ms
	Max Processing Time: 62ms
	Mean Processing Time: 62ms
	Total Processing Time: 62ms
	Last Processing Time: 62ms
	Load Avg: 0.00, 0.00, 0.00
	First Exchange Date: 2012-04-26 14:01:03
	Last Exchange Completed Date: 2012-04-26 14:01:03

Definition
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<route id="helloWorld" xmlns="http://camel.apache.org/schema/spring">
    <from uri="file:data/in"/>
    <to uri="xslt:com/basis06/apache/camel/HelloWorld.xslt" id="to1"/>
    <to uri="file:data/out" id="to2"/>
</route>
{code}
                
> Cannot find resource in classpath using OSGi blueprint
> ------------------------------------------------------
>
>                 Key: CAMEL-5223
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5223
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-blueprint
>    Affects Versions: 2.9.2
>         Environment: x86_64 GNU/Linux
> Java 1.6.0_26
> Apache ServiceMix 4.4.1
>            Reporter: Tobias Hofer
>             Fix For: 2.9.3, 2.10.0
>
>         Attachments: test-classpath-resource.tar.gz
>
>
> I switched from Apache Camel version 2.8.4 (in ServiceMix 4.4.1) to the most recent version 2.9.2. Resource loading in 2.8.4 worked well, but not in the named release.
> Find attached a small test case that uses XSLT and String-Template Endpoints. Neither of them can load their resource from the separate bundle.
> # Install Apache ServiceMix 4.4.1
> # Configure ServiceMix to use Apache Camel 2.9.2 (see {{etc/org.apache.karaf.features.cfg}})
> # Start up ServiceMix
> # Install feature 'camel-string-template'
> # Build the attached test project using maven
> # Copy/Link the built artifact into the {{deploy}} folder
> # Copy/Link the route {{src/test/resources/camel-route}} into the {{deploy}} folder
> The XSLT Component tries to load the resource eagerly. Therefore the route will not start and throws the following exception:
> {noformat}
> Caused by: java.io.FileNotFoundException: Cannot find resource in classpath for URI: com/basis06/apache/camel/HelloWorld.xslt
> 	at org.apache.camel.util.ResourceHelper.resolveMandatoryResourceAsUrl(ResourceHelper.java:122)
> 	at org.apache.camel.component.xslt.XsltEndpoint.loadResource(XsltEndpoint.java:67)
> {noformat}
> The same problem exists with the String-Template Component. But this component will fail not until it is called in the route.

--
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