aries-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nicolas Dutertry (JIRA)" <>
Subject [jira] [Created] (ARIES-1793) Blueprint interceptors do not work anymore
Date Thu, 19 Apr 2018 15:04:01 GMT
Nicolas Dutertry created ARIES-1793:

             Summary: Blueprint interceptors do not work anymore
                 Key: ARIES-1793
             Project: Aries
          Issue Type: Bug
          Components: Blueprint
    Affects Versions: blueprint-core-1.9.0
         Environment: Karaf 4.2.0
            Reporter: Nicolas Dutertry
         Attachments: aries-interceptor.patch

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" 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"/>

    <service interface="com.dutertry.test.karaf.jpa.service.TestService" ref="testService"/>
With Karaf 4.1.5 the instance of TestRepository injected in testService is an aries 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
    at ~[?:?]
    at ~[?:?]
    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(
    at com.dutertry.test.karaf.jpa.service.impl.TestServiceImpl.list(
    at com.dutertry.test.karaf.jpa.cmd.ListPersonCommand.execute(
    at org.apache.felix.gogo.runtime.Closure.executeCmd( ~[?:?]
    at org.apache.felix.gogo.runtime.Closure.executeStatement( ~[?:?]
    at org.apache.felix.gogo.runtime.Closure.execute( ~[?:?]
    at org.apache.felix.gogo.runtime.Pipe.doCall( ~[?:?]
    at ~[?:?]
    at ~[?:?]
    at ~[?:?]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(
    at java.util.concurrent.ThreadPoolExecutor$
    at [?:?]{code}

After some investigation, I have found that this bug is due to the resolution of issue ARIES-1544.
I have done a patch (see attached file) which solve the issue I think.


Can you please integrate my patch or correct the issue another way ?

This message was sent by Atlassian JIRA

View raw message