camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Gies <andr...@wayofquality.de>
Subject Re: Camel resources URI into OSGi environment
Date Tue, 16 Jul 2013 07:50:02 GMT
Depending on how you start your OSGi container, you can always add the
configuration for remote debugging to your launcher script.
For my own development I have written a small wrapper around Pax Exam that
uses a container.properties file to set the JVM's runtime
paramaters (incl. debugging). For inspiration you can have a look at

https://github.com/atooni/de.woq.osgi.java/blob/master/de.woq.osgi.java.lau
ncher/src/main/java/de/woq/osgi/java/container/Main.java

For me that works very well and I use pax-runner composites to keep my
container profiles around.

Best regards 
Andreas




Am 7/16/13(29) 9:41 AM schrieb "Cristiano Costantini" unter
<cristiano.costantini@gmail.com>:

>Hi Claus and thank you,
>
>the XSL file is on the "src/main/resources/test" folder, and in the same
>folder there is the velocity template.
>
>I've tried to add <Export-Package>test</Export-Package> to maven bundle
>plugin but nothing changed.
>Is this the correct way to export it?
>
>also it's weird the velocity template on the same folder is found without
>exporting explicitly the package, I expect I would have the same issue
>with
>it.
>
>The exception is caused on class ResourceHelper  ==>
>
>Caused by: java.io.FileNotFoundException: Cannot find resource in
>classpath
>for URI: vm\test.xsl
>        at
>org.apache.camel.util.ResourceHelper.resolveMandatoryResourceAsInputStream
>(ResourceHelper.java:106)
>        at
>org.apache.camel.builder.xml.XsltUriResolver.resolve(XsltUriResolver.java:
>81)
>
>I will try to check the code of ResourceHelper but I don't know how to
>debug when using OSGI (yet).
>
>thank you,
>
>Cristiano
>
>
>
>
>
>2013/7/16 Claus Ibsen <claus.ibsen@gmail.com>
>
>> If the xsl file is in the classpath of your own bundle, then you need
>> to export this package. Looks like you put it in a test package.
>>
>> On Tue, Jul 16, 2013 at 9:27 AM, Cristiano Costantini
>> <cristiano.costantini@gmail.com> wrote:
>> > I must update my previous question:
>> > velocity in facts works fine, it is just xslt which causing issues!
>> >
>> > My test route is in fact:
>> > <route id="testRoute">
>> > <from uri="timer://myTimer?period=5000" />
>> > <setBody>
>> > <constant>Foo</constant>
>> > </setBody>
>> > <to uri="velocity://test/test.vm" />
>> > <to uri="xslt://test/test.xsl" />
>> > <to uri="log:foo" />
>> > </route>
>> >
>> > the velocity: endpoint works, it is the xslt: which fail...
>> > I'm able to run it if I use the full path for just the XSL file:
>> >
>> > <route id="testRoute">
>> > <from uri="timer://myTimer?period=5000" />
>> > <setBody>
>> > <constant>Foo</constant>
>> > </setBody>
>> > <to uri="velocity://test/test.vm" />
>> > <to
>> >
>> 
>>uri="xslt://file:///C:/dev/Sandbox/osgi-deploy-test/src/main/resources/te
>>st/test.xsl"
>> > />
>> > <to uri="log:foo" />
>> > </route>
>> >
>> > Anyone has any suggestion on how to address this problem?
>> >
>> > My only suspect is that when I run from eclipse a simple java class
>>with
>> a
>> > main(String[] args) method where I start a
>>  ConfigurableApplicationContext)
>> > where it works, and when I deploy on OSGi, I'm actually using two
>> different
>> > XSLT processors, but I'm not sure how to debug it...
>> >
>> > thank you again,
>> >
>> > Cristiano
>> >
>> >
>> >
>> >
>> > 2013/7/16 Cristiano Costantini <cristiano.costantini@gmail.com>
>> >
>> >> Hello,
>> >>
>> >> I just tried to deploy my camel routes into an OSGi environment
>> >> (ServiceMix).
>> >>
>> >> I've made a simple maven project with just resources (the beans.xml,
>> .xsl
>> >> and .vm files),
>> >> however the XSLT and Velocity endpoints cannot find the associated
>> files (
>> >> with exception "Failed to resolve endpoint: xslt://testTransform.xsl
>>due
>> >> to: java.io.FileNotFoundException: Cannot find resource in classpath
>>for
>> >> URI: testTransform.xsl").
>> >>
>> >> If I run the route locally (in a simple java console application)
>> >> everything works fine.
>> >>
>> >> Anyone has experience on this type of deployment and can give me some
>> hint?
>> >>
>> >> Thank you,
>> >> Cristiano
>> >>
>>
>>
>>
>> --
>> Claus Ibsen
>> -----------------
>> Red Hat, Inc.
>> Email: cibsen@redhat.com
>> Twitter: davsclaus
>> Blog: http://davsclaus.com
>> Author of Camel in Action: http://www.manning.com/ibsen
>>



Mime
View raw message