Thanks I will take a look asap (I'm in vacation now ;)).

Regards
JB

On 04/12/2018 02:03 PM, DUTERTRY Nicolas wrote:
> Here is full stack trace :
> 
> java.lang.IllegalStateException: Need active coordination
>       at 
> org.apache.aries.jpa.support.impl.EMSupplierImpl.get(EMSupplierImpl.java:81) 
> ~[?:?]
>       at 
> org.apache.aries.jpa.support.osgi.impl.EmProxy.invoke(EmProxy.java:38) ~[?:?]
>       at com.sun.proxy.$Proxy77.createQuery(Unknown Source) ~[?:?]
>       at Proxy4c2993b8_dc6f_46b4_8e62_524dc0ad05f5.createQuery(Unknown 
> Source) ~[?:?]
>       at 
> com.dutertry.test.karaf.jpa.service.impl.TestRepository.list(TestRepository.java:26)
>  ~[?:?]
>       at 
> com.dutertry.test.karaf.jpa.service.impl.TestServiceImpl.list(TestServiceImpl.java:25)
>  ~[?:?]
>       at 
> com.dutertry.test.karaf.jpa.cmd.ListPersonCommand.execute(ListPersonCommand.java:24)
>  ~[?:?]
>       at 
> org.apache.karaf.shell.impl.action.command.ActionCommand.execute(ActionCommand.java:84)
>  ~[?:?]
>       at 
> org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:68)
>  ~[?:?]
>       at 
> org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:86)
>  ~[?:?]
>       at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:571) 
> ~[?:?]
>       at 
> org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:497) 
> ~[?:?]
>       at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:386) 
> ~[?:?]
>       at org.apache.felix.gogo.runtime.Pipe.doCall(Pipe.java:417) ~[?:?]
>       at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:229) ~[?:?]
>       at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:59) ~[?:?]
>       at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:?]
>       at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>  ~[?:?]
>       at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>  ~[?:?]
>       at java.lang.Thread.run(Thread.java:748) [?:?]
> 
> --
> Nicolas Dutertry
> 
> 
> -----Message d'origine-----
> De : Jean-Baptiste Onofré [mailto:j...@nanthrax.net] 
> Envoyé : jeudi 12 avril 2018 13:51
> À : user@karaf.apache.org
> Objet : Re: Blueprint/JPA : Need active coordination error
> 
> Hi Nicolas,
> 
> I'm surprised it's not a proxy: it should be a Aries Proxy.
> 
> Where the ISE is coming from ?
> 
> Regards
> JB
> 
> On 04/12/2018 01:47 PM, DUTERTRY Nicolas wrote:
>> Hi,
>>
>>  
>>
>> 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 :
>> https://github.com/nicolas-dutertry/test-jpa
>>
>>  
>>
>> 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 :
>>
>>    
>>
>>     <jpa:enable/>
>>
>>     <tx:enable/>
>>
>>    
>>
>>     <!-- This bean contains a @PersistenceContext EntityManager -->
>>
>>     <bean id="testRepository"
>> class="com.dutertry.test.karaf.jpa.service.impl.TestRepository"/>
>>
>>    
>>
>>     <bean id="testService"
>> class="com.dutertry.test.karaf.jpa.service.impl.TestServiceImpl">
>>
>>         <property name="testRepository" ref="testRepository"/>
>>
>>     </bean>
>>
>>    
>>
>>     <service interface="com.dutertry.test.karaf.jpa.service.TestService"
>> ref="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 ?
>>
>>  
>>
>> Regards,
>>
>> --
>>
>> Nicolas Dutertry
>>
>> Sopra HR Software - http://www.soprahr.com/
>>
>>  
>>
> 
> --
> Jean-Baptiste Onofré
> jbono...@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
> 

-- 
Jean-Baptiste Onofré
jbono...@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Reply via email to