FAQ
Hello.

I'd like to make a bundle using both Blueprint and spring, with these
reasons :
1) Blueprint : using the OSGi configuration for a property place-holder
based on OSGi configuration service, exposing services and referencing, set
Camel routes, etc.
2) Spring : using the framework's DI : autowiring of components, values
injection, for building plain java code, like the services implementations.

First problem : Blueprint seems to start before the Spring context is
detected in META-INF/spring/, and thus beans defined in Spring seem not to
be available for Blueprint services. Is it true ?

Second problem : The Spring context doesn't see the Blueprint property place
holder (I've tried to make a reference on the same id and implicitly), and
it seems we need to declare twice : once in Blueprint
(cm:property-placeholder) and once in Spring (osgix:cm-properties and
context:property-placeholder).

Any advice or help ?

Thanks.

Regards.



--
View this message in context: http://servicemix.396122.n5.nabble.com/Mix-blueprint-and-spring-in-the-same-bundle-tp5723320.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Search Discussions

  • Achim Nierbeck at Dec 29, 2015 at 11:50 am
    Hi,

    per se this doesn't work, for that you usually need to have spring-dm
    running.
    BUT, there is some work done on the aries blueprint to also support spring
    and to have both spring and blueprint work nicely together. But this is
    still snapshot, so you might want to try that and give some feedback to the
    aries community
    about how good it works and if it needs still some improvements.

    regards, Achim


    2015-12-29 12:00 GMT+01:00 Ephemeris Lappis <ephemeris.lappis@gmail.com>:
    Hello.

    I'd like to make a bundle using both Blueprint and spring, with these
    reasons :
    1) Blueprint : using the OSGi configuration for a property place-holder
    based on OSGi configuration service, exposing services and referencing, set
    Camel routes, etc.
    2) Spring : using the framework's DI : autowiring of components, values
    injection, for building plain java code, like the services implementations.

    First problem : Blueprint seems to start before the Spring context is
    detected in META-INF/spring/, and thus beans defined in Spring seem not to
    be available for Blueprint services. Is it true ?

    Second problem : The Spring context doesn't see the Blueprint property
    place
    holder (I've tried to make a reference on the same id and implicitly), and
    it seems we need to declare twice : once in Blueprint
    (cm:property-placeholder) and once in Spring (osgix:cm-properties and
    context:property-placeholder).

    Any advice or help ?

    Thanks.

    Regards.



    --
    View this message in context:
    http://servicemix.396122.n5.nabble.com/Mix-blueprint-and-spring-in-the-same-bundle-tp5723320.html
    Sent from the ServiceMix - User mailing list archive at Nabble.com.


    --

    Apache Member
    Apache Karaf <http://karaf.apache.org/> Committer & PMC
    OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
    Project Lead
    blog <http://notizblog.nierbeck.de/>
    Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>

    Software Architect / Project Manager / Scrum Master
  • Ephemeris Lappis at Dec 29, 2015 at 12:43 pm
    Hello.

    Thanks for your answer.

    I've done some tests on SMX V 6.0.0, and it seems to wrork more or less as
    I'd like to.

    Here is the Spring context, that just build one service upon a bean. This
    bean uses use many injections and autowiring with other classes. The service
    interface is a Camel processor extension...



    Next, the Blueprint resolving the service, and setting a Camel context with
    a route that uses the processor.



    All seems to work, but I'd like to avoid the double declaration of the
    property place holder. Any idea ?

    Thanks again.

    Regards.



    --
    View this message in context: http://servicemix.396122.n5.nabble.com/Mix-blueprint-and-spring-in-the-same-bundle-tp5723320p5723322.html
    Sent from the ServiceMix - User mailing list archive at Nabble.com.
  • Achim Nierbeck at Dec 31, 2015 at 12:09 pm
    Hi,

    this won't work, as two different contexts take care of this.
    Again, as I said before. At the Apache Aries Project there is some work
    done to make it easier to use blueprint and Spring within the same bundle.

    regards, Achim


    2015-12-29 13:43 GMT+01:00 Ephemeris Lappis <ephemeris.lappis@gmail.com>:
    Hello.

    Thanks for your answer.

    I've done some tests on SMX V 6.0.0, and it seems to wrork more or less as
    I'd like to.

    Here is the Spring context, that just build one service upon a bean. This
    bean uses use many injections and autowiring with other classes. The
    service
    interface is a Camel processor extension...



    Next, the Blueprint resolving the service, and setting a Camel context with
    a route that uses the processor.



    All seems to work, but I'd like to avoid the double declaration of the
    property place holder. Any idea ?

    Thanks again.

    Regards.



    --
    View this message in context:
    http://servicemix.396122.n5.nabble.com/Mix-blueprint-and-spring-in-the-same-bundle-tp5723320p5723322.html
    Sent from the ServiceMix - User mailing list archive at Nabble.com.


    --

    Apache Member
    Apache Karaf <http://karaf.apache.org/> Committer & PMC
    OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
    Project Lead
    blog <http://notizblog.nierbeck.de/>
    Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>

    Software Architect / Project Manager / Scrum Master

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupusers @
categoriesservicemix
postedDec 29, '15 at 11:00a
activeDec 31, '15 at 12:09p
posts4
users2
websiteservicemix.apache.org

People

Translate

site design / logo © 2018 Grokbase