You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by aj...@virginia.edu on 2011/07/28 23:44:16 UTC

Camel, Blueprint, and Velocity

I'm trying to use Velocity in a Blueprint-deployed Camel (v 2.7.1-fuse-00-43) route in SMX 4.4 (from Fusesource), without success. I'm getting ResourceLoader problems like this (full stack traces, etc. available if desired):

After reaching:

<to uri="velocity:velocity/sparql/getcontentmodels.vm"/>

I see the thread properly load the resource into the content cache and then start the Velocity engine with "properties{ class.resource.loader.class= org.apache.camel.component.velocity.CamelVelocityClasspathResourceLoader, resource.loader=file, class, class.resource.loader.description=Camel Velocity Classpath Resource Loader," etc.

only to fail with 

...
org.apache.velocity.exception.VelocityException: Problem instantiating the template loader: org.apache.camel.component.velocity.CamelVelocityClasspathResourceLoader.
...
Caused by: java.lang.ClassNotFoundException: org.apache.camel.component.velocity.CamelVelocityClasspathResourceLoader not found by org.apache.servicemix.bundles.velocity
...

I've noticed this:

http://camel.apache.org/camel-29-jmx-and-reducing-spring-dependency.html

which leads me to think that I may be trying do something that can't currently be done, because the Camel Velocity component is still tied to Spring resource loading. Is it best for me to migrate back to Spring XML and wait for Camel+Blueprint to advance a bit, or is there some way around this, or am I just being thick?

