You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Vince Iglehart <vi...@kniferiver.com> on 2016/07/12 16:15:49 UTC

Camel/Karaf Resource for XSLT

Hello,
I am deploying a Camel 2.17.1 integration to Karaf 4.0.5.  I run into the
following error when attempting to perform a bundle:install   -

Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to
resolve endpoint: xslt://xslt/speed.xslt?saxon=true due to:
java.io.FileNotFoundException: Cannot find resource:
classpath:xslt/speed.xslt in classpath for URI: classpath:xslt/speed.xslt
	at
org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:588)[55:org.apache.camel.camel-core:2.17.1]
	at
org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:79)[55:org.apache.camel.camel-core:2.17.1]
	at
org.apache.camel.model.RouteDefinition.resolveEndpoint(RouteDefinition.java:211)[55:org.apache.camel.camel-core:2.17.1]
	at
org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:107)[55:org.apache.camel.camel-core:2.17.1]
	at
org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:113)[55:org.apache.camel.camel-core:2.17.1]
	at
org.apache.camel.model.SendDefinition.resolveEndpoint(SendDefinition.java:62)[55:org.apache.camel.camel-core:2.17.1]
	at
org.apache.camel.model.SendDefinition.createProcessor(SendDefinition.java:56)[55:org.apache.camel.camel-core:2.17.1]
	at
org.apache.camel.model.ProcessorDefinition.makeProcessorImpl(ProcessorDefinition.java:534)[55:org.apache.camel.camel-core:2.17.1]
	at
org.apache.camel.model.ProcessorDefinition.makeProcessor(ProcessorDefinition.java:495)[55:org.apache.camel.camel-core:2.17.1]
	at
org.apache.camel.model.ProcessorDefinition.addRoutes(ProcessorDefinition.java:219)[55:org.apache.camel.camel-core:2.17.1]
	at
org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:1069)[55:org.apache.camel.camel-core:2.17.1]
	... 29 more
Caused by: javax.xml.transform.TransformerException:
java.io.FileNotFoundException: Cannot find resource:
classpath:xslt/speed.xslt in classpath for URI: classpath:xslt/speed.xslt
	at
org.apache.camel.builder.xml.XsltUriResolver.resolve(XsltUriResolver.java:91)[55:org.apache.camel.camel-core:2.17.1]
	at
org.apache.camel.builder.xml.XsltUriResolver.resolve(XsltUriResolver.java:99)[55:org.apache.camel.camel-core:2.17.1]
	at
org.apache.camel.component.xslt.XsltEndpoint.loadResource(XsltEndpoint.java:363)[55:org.apache.camel.camel-core:2.17.1]
	at
org.apache.camel.component.xslt.XsltEndpoint.doStart(XsltEndpoint.java:432)[55:org.apache.camel.camel-core:2.17.1]
	at
org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)[55:org.apache.camel.camel-core:2.17.1]
	at
org.apache.camel.impl.DefaultCamelContext.startService(DefaultCamelContext.java:3269)[55:org.apache.camel.camel-core:2.17.1]
	at
org.apache.camel.impl.DefaultCamelContext.doAddService(DefaultCamelContext.java:1243)[55:org.apache.camel.camel-core:2.17.1]
	at
org.apache.camel.impl.DefaultCamelContext.addService(DefaultCamelContext.java:1204)[55:org.apache.camel.camel-core:2.17.1]
	at
org.apache.camel.impl.DefaultCamelContext.addService(DefaultCamelContext.java:1200)[55:org.apache.camel.camel-core:2.17.1]
	at
org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:584)[55:org.apache.camel.camel-core:2.17.1]
	... 39 more
Caused by: java.io.FileNotFoundException: Cannot find resource:
classpath:xslt/speed.xslt in classpath for URI: classpath:xslt/speed.xslt
	at
org.apache.camel.util.ResourceHelper.resolveMandatoryResourceAsInputStream(ResourceHelper.java:169)[55:org.apache.camel.camel-core:2.17.1]
	at
org.apache.camel.builder.xml.XsltUriResolver.resolve(XsltUriResolver.java:89)[55:org.apache.camel.camel-core:2.17.1]
	... 48 more


The integration runs fine when I run the integration in standalone mode. I
only get the error when trying to deploy to Karaf.  

In my research on trying to fix the problem, I see that many others have run
into this problem.   However, I don't see how to fix the problem. I also see
that there is a class named OsgiClassResolver for Camel. Should I being
using that class?  How would I make use of that class? 




--
View this message in context: http://camel.465427.n5.nabble.com/Camel-Karaf-Resource-for-XSLT-tp5785053.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel/Karaf Resource - XSLT File Not Found

Posted by Vince Iglehart <vi...@kniferiver.com>.
I figured out the problem.  I was using a class that implements
BundleActivator to initialize the Camel context.  However, I needed to use a
blueprint.xml file to setup the Camel Context.  I read on another post that
using Blueprint sets up additional configuration necessary for resources to
be found.  

Also, by using Blueprint instead of implementing BundleActivator, I was able
to solve another problem where the integration was not finding Camel
components outside of camel-core.  I was trying to use SMTP and received the
following error:

No component found with scheme: smtp

Using Blueprint resolved both issues!

I fixed two problems for the price of one.  I should go home now. :-)




--
View this message in context: http://camel.465427.n5.nabble.com/Camel-Karaf-Resource-XSLT-File-Not-Found-tp5785053p5785055.html
Sent from the Camel - Users mailing list archive at Nabble.com.