[ https://issues.apache.org/jira/browse/ARIES-1715?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16178887#comment-16178887 ]
Daniel Estermann commented on ARIES-1715: ----------------------------------------- Correct me if I'm wrong, but Aires should behave in the same way like Java EE components behave. The usage of an EntityManager in a method annotated with @PostConstruct works for example with EJBs on JBoss AS 7.1. That's why I consider it as a bug. > Blueprint doesn't apply interceptors for the init-method. > --------------------------------------------------------- > > Key: ARIES-1715 > URL: https://issues.apache.org/jira/browse/ARIES-1715 > Project: Aries > Issue Type: Bug > Components: Blueprint > Affects Versions: blueprint-core-1.8.2, blueprint-core-1.8.0 > Reporter: Daniel Estermann > Assignee: Dominik Przybysz > > Trying to use an injected entity manager in an init-method results in the > following exception: > {code} > 2017-04-12T18:10:24,453 | ERROR | Blueprint Extender: 3 | > BlueprintContainerImpl | 12 - org.apache.aries.blueprint.core - > 1.8.0 | Unable to start blueprint container for bundle > abc.pcta-test/1.0.0.SNAPSHOT > org.osgi.service.blueprint.container.ComponentDefinitionException: Unable to > initialize bean testBean > at > org.apache.aries.blueprint.container.BeanRecipe.runBeanProcInit(BeanRecipe.java:738) > [12:org.apache.aries.blueprint.core:1.8.0] > at > org.apache.aries.blueprint.container.BeanRecipe.internalCreate2(BeanRecipe.java:848) > [12:org.apache.aries.blueprint.core:1.8.0] > at > org.apache.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:811) > [12:org.apache.aries.blueprint.core:1.8.0] > at > org.apache.aries.blueprint.di.AbstractRecipe$1.call(AbstractRecipe.java:79) > [12:org.apache.aries.blueprint.core:1.8.0] > at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?] > at > org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:88) > [12:org.apache.aries.blueprint.core:1.8.0] > at > org.apache.aries.blueprint.container.BlueprintRepository.createInstances(BlueprintRepository.java:255) > [12:org.apache.aries.blueprint.core:1.8.0] > at > org.apache.aries.blueprint.container.BlueprintRepository.createAll(BlueprintRepository.java:186) > [12:org.apache.aries.blueprint.core:1.8.0] > at > org.apache.aries.blueprint.container.BlueprintContainerImpl.instantiateEagerComponents(BlueprintContainerImpl.java:725) > [12:org.apache.aries.blueprint.core:1.8.0] > at > org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:412) > [12:org.apache.aries.blueprint.core:1.8.0] > at > org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:277) > [12:org.apache.aries.blueprint.core:1.8.0] > at > java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?] > at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?] > at > org.apache.aries.blueprint.container.ExecutorServiceWrapper.run(ExecutorServiceWrapper.java:106) > [12:org.apache.aries.blueprint.core:1.8.0] > at > org.apache.aries.blueprint.utils.threading.impl.DiscardableRunnable.run(DiscardableRunnable.java:48) > [12:org.apache.aries.blueprint.core:1.8.0] > at > java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?] > at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?] > at > java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) > [?:?] > at > java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) > [?:?] > at > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) > [?:?] > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) > [?:?] > at java.lang.Thread.run(Thread.java:745) [?:?] > Caused by: 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.$Proxy80.persist(Unknown Source) ~[?:?] > at Proxya9d42525_1701_4ce9_bbc8_809ae15cb353.persist(Unknown Source) > ~[?:?] > at abc.pcta_test.TestBean.init(TestBean.java:28) ~[?:?] > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > ~[?:?] > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > ~[?:?] > at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?] > at > org.apache.aries.blueprint.utils.ReflectionUtils.invoke(ReflectionUtils.java:299) > ~[?:?] > at > org.apache.aries.blueprint.container.BeanRecipe.invoke(BeanRecipe.java:980) > ~[?:?] > at > org.apache.aries.blueprint.container.BeanRecipe.runBeanProcInit(BeanRecipe.java:736) > ~[?:?] > ... 21 more > {code} > The following example bundle can be used to reproduce it: > https://github.com/Smasherr/postconstruct-transactional-test -- This message was sent by Atlassian JIRA (v6.4.14#64029)