A blueprint file deployed is going to be setup with a
Dynamic-Import: *

Which is pretty expensive for the framework, a bundle with blueprint on your
classpath is going to need the correct imports and exports.

/je
On Jul 30, 2012, at 10:35 AM, Jon Anstey wrote:

> The maven-bundle-plugin won't detect what Camel components you are using
> and make sure those are installed. To do this you will need to use a
> feature for your application
> http://karaf.apache.org/manual/latest-2.2.x/users-guide/provisioning.htmlYou
> can create one something like this:
> 
>    <feature name="myapp" version="${project.version}">
>        <feature>camel-core</feature>
>        <feature>camel-blueprint</feature>
>        <feature>camel-activemq</feature>
>        ...
>        <bundle>mvn:myapp/myapp/${project.version}</bundle>
>    </feature>
> 
> Now, when you install "myapp" feature, all the Camel components you need
> will be installed as well.
> 
> If you want to enforce the various package imports are there at the OSGi
> bundle level, you can always add them in manually with the <Import-Package>
> instruction.
> 
> Cheers,
> Jon
> 
> On Fri, Jul 27, 2012 at 1:41 PM, Ephemeris Lappis <
> [email protected]> wrote:
> 
>> Hello.
>> 
>> It seems that dependencies for a blueprint file depend on the way it is
>> deployed.
>> 
>> In a first step, I directly copy the blueprint XML file to the deploy
>> folder, and it works as expected.
>> 
>> In a second step, I package the same file into a bundle using the felix
>> maven plugin, and deploy the generated JAR into the deploy folder. In this
>> case, an error is produced during the deployment :
>> 
>> java.lang.NoClassDefFoundError: groovy/lang/Script
>> 
>> I've not tested other cases, but I suppose that it may do the same error
>> for
>> other Camel component like it does with groovy in my example.
>> 
>> When I look at the first bundle description in the web console, I can see a
>> list of all the actual dependent modules in the imported packages :
>> 
>> groovy.lang,version=1.8.5 from groovy-all (219)
>> groovyjarjarantlr,version=1.8.5 from groovy-all (219)
>> org.apache.activemq,version=5.5.1 from org.apache.activemq.activemq-core
>> (50)
>> org.apache.camel,version=2.8.5 from org.apache.camel.camel-core (91)
>> org.apache.camel.blueprint,version=2.8.5 from
>> org.apache.camel.camel-blueprint (152)
>> org.apache.camel.impl,version=2.8.5 from org.apache.camel.camel-core (91)
>> org.apache.camel.spi,version=2.8.5 from org.apache.camel.camel-core (91)
>> org.codehaus.groovy.reflection,version=1.8.5 from groovy-all (219)
>> org.codehaus.groovy.runtime.callsite,version=1.8.5 from groovy-all (219)
>> org.osgi.service.blueprint.container,version=1.0.1 from
>> org.apache.aries.blueprint (10)
>> 
>> In the second case, the maven plugin only sets the
>> "org.osgi.service.blueprint" in the imported packages list in the manifest.
>> Indeed, It seems that all the OSGi part of my blueprint is taken into
>> account, but nothing from the camel context... Nothing seems to be done at
>> deployment time to add the camel components dependences...
>> 
>> Where is the error ? Should I do something different to build the JAR with
>> the maven plugin ?
>> 
>> Thanks for you help.
>> 
>> http://servicemix.396122.n5.nabble.com/file/n5714018/camel-context.xml
>> camel-context.xml
>> http://servicemix.396122.n5.nabble.com/file/n5714018/pom.xml pom.xml
>> 
>> 
>> 
>> --
>> View this message in context:
>> http://servicemix.396122.n5.nabble.com/Camel-classpath-using-blueprint-inside-an-OSGi-bundle-tp5714018.html
>> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>> 
> 
> 
> 
> -- 
> Cheers,
> Jon
> ---------------
> FuseSource
> Email: [email protected]
> Web: fusesource.com
> Twitter: jon_anstey
> Blog: http://janstey.blogspot.com
> Author of Camel in Action: http://manning.com/ibsen

Reply via email to