Hi Greg,
I've already reviewed this links above.
You can't define a spring bean inside yous OSGI configuration. It won't
work.
Let me first explain to you why I need to do it.
I need to use the Spring JdbcTemplate component because to leverage the
stored procedure abstraction.
I do that because either the JPA component,sql or jdbc component do not
provide this feature.
I've found another workaround so far.
But if you know a working solution for that (calling a spring bean from a
blueprint), let me know.
Thans,
Meissa

2016-01-04 17:35 GMT+01:00 Greg Autric <gaut...@redhat.com>:

> hi Meissa,
>
>
> Blueprint configuration uses "almost" the same syntax and behavior than
> Spring XML.
> IMHO, I dislike use a mix of spring conf and blueprint conf.
> Your spring configuration should work w/ few modifications into your
> blueprint [1].
>
> [1]
> http://fuseesb.blogspot.fr/2014/10/what-is-differences-between-camel.html
>
> an other useful link :
> http://camel.apache.org/using-osgi-blueprint-with-camel.html
>
> Greg AUTRIC
> JBoss Middleware Consultant
>
> email   : gautric __at__ redhat __dot__ com
> twitter : @gautric_io
>
> Red Hat Global Services
> Red Hat France SARL                sit: http://www.redhat.fr
> Le Linea, 1 rue du General Leclerc, 92047 Paris La Défense Cedex
> Sent from webmail
>
> ----- Mail original -----
> De: "Meissa Sakho" <mbsa...@gmail.com>
> À: users@camel.apache.org
> Envoyé: Mardi 22 Décembre 2015 12:37:29
> Objet: calling a spring bean inside an OSGI based project
>
> Hi all,
> I have created a restfull web service based on apache cxf with camel.
> My endpoint is defined inside my blueprint configuration file like below:
>
> <jaxrs:server id="bwService" address="/booking">
>
>         <jaxrs:serviceBeans>
>
>             <ref component-id="bookingService"/>
>
>         </jaxrs:serviceBeans>
>
>         <jaxrs:providers>
>
>            <bean class=
> "com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider"/>
>
>         </jaxrs:providers>
>
>     </jaxrs:server>
>
>     <cxf:bus>
>
>         <cxf:features>
>
>           <cxf:logging />
>
>         </cxf:features>
>
>     </cxf:bus>
>
>      <bean id="bookingService" class="com.mycompany.BookingService"/>
>
>
> I would like to Inject the Spring JdbcTemplate that I've defined in my
> Spring configuration file to my BookingService business class.
>
> My question is :
>
> How can I a load and inject a Spring bean inside a OSGI based Bean?
>
> Thank you in advance,
>
> Meissa
>

Reply via email to