[jboss-jira] [JBoss JIRA] (WFLY-2532) @Transactional and TransactionPhase does not work

Jens Schumann (JIRA) jira-events at lists.jboss.org
Mon Nov 18 14:09:06 EST 2013


Jens Schumann created WFLY-2532:
-----------------------------------

             Summary: @Transactional and TransactionPhase does not work
                 Key: WFLY-2532
                 URL: https://issues.jboss.org/browse/WFLY-2532
             Project: WildFly
          Issue Type: Feature Request
      Security Level: Public (Everyone can see)
          Components: CDI / Weld, Transactions
    Affects Versions: 8.0.0.CR1
            Reporter: Jens Schumann
            Assignee: Stuart Douglas


This issue is related to the current 8.0.0Beta2-SNAPSHOT, downloaded today. I have been using this snapshot because @Transactional won't work otherwise.

If you use within an @Transactional TX an Transactional observer - e.g. @Observes(during=TransactionPhase.AFTER_COMPLETION - it will fail with an "UserTransaction is not available within the scope of a bean or method annotated with @Transactional and a Transactional.TxType other than NOT_SUPPORTED or NEVER". Look's like an CMT access limitation issue here. Does work with enterprise java beans though.

Full Stacktrace.
javax.faces.el.EvaluationException: java.lang.IllegalStateException: UserTransaction is not available within the scope of a bean or method annotated with @Transactional and a Transactional.TxType other than NOT_SUPPORTED or NEVER
	at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:101)
	at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
	at javax.faces.component.UICommand.broadcast(UICommand.java:315)
	at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:790)
	at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1282)
	at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
	at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
	at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:198)
	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:646)
	at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:87)
	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:130)
	at de.openknowledge.fullstack.jeecrm.presentation.common.NonCachingFilter.doFilter(NonCachingFilter.java:35)
	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:56)
	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:132)
	at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:85)
	at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:59)
	at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
	at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:81)
	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)
	at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:113)
	at io.undertow.security.handlers.AuthenticationCallHandler.handleRequest(AuthenticationCallHandler.java:52)
	at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:45)
	at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:65)
	at io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:70)
	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)
	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)
	at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:239)
	at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:226)
	at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:72)
	at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:145)
	at io.undertow.server.Connectors.executeRootHandler(Connectors.java:139)
	at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:637)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
	at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.IllegalStateException: UserTransaction is not available within the scope of a bean or method annotated with @Transactional and a Transactional.TxType other than NOT_SUPPORTED or NEVER
	at org.jboss.tm.usertx.client.ServerVMClientUserTransaction.testAvailability(ServerVMClientUserTransaction.java:232)
	at org.jboss.tm.usertx.client.ServerVMClientUserTransaction.getStatus(ServerVMClientUserTransaction.java:196)
	at org.jboss.as.weld.services.bootstrap.WeldTransactionServices.isTransactionActive(WeldTransactionServices.java:63)
	at org.jboss.weld.event.TransactionalObserverNotifier.immediateDispatch(TransactionalObserverNotifier.java:53)
	at org.jboss.weld.event.TransactionalObserverNotifier.notifyObserver(TransactionalObserverNotifier.java:45)
	at org.jboss.weld.event.ObserverNotifier.notifyObservers(ObserverNotifier.java:119)
	at org.jboss.weld.event.ObserverNotifier.fireEvent(ObserverNotifier.java:112)
	at org.jboss.weld.event.EventImpl.fire(EventImpl.java:83)
	at xxx.CustomerServiceBean.addCustomer(CustomerServiceBean.java:63)
	at xxx.CustomerServiceBean$Proxy$_$$_WeldClientProxy.addCustomer(Unknown Source)
	at xxx.CreateCustomerBean.addCustomer(CreateCustomerBean.java:43)
	at xxx.CreateCustomerBean$Proxy$_$$_WeldSubclass.addCustomer(Unknown Source)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	at org.jboss.weld.interceptor.proxy.SimpleInterceptionChain.interceptorChainCompleted(SimpleInterceptionChain.java:47)
	at org.jboss.weld.interceptor.chain.AbstractInterceptionChain.invokeNextInterceptor(AbstractInterceptionChain.java:77)
	at org.jboss.weld.interceptor.proxy.InterceptorInvocationContext.proceed(InterceptorInvocationContext.java:146)
	at com.arjuna.ats.jta.cdi.transactional.TransactionalInterceptorBase.invokeInOurTx(TransactionalInterceptorBase.java:71)
	at com.arjuna.ats.jta.cdi.transactional.TransactionalInterceptorRequired.intercept(TransactionalInterceptorRequired.java:52)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	at org.jboss.weld.interceptor.proxy.SimpleMethodInvocation.invoke(SimpleMethodInvocation.java:30)
	at org.jboss.weld.interceptor.chain.AbstractInterceptionChain.invokeNext(AbstractInterceptionChain.java:90)
	at org.jboss.weld.interceptor.chain.AbstractInterceptionChain.invokeNextInterceptor(AbstractInterceptionChain.java:75)
	at org.jboss.weld.interceptor.proxy.InterceptorMethodHandler.executeInterception(InterceptorMethodHandler.java:48)
	at org.jboss.weld.interceptor.proxy.InterceptorMethodHandler.invoke(InterceptorMethodHandler.java:41)
	at org.jboss.weld.bean.proxy.CombinedInterceptorAndDecoratorStackMethodHandler.invoke(CombinedInterceptorAndDecoratorStackMethodHandler.java:53)
	at xxxx.CreateCustomerBean$Proxy$_$$_WeldSubclass.addCustomer(Unknown Source)
	at xxxx.CreateCustomerBean$Proxy$_$$_WeldClientProxy.addCustomer(Unknown Source)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	at javax.el.ELUtil.invokeMethod(ELUtil.java:326)
	at javax.el.BeanELResolver.invoke(BeanELResolver.java:536)
	at javax.el.CompositeELResolver.invoke(CompositeELResolver.java:256)
	at com.sun.el.parser.AstValue.invoke(AstValue.java:269)
	at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:304)
	at org.jboss.weld.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:40)
	at org.jboss.weld.el.WeldMethodExpression.invoke(WeldMethodExpression.java:50)
	at org.jboss.weld.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:40)
	at org.jboss.weld.el.WeldMethodExpression.invoke(WeldMethodExpression.java:50)
	at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105)
	at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:87)
	... 34 more


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the jboss-jira mailing list