Also, thanks very much to the whole ServiceMix community for a fantastic product! This is the first time (after several months exploring and developing workflows with ServiceMix that I suspect I may have run into an actual limitation in the product, which really impresses me enormously.

---
A. Soroka
Online Library Environment
the University of Virginia Library





Re: Camel, Blueprint, and Velocity

Posted by Johan Edstrom <se...@gmail.com>.
Yep, 

This is unfortunately known and will be worked on for 2.9, and - Thanks!


On Jul 28, 2011, at 3:44 PM, ajs6f@virginia.edu wrote:

> org.apache.camel.component.velocity.CamelVelocityClasspathResourceLoader


Re: Camel, Blueprint, and Velocity

Posted by aj...@virginia.edu.
Thank you-- I didn't realize that!

Am I understanding rightly that I should be able to install the Camel bundles ("camel-core", "camel-velocity", "camel-blueprint", etc.) in 2.8 versions and then uninstall the older bundles in a running container? I understand that so doing should restart any bundles with the older bundles as dependencies and cause them to pick up the new bundles instead.

---
A. Soroka
Online Library Environment
the University of Virginia Library




On Jul 29, 2011, at 2:45 AM, Claus Ibsen wrote:

> Hi
> 
> Velocity loading template files from the classpath should work with
> Camel 2.8 in OSGi blueprint.
> 
> Its listed in the release notes
> http://camel.apache.org/camel-280-release.html
> 
> On Thu, Jul 28, 2011 at 11:44 PM,  <aj...@virginia.edu> wrote:
>> I'm trying to use Velocity in a Blueprint-deployed Camel (v 2.7.1-fuse-00-43) route in SMX 4.4 (from Fusesource), without success. I'm getting ResourceLoader problems like this (full stack traces, etc. available if desired):
>> 
>> After reaching:
>> 
>> <to uri="velocity:velocity/sparql/getcontentmodels.vm"/>
>> 
>> I see the thread properly load the resource into the content cache and then start the Velocity engine with "properties{ class.resource.loader.class= org.apache.camel.component.velocity.CamelVelocityClasspathResourceLoader, resource.loader=file, class, class.resource.loader.description=Camel Velocity Classpath Resource Loader," etc.
>> 
>> only to fail with
>> 
>> ...
>> org.apache.velocity.exception.VelocityException: Problem instantiating the template loader: org.apache.camel.component.velocity.CamelVelocityClasspathResourceLoader.
>> ...
>> Caused by: java.lang.ClassNotFoundException: org.apache.camel.component.velocity.CamelVelocityClasspathResourceLoader not found by org.apache.servicemix.bundles.velocity
>> ...
>> 
>> I've noticed this:
>> 
>> http://camel.apache.org/camel-29-jmx-and-reducing-spring-dependency.html
>> 
>> which leads me to think that I may be trying do something that can't currently be done, because the Camel Velocity component is still tied to Spring resource loading. Is it best for me to migrate back to Spring XML and wait for Camel+Blueprint to advance a bit, or is there some way around this, or am I just being thick?
>> 
>> Also, thanks very much to the whole ServiceMix community for a fantastic product! This is the first time (after several months exploring and developing workflows with ServiceMix that I suspect I may have run into an actual limitation in the product, which really impresses me enormously.
>> 
>> ---
>> A. Soroka
>> Online Library Environment
>> the University of Virginia Library
>> 
>> 
>> 
>> 
>> 
> 
> 
> 
> -- 
> Claus Ibsen
> -----------------
> 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, Blueprint, and Velocity

Posted by aj...@virginia.edu.
Thanks!

I had no trouble installing the newer Camel feature. Then I installed the 2.8 version of camel-blueprint and camel-velocity and removed the servicemix-camel feature and any 2.7-series Camel bundles I found. The Blueprint/Camel router now installs!

I have a follow-up question about design-- another router in my application is now having problems because it uses jbi: Camel URIs. (Without the ServiceMix Camel machinery, there is no support for that URI-type.) The reason it uses jbi: (in only one place) is so that a route in it can be addressed by a servicemix-jms based bundle. (A JMS consumer.)

Is there a best practice to go beyond jbi: URIs in a situation like this? I could eliminate the servicemix-jms based bundle and simply move the JMS connection to the router, but I liked the clean separation of inside-the-bus routing and outside-the-bus connectors that my current design offers. Would it be best to ignore the servicemix-jms component and create a simple Blueprint/Camel router that acts like my current JMS listener? I didn't see anything in the examples that speaks precisely to my case. I'd to make a bundle that does noting but listen to JMS and forward it to a router, but I want to do it in the cleanest way. Perhaps this is not the right way to think about this design?

Thanks for the help so far and for any advice!

---
A. Soroka
Online Library Environment
the University of Virginia Library




On Aug 9, 2011, at 4:01 PM, Jean-Baptiste Onofré wrote:

> Hi,
> 
> If you install the Camel features descriptor:
> 
> features:addurl mvn:org.apache.camel.karaf/apache-camel/2.8.0/xml/features
> features:install camel
> 
> you should be able to use new Camel version. If you don't use it, I advice you to remove servicemix-camel component to avoid overlap.
> 
> Regards
> JB
> 
> On 08/09/2011 09:58 PM, ajs6f@virginia.edu wrote:
>> Thanks for this advice!
>> 
>> I want to try to "upgrade" my Camel plant to take advantage of this fact, but I'm wondering about the version conditions set in the ServiceMix feature manifests. They specify specific versions of Camel, e.g.
>> 
>> <feature name="camel-nmr" version="4.4.0-fuse-00-43" resolver="(obr)">
>>         <feature version="2.7.1-fuse-00-43">camel</feature>
>> etc.
>> 
>> and so forth.
>> 
>> Is it possible for me to load Camel 2.8 and Velocity support therefor without disrupting ServiceMix's machinery?
>> 
>> Can I simply install the appropriate newer bundles alongside their older counterparts and alter the pom.xml of my route-bundle to force it to resolve against the newer versions?
>> 
>> Thanks again!
>> 
>> ---
>> A. Soroka
>> Online Library Environment
>> the University of Virginia Library
>> 
>> 
>> 
>> 
>> On Jul 29, 2011, at 2:45 AM, Claus Ibsen wrote:
>> 
>>> Hi
>>> 
>>> Velocity loading template files from the classpath should work with
>>> Camel 2.8 in OSGi blueprint.
>>> 
>>> Its listed in the release notes
>>> http://camel.apache.org/camel-280-release.html
>>> 
>>> On Thu, Jul 28, 2011 at 11:44 PM,<aj...@virginia.edu>  wrote:
>>>> I'm trying to use Velocity in a Blueprint-deployed Camel (v 2.7.1-fuse-00-43) route in SMX 4.4 (from Fusesource), without success. I'm getting ResourceLoader problems like this (full stack traces, etc. available if desired):
>>>> 
>>>> After reaching:
>>>> 
>>>> <to uri="velocity:velocity/sparql/getcontentmodels.vm"/>
>>>> 
>>>> I see the thread properly load the resource into the content cache and then start the Velocity engine with "properties{ class.resource.loader.class= org.apache.camel.component.velocity.CamelVelocityClasspathResourceLoader, resource.loader=file, class, class.resource.loader.description=Camel Velocity Classpath Resource Loader," etc.
>>>> 
>>>> only to fail with
>>>> 
>>>> ...
>>>> org.apache.velocity.exception.VelocityException: Problem instantiating the template loader: org.apache.camel.component.velocity.CamelVelocityClasspathResourceLoader.
>>>> ...
>>>> Caused by: java.lang.ClassNotFoundException: org.apache.camel.component.velocity.CamelVelocityClasspathResourceLoader not found by org.apache.servicemix.bundles.velocity
>>>> ...
>>>> 
>>>> I've noticed this:
>>>> 
>>>> http://camel.apache.org/camel-29-jmx-and-reducing-spring-dependency.html
>>>> 
>>>> which leads me to think that I may be trying do something that can't currently be done, because the Camel Velocity component is still tied to Spring resource loading. Is it best for me to migrate back to Spring XML and wait for Camel+Blueprint to advance a bit, or is there some way around this, or am I just being thick?
>>>> 
>>>> Also, thanks very much to the whole ServiceMix community for a fantastic product! This is the first time (after several months exploring and developing workflows with ServiceMix that I suspect I may have run into an actual limitation in the product, which really impresses me enormously.
>>>> 
>>>> ---
>>>> A. Soroka
>>>> Online Library Environment
>>>> the University of Virginia Library
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>> 
>>> 
>>> 
>>> --
>>> Claus Ibsen
>>> -----------------
>>> 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/
>> 
> 
> -- 
> Jean-Baptiste Onofré
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com


Re: Camel, Blueprint, and Velocity

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi,

If you install the Camel features descriptor:

features:addurl mvn:org.apache.camel.karaf/apache-camel/2.8.0/xml/features
features:install camel

you should be able to use new Camel version. If you don't use it, I 
advice you to remove servicemix-camel component to avoid overlap.

Regards
JB

On 08/09/2011 09:58 PM, ajs6f@virginia.edu wrote:
> Thanks for this advice!
>
> I want to try to "upgrade" my Camel plant to take advantage of this fact, but I'm wondering about the version conditions set in the ServiceMix feature manifests. They specify specific versions of Camel, e.g.
>
> <feature name="camel-nmr" version="4.4.0-fuse-00-43" resolver="(obr)">
>          <feature version="2.7.1-fuse-00-43">camel</feature>
> etc.
>
> and so forth.
>
> Is it possible for me to load Camel 2.8 and Velocity support therefor without disrupting ServiceMix's machinery?
>
> Can I simply install the appropriate newer bundles alongside their older counterparts and alter the pom.xml of my route-bundle to force it to resolve against the newer versions?
>
> Thanks again!
>
> ---
> A. Soroka
> Online Library Environment
> the University of Virginia Library
>
>
>
>
> On Jul 29, 2011, at 2:45 AM, Claus Ibsen wrote:
>
>> Hi
>>
>> Velocity loading template files from the classpath should work with
>> Camel 2.8 in OSGi blueprint.
>>
>> Its listed in the release notes
>> http://camel.apache.org/camel-280-release.html
>>
>> On Thu, Jul 28, 2011 at 11:44 PM,<aj...@virginia.edu>  wrote:
>>> I'm trying to use Velocity in a Blueprint-deployed Camel (v 2.7.1-fuse-00-43) route in SMX 4.4 (from Fusesource), without success. I'm getting ResourceLoader problems like this (full stack traces, etc. available if desired):
>>>
>>> After reaching:
>>>
>>> <to uri="velocity:velocity/sparql/getcontentmodels.vm"/>
>>>
>>> I see the thread properly load the resource into the content cache and then start the Velocity engine with "properties{ class.resource.loader.class= org.apache.camel.component.velocity.CamelVelocityClasspathResourceLoader, resource.loader=file, class, class.resource.loader.description=Camel Velocity Classpath Resource Loader," etc.
>>>
>>> only to fail with
>>>
>>> ...
>>> org.apache.velocity.exception.VelocityException: Problem instantiating the template loader: org.apache.camel.component.velocity.CamelVelocityClasspathResourceLoader.
>>> ...
>>> Caused by: java.lang.ClassNotFoundException: org.apache.camel.component.velocity.CamelVelocityClasspathResourceLoader not found by org.apache.servicemix.bundles.velocity
>>> ...
>>>
>>> I've noticed this:
>>>
>>> http://camel.apache.org/camel-29-jmx-and-reducing-spring-dependency.html
>>>
>>> which leads me to think that I may be trying do something that can't currently be done, because the Camel Velocity component is still tied to Spring resource loading. Is it best for me to migrate back to Spring XML and wait for Camel+Blueprint to advance a bit, or is there some way around this, or am I just being thick?
>>>
>>> Also, thanks very much to the whole ServiceMix community for a fantastic product! This is the first time (after several months exploring and developing workflows with ServiceMix that I suspect I may have run into an actual limitation in the product, which really impresses me enormously.
>>>
>>> ---
>>> A. Soroka
>>> Online Library Environment
>>> the University of Virginia Library
>>>
>>>
>>>
>>>
>>>
>>
>>
>>
>> --
>> Claus Ibsen
>> -----------------
>> 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/
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Camel, Blueprint, and Velocity

Posted by aj...@virginia.edu.
Thanks for this advice!

I want to try to "upgrade" my Camel plant to take advantage of this fact, but I'm wondering about the version conditions set in the ServiceMix feature manifests. They specify specific versions of Camel, e.g.

<feature name="camel-nmr" version="4.4.0-fuse-00-43" resolver="(obr)">
        <feature version="2.7.1-fuse-00-43">camel</feature>
etc.

and so forth.

Is it possible for me to load Camel 2.8 and Velocity support therefor without disrupting ServiceMix's machinery? 

Can I simply install the appropriate newer bundles alongside their older counterparts and alter the pom.xml of my route-bundle to force it to resolve against the newer versions?

Thanks again!

---
A. Soroka
Online Library Environment
the University of Virginia Library




On Jul 29, 2011, at 2:45 AM, Claus Ibsen wrote:

> Hi
> 
> Velocity loading template files from the classpath should work with
> Camel 2.8 in OSGi blueprint.
> 
> Its listed in the release notes
> http://camel.apache.org/camel-280-release.html
> 
> On Thu, Jul 28, 2011 at 11:44 PM,  <aj...@virginia.edu> wrote:
>> I'm trying to use Velocity in a Blueprint-deployed Camel (v 2.7.1-fuse-00-43) route in SMX 4.4 (from Fusesource), without success. I'm getting ResourceLoader problems like this (full stack traces, etc. available if desired):
>> 
>> After reaching:
>> 
>> <to uri="velocity:velocity/sparql/getcontentmodels.vm"/>
>> 
>> I see the thread properly load the resource into the content cache and then start the Velocity engine with "properties{ class.resource.loader.class= org.apache.camel.component.velocity.CamelVelocityClasspathResourceLoader, resource.loader=file, class, class.resource.loader.description=Camel Velocity Classpath Resource Loader," etc.
>> 
>> only to fail with
>> 
>> ...
>> org.apache.velocity.exception.VelocityException: Problem instantiating the template loader: org.apache.camel.component.velocity.CamelVelocityClasspathResourceLoader.
>> ...
>> Caused by: java.lang.ClassNotFoundException: org.apache.camel.component.velocity.CamelVelocityClasspathResourceLoader not found by org.apache.servicemix.bundles.velocity
>> ...
>> 
>> I've noticed this:
>> 
>> http://camel.apache.org/camel-29-jmx-and-reducing-spring-dependency.html
>> 
>> which leads me to think that I may be trying do something that can't currently be done, because the Camel Velocity component is still tied to Spring resource loading. Is it best for me to migrate back to Spring XML and wait for Camel+Blueprint to advance a bit, or is there some way around this, or am I just being thick?
>> 
>> Also, thanks very much to the whole ServiceMix community for a fantastic product! This is the first time (after several months exploring and developing workflows with ServiceMix that I suspect I may have run into an actual limitation in the product, which really impresses me enormously.
>> 
>> ---
>> A. Soroka
>> Online Library Environment
>> the University of Virginia Library
>> 
>> 
>> 
>> 
>> 
> 
> 
> 
> -- 
> Claus Ibsen
> -----------------
> 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, Blueprint, and Velocity

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Velocity loading template files from the classpath should work with
Camel 2.8 in OSGi blueprint.

Its listed in the release notes
http://camel.apache.org/camel-280-release.html

On Thu, Jul 28, 2011 at 11:44 PM,  <aj...@virginia.edu> wrote:
> I'm trying to use Velocity in a Blueprint-deployed Camel (v 2.7.1-fuse-00-43) route in SMX 4.4 (from Fusesource), without success. I'm getting ResourceLoader problems like this (full stack traces, etc. available if desired):
>
> After reaching:
>
> <to uri="velocity:velocity/sparql/getcontentmodels.vm"/>
>
> I see the thread properly load the resource into the content cache and then start the Velocity engine with "properties{ class.resource.loader.class= org.apache.camel.component.velocity.CamelVelocityClasspathResourceLoader, resource.loader=file, class, class.resource.loader.description=Camel Velocity Classpath Resource Loader," etc.
>
> only to fail with
>
> ...
> org.apache.velocity.exception.VelocityException: Problem instantiating the template loader: org.apache.camel.component.velocity.CamelVelocityClasspathResourceLoader.
> ...
> Caused by: java.lang.ClassNotFoundException: org.apache.camel.component.velocity.CamelVelocityClasspathResourceLoader not found by org.apache.servicemix.bundles.velocity
> ...
>
> I've noticed this:
>
> http://camel.apache.org/camel-29-jmx-and-reducing-spring-dependency.html
>
> which leads me to think that I may be trying do something that can't currently be done, because the Camel Velocity component is still tied to Spring resource loading. Is it best for me to migrate back to Spring XML and wait for Camel+Blueprint to advance a bit, or is there some way around this, or am I just being thick?
>
> Also, thanks very much to the whole ServiceMix community for a fantastic product! This is the first time (after several months exploring and developing workflows with ServiceMix that I suspect I may have run into an actual limitation in the product, which really impresses me enormously.
>
> ---
> A. Soroka
> Online Library Environment
> the University of Virginia Library
>
>
>
>
>



-- 
Claus Ibsen
-----------------
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/