Yesterday I ran into an error with the new Karaf 4.2.0. This error seems to be 
related to blueprint 1.9.0 (the error does not occur in Karaf 4.1.5).

I have committed a project on Github to illustrate the issue : 

This project contains a blueprint bundle with a bean TestRepository annotated 
with @PersistenceContext. This bean is then injected into another bean 
TestServiceImpl which is then published as an osgi service :


    <!-- This bean contains a @PersistenceContext EntityManager -->
    <bean id="testRepository" 

    <bean id="testService" 
        <property name="testRepository" ref="testRepository"/>

    <service interface="com.dutertry.test.karaf.jpa.service.TestService" 

With Karaf 4.1.5 the instance of TestRepository injected in testService is a 
proxy managing JPA stuff, but with Karaf 4.2.0 the injected instance is not a 
proxy. Thus when using testService, the following error occurs :
java.lang.IllegalStateException: Need active coordination

Do you think it is a blueprint bug or is it forbidden to inject a jpa bean into 
another bean in the same blueprint context ?

Nicolas Dutertry
Sopra HR Software - http://www.soprahr.com/

Reply via email to