Henryk,
I did not want to use Spring.
I just needed to call the Spring JdbcTemplate in my OSGI pure blueprint
beans.
The Spring JdbcTemplate provides database abstraction that we don't have
with others camel component (sql,jpa,jdbc).
Using Spring DM solves my problem, but that's not want I prefer.
So if you know a way to call a Spring Bean (JdbcTemplate) inside an pure
OSGI bean, i'll pay you a beer :-)
Thanks,
Meissa

2016-01-05 16:28 GMT+01:00 Henryk Konsek <hekon...@gmail.com>:

> To use Spring, you have to stick to Spring DM configuration. Which is not
> maintained anymore. So using Spring in OSGi creates more problem than it
> solves.
>
> If you want to use Spring I recommend dropping OSGi on the behalf of the
> Spring Boot running as fat jar or WAR.
>
> Cheers!
>
> wt., 5.01.2016 o 11:54 użytkownik Meissa Sakho <mbsa...@gmail.com>
> napisał:
>
> > 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
> > >
> >
> --
> Henryk Konsek
> http://about.me/hekonsek
>

Reply via email to