Re: [cdi-dev] [javaee-spec users] Re: About Interceptors's enabling
by Jozef Hartinger
If an interceptor is enabled by both @Priority and in beans.xml then:
1) The priority defines the position of the interceptor in the
interceptor chain
2) The position of the interceptor declaration in beans.xml defines the
position of the interceptor in the interceptor chain (which is possibly
different from (1))
Unless I am wrong the spec does not define which of these should take
precedence nor forbids this case. As this case is unspecified I would
consider "calling the interceptor twice" a possible implementation.
Jozef
On 10/18/2013 06:13 PM, Mark Struberg wrote:
> I'd say that's an impl bug.
>
> beans.xml and @Priority only say IF and in which order the interceptor
> is enabled. But it still is there only once.
>
> LieGrue,
> strub
>
>
> ------------------------------------------------------------------------
> *From:* John D. Ament <john.d.ament(a)gmail.com>
> *To:* users(a)javaee-spec.java.net
> *Cc:* Tang Yong <tangyong(a)cn.fujitsu.com>; Pete Muir
> <pete.muir(a)gmail.com>; Bill Shannon <bill.shannon(a)oracle.com>
> *Sent:* Thursday, 17 October 2013, 15:24
> *Subject:* [javaee-spec users] Re: About Interceptors's enabling
>
> I wonder if this is somehow related to an issue I saw pop up on SO
> recently.
>
> Basically, there's an issue where if an interceptor is annotated
> @Priority and listed in beans.xml, it gets invoked twice.
>
> Is this the expected behavior?
>
> John
>
> On Thu, Oct 17, 2013 at 9:12 AM, Pete Muir
> <pmuir(a)bleepbleep.org.uk <mailto:pmuir@bleepbleep.org.uk>> wrote:
> > Hi Tang,
> >
> > I'm afraid I don't quite understand your question :-(
> >
> > Perhaps you could provide a concrete example of what you would
> prefer?
> >
> > Pete
> >
> > On 17 Oct 2013, at 09:03, Tang Yong <tangyong(a)cn.fujitsu.com
> <mailto:tangyong@cn.fujitsu.com>> wrote:
> >
> >> Pete
> >> CC: Bill
> >>
> >> I have a question about Interceptors's enabling.
> >>
> >> The story should come from [1] and [2], and from "5.3 Ordering
> >> Interceptors using the Priority Annotation" of JSR 318.
> >>
> >> "An interceptor bound to a component, a component method, or
> constructor
> >> using interceptor binding may be enabled for the entire
> application by
> >> applying the Priority annotation, along with a priority value,
> on the
> >> interceptor class."
> >>
> >> From another fact, Interceptors are deployment-specific and are
> disabled
> >> by default. Like alternatives, interceptors have to be
> >> enabled by using the CDI deployment descriptor beans.xml of the
> jar.
> >>
> >> Well, if I uses interceptors binding, I will meet two cases,
> >>
> >> 1) I must enable interceptors in beans.xml explicitly if I am
> not ready
> >> to use @Priority.
> >>
> >> 2) Once I uses @Priority, I need to take care of whether to need to
> >> declare interceptors in beans.xml becase this may break/override
> >> invocation order of interceptors.
> >>
> >> Based on such facts, enable interceptors in beans.xml
> explicitly has
> >> brought two different resposibilities for interceptors binding,
> so, for
> >> an user, this has caused some puzzles just as I made a mistake
> in [2].
> >>
> >> My question is that why we can not make "enable interceptors in
> >> beans.xml explicitly" bring *only one* resposibility?
> >>
> >> Thanks
> >> Tang
> >>
> >> [1]:
> >>
> https://java.net/projects/javaee-spec/lists/jsr342-experts/archive/2012-1...
> >> [2]: https://issues.jboss.org/browse/WELD-1528
> >>
> >>
> >> --
> >> ----------------------
> >> Tang Yong
> >> Senior Engineer
> >> GlassFish Committer (OSGi & OSGi-JavaEE)
> >> OSGi Alliance Supporter
> >> Blog: http://osgizone.typepad.com/tangyong/
> >>
> >> Nanjing Fujitsu NanDa Software Tec CO.,LTD
> >> http://www.fujitsu.com/cn/fnst
> >> Tel: +86-25-86630566-8310
> >> Fax: +86-25-83317685
> >> ----------------------
> >>
> >
>
>
11 years, 2 months
EE 7 "component classes supporting injection" and interceptors
by Martin Kouba
Hi all,
today when I walked through EE 7 umbrella spec I found some parts which
indicate that all "component classes supporting injection" (servlets,
JSP tag handlers, ...) must also support
interceptors (if CDI is enabled).
EE.5.24 Support for Dependency Injection
"Therefore, to make injection support more uniform across all Java EE
component types, Java EE containers are required to support field,
method, and constructor injection using the javax.inject.Inject
annotation into all component classes listed in Table EE.5-1 as having
the “Standard” level of injection support, as well as the use of
interceptors for these classes."
EE.5.2.5 Annotations and Injection
"The component classes listed in Table EE.5-1 with support level
“Standard” all support Java EE resource injection, as well as
PostConstruct and PreDestroy callbacks. In addition, if CDI is
enabled—which it is by default—these classes also support CDI injection,
as described in Section EE.5.24, “Support for Dependency Injection”, and
the use of interceptors."
Is my interpretation correct or am I missing something? Actually I doubt
it works correctly on EE 7 containers out there.
M
--
Martin Kouba
JBoss Quality Assurance Engineer
CDI TCK lead
Red Hat, Czech Republic
11 years, 2 months
Error Programmatically injection with extended PersistenceContext
by Janario Oliveira
Hi guys.
I'm having some problems trying to programmatically inject some classes in
my project.
Here an example.
A converter that uses some shared code from an stateful bean:
class Converter {
@Inject
StatefulService statefulService;
public MyEntity converte(String string) {
return statefulService.findById(Integer.valueOf(string));
}
}
@Stateful
class StatefulService {
@PersistenceContext(type = PersistenceContextType.EXTENDED)
EntityManager em;
@TransactionAttribute
public MyEntity findById(Integer id) {
return em.find(MyEntity.class, id);
}
}
When I try to create a Converter instance:
BeanManager beanManager
= (BeanManager)InitialContext.doLookup("java:comp/BeanManager");
Bean<Converter> bean
= (Bean<Converter>)
beanManager.resolve(beanManager.getBeans(Converter.class));
CreationalContext<Converter> ctx =
beanManager.createCreationalContext(bean);
Such as from Dependent context:
Context context = beanManager.getContext(Dependent.class);
Converter c = context.get(bean, ctx);
Or from BeanManager:
Converter c = beanManager.getReference(bean, Converter.class, ctx);
It creates a Converter ok, But if I call any method that results in the
EntityManager(EXTENDED) and I call twice in two different bean the second
one fails because of the extended context.
e.g
Converter c = getConverter();
MyEntity converter = c.converte("1");
Converter c2 = getConverter();
MyEntity converter2 = c2.converte("1");//fails in Converter
Is there a way to programmatically create my beans using the same context?
Below the stacktrace
17:44:41,130 ERROR [org.jboss.as.ejb3.tx.CMTTxInterceptor]
(http--0.0.0.0-8080-2) javax.ejb.EJBTransactionRolledbackException:
JBAS011437: Found extended persistence context in SFSB invocation call
stack but that cannot be used because the transaction already has a
transactional context associated with it. This can be avoided by changing
application code, either eliminate the extended persistence context or the
transactional context. See JPA spec 2.0 section 7.6.3.1. Scoped
persistence unit name=TestWeb-0.0.1-SNAPSHOT.war#JanarioPU, persistence
context already in transaction =ExtendedEntityManager
[TestWeb-0.0.1-SNAPSHOT.war#JanarioPU], extended persistence context
=ExtendedEntityManager [TestWeb-0.0.1-SNAPSHOT.war#JanarioPU].
17:44:41,134 ERROR [org.jboss.ejb3.invocation] (http--0.0.0.0-8080-2)
JBAS014134: EJB Invocation failed on component StatefulService for method
public br.com.janario.testweb.cdi.MyEntity
br.com.janario.testweb.cdi.StatefulService.findById(java.lang.Integer):
javax.ejb.EJBTransactionRolledbackException: JBAS011437: Found extended
persistence context in SFSB invocation call stack but that cannot be used
because the transaction already has a transactional context associated with
it. This can be avoided by changing application code, either eliminate the
extended persistence context or the transactional context. See JPA spec
2.0 section 7.6.3.1. Scoped persistence unit
name=TestWeb-0.0.1-SNAPSHOT.war#JanarioPU, persistence context already in
transaction =ExtendedEntityManager [TestWeb-0.0.1-SNAPSHOT.war#JanarioPU],
extended persistence context =ExtendedEntityManager
[TestWeb-0.0.1-SNAPSHOT.war#JanarioPU].
at
org.jboss.as.ejb3.tx.CMTTxInterceptor.handleInCallerTx(CMTTxInterceptor.java:139)
[jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
at
org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInCallerTx(CMTTxInterceptor.java:204)
[jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
at
org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:306)
[jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
at
org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:190)
[jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
[jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at
org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41)
[jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
[jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at
org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:59)
[jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
[jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at
org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)
[jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]
at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
[jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at
org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:32)
[jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
[jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at
org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45)
[jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]
at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
[jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at
org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
[jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:165)
[jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]
at
org.jboss.as.ee.component.ViewDescription$1.processInvocation(ViewDescription.java:173)
[jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]
at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
[jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at
org.jboss.as.ejb3.component.stateful.StatefulComponentIdInterceptor.processInvocation(StatefulComponentIdInterceptor.java:52)
[jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
[jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at
org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
[jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at
org.jboss.as.ee.component.ProxyInvocationHandler.invoke(ProxyInvocationHandler.java:72)
[jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]
at br.com.janario.testweb.cdi.StatefulService$$$view6.findById(Unknown
Source) [:]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[rt.jar:1.7.0_40]
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
[rt.jar:1.7.0_40]
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[rt.jar:1.7.0_40]
at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_40]
at
org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:264)
[weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at
org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52)
[weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at
org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:137)
[weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at
org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:260)
[weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at
org.jboss.weld.bean.proxy.EnterpriseBeanProxyMethodHandler.invoke(EnterpriseBeanProxyMethodHandler.java:111)
[weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at
org.jboss.weld.bean.proxy.EnterpriseTargetBeanInstance.invoke(EnterpriseTargetBeanInstance.java:56)
[weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at
org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:105)
[weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at
br.com.janario.testweb.cdi.StatefulService$Proxy$_$$_Weld$Proxy$.findById(StatefulService$Proxy$_$$_Weld$Proxy$.java)
[:]
at br.com.janario.testweb.cdi.Converter.converter(Converter.java:11) [:]
at br.com.janario.testweb.cdi.MyService.work(MyService.java:25) [:]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[rt.jar:1.7.0_40]
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
[rt.jar:1.7.0_40]
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[rt.jar:1.7.0_40]
at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_40]
at
org.jboss.as.ee.component.ManagedReferenceMethodInterceptorFactory$ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptorFactory.java:72)
[jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]
at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
[jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at
org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:374)
[jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at
org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:127)
[jboss-as-weld-7.1.1.Final.jar:7.1.1.Final]
at
org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:135)
[jboss-as-weld-7.1.1.Final.jar:7.1.1.Final]
at
org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:36)
[jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]
at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
[jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at
org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)
[jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at
org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:36)
[jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]
at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
[jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at
org.jboss.as.jpa.interceptor.SBInvocationInterceptor.processInvocation(SBInvocationInterceptor.java:47)
[jboss-as-jpa-7.1.1.Final.jar:7.1.1.Final]
at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
[jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at
org.jboss.as.jpa.interceptor.SFSBInvocationInterceptor.processInvocation(SFSBInvocationInterceptor.java:58)
[jboss-as-jpa-7.1.1.Final.jar:7.1.1.Final]
at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
[jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at
org.jboss.as.ejb3.component.stateful.StatefulSessionSynchronizationInterceptor.processInvocation(StatefulSessionSynchronizationInterceptor.java:156)
[jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
[jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at
org.jboss.as.weld.ejb.EjbRequestScopeActivationInterceptor.processInvocation(EjbRequestScopeActivationInterceptor.java:82)
[jboss-as-weld-7.1.1.Final.jar:7.1.1.Final]
at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
[jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at
org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21)
[jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
[jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at
org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
[jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at
org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:53)
[jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]
at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
[jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at
org.jboss.as.ejb3.component.stateful.StatefulComponentInstanceInterceptor.processInvocation(StatefulComponentInstanceInterceptor.java:66)
[jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
[jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at
org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:228)
[jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
at
org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:304)
[jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
at
org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:190)
[jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
[jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at
org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41)
[jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
[jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at
org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:59)
[jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
[jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at
org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)
[jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]
at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
[jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at
org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:32)
[jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
[jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at
org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45)
[jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]
at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
[jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at
org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
[jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:165)
[jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]
at
org.jboss.as.ee.component.ViewDescription$1.processInvocation(ViewDescription.java:173)
[jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]
at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
[jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at
org.jboss.as.ejb3.component.stateful.StatefulComponentIdInterceptor.processInvocation(StatefulComponentIdInterceptor.java:52)
[jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
[jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at
org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
[jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at
org.jboss.as.ee.component.ProxyInvocationHandler.invoke(ProxyInvocationHandler.java:72)
[jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]
at br.com.janario.testweb.cdi.MyService$$$view5.work(Unknown Source) [:]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[rt.jar:1.7.0_40]
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
[rt.jar:1.7.0_40]
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[rt.jar:1.7.0_40]
at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_40]
at
org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:264)
[weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at
org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52)
[weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at
org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:137)
[weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at
org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:260)
[weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at
org.jboss.weld.bean.proxy.EnterpriseBeanProxyMethodHandler.invoke(EnterpriseBeanProxyMethodHandler.java:111)
[weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at
org.jboss.weld.bean.proxy.EnterpriseTargetBeanInstance.invoke(EnterpriseTargetBeanInstance.java:56)
[weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at
org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:105)
[weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at
br.com.janario.testweb.cdi.MyService$Proxy$_$$_Weld$Proxy$.work(MyService$Proxy$_$$_Weld$Proxy$.java)
[:]
at
br.com.janario.testweb.cdi.CdiInjectionTest.work(CdiInjectionTest.java:16)
[:]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[rt.jar:1.7.0_40]
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
[rt.jar:1.7.0_40]
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[rt.jar:1.7.0_40]
at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_40]
at org.apache.el.parser.AstValue.invoke(AstValue.java:262)
[jbossweb-7.0.13.Final.jar:]
at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:278)
[jbossweb-7.0.13.Final.jar:]
at
org.jboss.weld.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:39)
[weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at
org.jboss.weld.el.WeldMethodExpression.invoke(WeldMethodExpression.java:50)
[weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at
com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105)
[jsf-impl-2.1.7-jbossorg-2.jar:]
at
javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)
[jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
at
com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
[jsf-impl-2.1.7-jbossorg-2.jar:]
at javax.faces.component.UICommand.broadcast(UICommand.java:315)
[jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:794)
[jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
at
javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1259)
[jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
at
com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
[jsf-impl-2.1.7-jbossorg-2.jar:]
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
[jsf-impl-2.1.7-jbossorg-2.jar:]
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
[jsf-impl-2.1.7-jbossorg-2.jar:]
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)
[jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329)
[jbossweb-7.0.13.Final.jar:]
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
[jbossweb-7.0.13.Final.jar:]
at
org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:62)
[weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280)
[jbossweb-7.0.13.Final.jar:]
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
[jbossweb-7.0.13.Final.jar:]
at
org.ocpsoft.rewrite.servlet.RewriteFilter.doFilter(RewriteFilter.java:199)
[rewrite-servlet-2.0.5.Final.jar:2.0.5.Final]
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280)
[jbossweb-7.0.13.Final.jar:]
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
[jbossweb-7.0.13.Final.jar:]
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)
[jbossweb-7.0.13.Final.jar:]
at
org.apache.catalina.core.StandardContextValve.__invoke(StandardContextValve.java:161)
[jbossweb-7.0.13.Final.jar:]
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java)
[jbossweb-7.0.13.Final.jar:]
at
org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50)
[jboss-as-jpa-7.1.1.Final.jar:7.1.1.Final]
at
org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153)
[jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155)
[jbossweb-7.0.13.Final.jar:]
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
[jbossweb-7.0.13.Final.jar:]
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
[jbossweb-7.0.13.Final.jar:]
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368)
[jbossweb-7.0.13.Final.jar:]
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)
[jbossweb-7.0.13.Final.jar:]
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671)
[jbossweb-7.0.13.Final.jar:]
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930)
[jbossweb-7.0.13.Final.jar:]
at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_40]
Caused by: javax.ejb.EJBException: JBAS011437: Found extended persistence
context in SFSB invocation call stack but that cannot be used because the
transaction already has a transactional context associated with it. This
can be avoided by changing application code, either eliminate the extended
persistence context or the transactional context. See JPA spec 2.0 section
7.6.3.1. Scoped persistence unit
name=TestWeb-0.0.1-SNAPSHOT.war#JanarioPU, persistence context already in
transaction =ExtendedEntityManager [TestWeb-0.0.1-SNAPSHOT.war#JanarioPU],
extended persistence context =ExtendedEntityManager
[TestWeb-0.0.1-SNAPSHOT.war#JanarioPU].
at
org.jboss.as.jpa.container.ExtendedEntityManager.internalAssociateWithJtaTx(ExtendedEntityManager.java:126)
[jboss-as-jpa-7.1.1.Final.jar:7.1.1.Final]
at
org.jboss.as.jpa.container.SFSBCallStack.pushCall(SFSBCallStack.java:159)
[jboss-as-jpa-7.1.1.Final.jar:7.1.1.Final]
at
org.jboss.as.jpa.interceptor.SFSBInvocationInterceptor.processInvocation(SFSBInvocationInterceptor.java:56)
[jboss-as-jpa-7.1.1.Final.jar:7.1.1.Final]
at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
[jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at
org.jboss.as.ejb3.component.stateful.StatefulSessionSynchronizationInterceptor.processInvocation(StatefulSessionSynchronizationInterceptor.java:156)
[jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
[jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at
org.jboss.as.weld.ejb.EjbRequestScopeActivationInterceptor.processInvocation(EjbRequestScopeActivationInterceptor.java:82)
[jboss-as-weld-7.1.1.Final.jar:7.1.1.Final]
at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
[jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at
org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21)
[jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
[jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at
org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
[jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at
org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:53)
[jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]
at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
[jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at
org.jboss.as.ejb3.component.stateful.StatefulComponentInstanceInterceptor.processInvocation(StatefulComponentInstanceInterceptor.java:66)
[jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
[jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at
org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInCallerTx(CMTTxInterceptor.java:202)
[jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
... 140 more
11 years, 2 months