1 2 Previous Next 20 Replies Latest reply on May 29, 2008 8:54 PM by Peter Maedel

    Transaction is not active with @Create annotation

    Guillaume Jeudy Master

      Hi,


      I am getting the below exception (Transaction is not active) when issuing a query with an EntityManager injected in a stateless session bean from a @Create method on an SFSB:



      2008-03-24 14:13:04,023 DEBUG [org.hibernate.util.JDBCExceptionReporter] Cannot open connection [???]
      
      org.jboss.util.NestedSQLException: Transaction is not active: tx=TransactionImple < ac, BasicAction: afac7f2:10d4:47e7ea58:213 status: ActionStatus.ABORT_ONLY >; - nested throwable: (javax.resource.ResourceException: Transaction is not active: tx=TransactionImple < ac, BasicAction: afac7f2:10d4:47e7ea58:213 status: ActionStatus.ABORT_ONLY >)
      
           at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:94)
      
           at org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider.getConnection(InjectedDataSourceConnectionProvider.java:47)
      
           at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:423)
      
           at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)
      
           at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:139)
      
           at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1547)
      
           at org.hibernate.loader.Loader.doQuery(Loader.java:673)
      
           at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
      
           at org.hibernate.loader.Loader.doList(Loader.java:2220)
      
           at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
      
           at org.hibernate.loader.Loader.list(Loader.java:2099)
      
           at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:378)
      
           at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
      
           at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
      
           at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
      
           at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
      
           at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:64)
      
           at com.archinsurance.rdmservices.stateless.impl.RefDomainInstanceRelServiceImpl.findChildDomRelInstances(RefDomainInstanceRelServiceImpl.java:210)
      
           at com.archinsurance.rdmservices.stateless.impl.RefDomainInstanceRelServiceImpl.findChildDomRelInstances(RefDomainInstanceRelServiceImpl.java:201)
      
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      
           at java.lang.reflect.Method.invoke(Method.java:585)
      
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
      
           at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
      
           at com.archinsurance.rdmservices.interceptors.LoggingInterceptor.intercept(LoggingInterceptor.java:18)
      
           at sun.reflect.GeneratedMethodAccessor685.invoke(Unknown Source)
      
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      
           at java.lang.reflect.Method.invoke(Method.java:585)
      
           at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
      
           at org.jboss.seam.intercept.EJBInvocationContext.proceed(EJBInvocationContext.java:44)
      
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
      
           at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:31)
      
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
      
           at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:46)
      
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
      
           at org.jboss.seam.bpm.BusinessProcessInterceptor.aroundInvoke(BusinessProcessInterceptor.java:49)
      
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
      
           at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
      
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
      
           at org.jboss.seam.persistence.EntityManagerProxyInterceptor.aroundInvoke(EntityManagerProxyInterceptor.java:26)
      
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
      
           at org.jboss.seam.persistence.HibernateSessionProxyInterceptor.aroundInvoke(HibernateSessionProxyInterceptor.java:27)
      
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
      
           at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
      
           at org.jboss.seam.intercept.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:50)
      
           at sun.reflect.GeneratedMethodAccessor684.invoke(Unknown Source)
      
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      
           at java.lang.reflect.Method.invoke(Method.java:585)
      
           at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
      
           at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
      
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      
           at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
      
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      
           at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
      
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      
           at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
      
           at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:195)
      
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      
           at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:95)
      
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      
           at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
      
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      
           at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
      
           at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:110)
      
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      
           at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
      
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      
           at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
      
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      
           at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:240)
      
           at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:210)
      
           at org.jboss.ejb3.stateless.StatelessLocalProxy.invoke(StatelessLocalProxy.java:84)
      
           at $Proxy461.findChildDomRelInstances(Unknown Source)
      
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      
           at java.lang.reflect.Method.invoke(Method.java:585)
      
           at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
      
           at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
      
           at org.jboss.seam.intercept.ClientSideInterceptor$1.proceed(ClientSideInterceptor.java:76)
      
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
      
           at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
      
           at org.jboss.seam.intercept.ClientSideInterceptor.invoke(ClientSideInterceptor.java:54)
      
           at org.javassist.tmp.java.lang.Object_$$_javassist_11.findChildDomRelInstances(Object_$$_javassist_11.java)
      
           at com.archinsurance.rdmservices.stateful.impl.RefDomRelateInstancesActionBean.init(RefDomRelateInstancesActionBean.java:133)
      
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      
           at java.lang.reflect.Method.invoke(Method.java:585)
      
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
      
           at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
      
           at com.archinsurance.rdmservices.interceptors.LoggingInterceptor.intercept(LoggingInterceptor.java:18)
      
           at sun.reflect.GeneratedMethodAccessor685.invoke(Unknown Source)
      
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      
           at java.lang.reflect.Method.invoke(Method.java:585)
      
           at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
      
           at org.jboss.seam.intercept.EJBInvocationContext.proceed(EJBInvocationContext.java:44)
      
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
      
           at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:46)
      
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
      
           at org.jboss.seam.persistence.ManagedEntityIdentityInterceptor.aroundInvoke(ManagedEntityIdentityInterceptor.java:48)
      
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
      
           at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:31)
      
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
      
           at org.jboss.seam.core.ConversationInterceptor.aroundInvoke(ConversationInterceptor.java:65)
      
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
      
           at org.jboss.seam.bpm.BusinessProcessInterceptor.aroundInvoke(BusinessProcessInterceptor.java:49)
      
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
      
           at org.jboss.seam.core.ConversationalInterceptor.aroundInvoke(ConversationalInterceptor.java:43)
      
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
      
           at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
      
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
      
           at org.jboss.seam.persistence.EntityManagerProxyInterceptor.aroundInvoke(EntityManagerProxyInterceptor.java:26)
      
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
      
           at org.jboss.seam.persistence.HibernateSessionProxyInterceptor.aroundInvoke(HibernateSessionProxyInterceptor.java:27)
      
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
      
           at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
      
           at org.jboss.seam.intercept.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:50)
      
           at sun.reflect.GeneratedMethodAccessor684.invoke(Unknown Source)
      
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      
           at java.lang.reflect.Method.invoke(Method.java:585)
      
           at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
      
           at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
      
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      
           at org.jboss.ejb3.entity.ExtendedPersistenceContextPropagationInterceptor.invoke(ExtendedPersistenceContextPropagationInterceptor.java:57)
      
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      
           at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
      
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      
           at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
      
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      
           at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
      
           at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:195)
      
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      
           at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:95)
      
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      
           at org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:83)
      
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      
           at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
      
           at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:110)
      
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      
           at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
      
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      
           at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
      
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      
           at org.jboss.ejb3.stateful.StatefulContainer.localInvoke(StatefulContainer.java:206)
      
           at org.jboss.ejb3.stateful.StatefulLocalProxy.invoke(StatefulLocalProxy.java:119)
      
           at $Proxy403.init(Unknown Source)
      
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      
           at java.lang.reflect.Method.invoke(Method.java:585)
      
           at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
      
           at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
      
           at org.jboss.seam.intercept.ClientSideInterceptor$1.proceed(ClientSideInterceptor.java:76)
      
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
      
           at org.jboss.seam.ejb.RemoveInterceptor.aroundInvoke(RemoveInterceptor.java:41)
      
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
      
           at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
      
           at org.jboss.seam.intercept.ClientSideInterceptor.invoke(ClientSideInterceptor.java:54)
      
           at org.javassist.tmp.java.lang.Object_$$_javassist_15.init(Object_$$_javassist_15.java)
      
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      
           at java.lang.reflect.Method.invoke(Method.java:585)
      
           at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
      
           at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:125)
      
           at org.jboss.seam.Component.callComponentMethod(Component.java:2082)
      
           at org.jboss.seam.Component.callCreateMethod(Component.java:2005)
      
           at org.jboss.seam.Component.newInstance(Component.java:1976)
      
           at org.jboss.seam.Component.getInstance(Component.java:1873)
      
           at org.jboss.seam.Component.getInstance(Component.java:1840)
      
           at org.jboss.seam.Namespace.getComponentInstance(Namespace.java:55)
      
           at org.jboss.seam.Namespace.getComponentInstance(Namespace.java:50)
      
           at org.jboss.seam.el.SeamELResolver.resolveBase(SeamELResolver.java:166)
      
           at org.jboss.seam.el.SeamELResolver.getValue(SeamELResolver.java:53)
      
           at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
      
           at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:64)
      
           at org.jboss.el.parser.AstIdentifier.getValue(AstIdentifier.java:44)
      
           at org.jboss.el.parser.AstValue.getValue(AstValue.java:63)
      
           at org.jboss.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
      
           at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:71)
      
           at javax.faces.component.ValueBindingValueExpressionAdapter.getValue(ValueBindingValueExpressionAdapter.java:102)
      
           at org.richfaces.component.UIListShuttle.getSourceValue(UIListShuttle.java:291)
      
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      
           at java.lang.reflect.Method.invoke(Method.java:585)
      
           at com.sun.facelets.util.DevTools.writeAttributes(DevTools.java:243)
      
           at com.sun.facelets.util.DevTools.writeStart(DevTools.java:287)
      
           at com.sun.facelets.util.DevTools.writeComponent(DevTools.java:192)
      
           at com.sun.facelets.util.DevTools.writeComponent(DevTools.java:210)
      
           at com.sun.facelets.util.DevTools.writeComponent(DevTools.java:210)
      
           at com.sun.facelets.util.DevTools.writeComponent(DevTools.java:210)
      
           at com.sun.facelets.util.DevTools.writeComponent(DevTools.java:210)
      
           at com.sun.facelets.util.DevTools.debugHtml(DevTools.java:107)
      
           at com.sun.facelets.FaceletViewHandler.handleRenderException(FaceletViewHandler.java:692)
      
           at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:660)
      
           at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
      
           at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:216)
      
           at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
      
           at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
      
           at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
      
           at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
      
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
      
           at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
      
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      
           at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
      
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      
           at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
      
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      
           at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
      
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      
           at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
      
           at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
      
           at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
      
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      
           at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
      
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      
           at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
      
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      
           at jcifs.http.NtlmHttpFilter.doFilter(NtlmHttpFilter.java:118)
      
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      
           at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      
           at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
      
           at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
      
           at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
      
           at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
      
           at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
      
           at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      
           at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
      
           at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      
           at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
      
           at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
      
           at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
      
           at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
      
           at java.lang.Thread.run(Thread.java:595)
      
      Caused by: javax.resource.ResourceException: Transaction is not active: tx=TransactionImple < ac, BasicAction: afac7f2:10d4:47e7ea58:213 status: ActionStatus.ABORT_ONLY >
      
           at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:304)
      
           at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:396)
      
           at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:842)
      
           at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:88)
      
           ... 242 more
      
      2008-03-24 14:13:04,038 WARN  [org.hibernate.util.JDBCExceptionReporter] SQL Error: 0, SQLState: null
      
      2008-03-24 14:13:04,038 ERROR [org.hibernate.util.JDBCExceptionReporter] Transaction is not active: tx=TransactionImple < ac, BasicAction: afac7f2:10d4:47e7ea58:213 status: ActionStatus.ABORT_ONLY >; - nested throwable: (javax.resource.ResourceException: Transaction is not active: tx=TransactionImple < ac, BasicAction: afac7f2:10d4:47e7ea58:213 status: ActionStatus.ABORT_ONLY >)
      
      2008-03-24 14:13:04,038 DEBUG [org.hibernate.ejb.AbstractEntityManagerImpl] mark transaction for rollback



      SFSB declaration and it's create method:


      
      @Stateful
      
      @Scope(ScopeType.CONVERSATION)
      
      @Name("domRelateInstancesAction")
      
      @Conversational
      
      public class RefDomRelateInstancesActionBean implements RefDomRelateInstancesActionLocal {
      
      
      @Create
      
      public void init() {
      
                this.allRelations = domainInstanceRelService.findChildDomRelInstances(getActiveDomainRelation());
      
                if(this.initFromRels) {
      
                     findRelatedFromInstances();
      
                }
      
           }
      
      }



      domainInstanceRelService is the SLSB doing database access. If I call this exact same code from the same SFSB but on a regular business method (triggered by s:button) I don't get the exception. My guess is that Seam didnt start the transaction like it should have. Moreover this issue seems to be intermittent as I know that it's normally possible to make database access from within a bean @Create method.


      The first reference to the bean in my facelets (presumably that triggers the @Create is pasted below, thats if facelets parses/processes the file top-bottom-left-right):


      <a4j:outputPanel id="fromRel">
      
                <a4j:region id="fromRelRegion"
      
                     rendered="#{not empty domRelateInstancesAction.relatedFromInstances}">
      
                     <span class="label">#{onerellabel}</span> ...



      Please advise, has anyone run into similar issues ?


      Thanks,

        • 1. Re: Transaction is not active with @Create annotation
          Guillaume Jeudy Master

          Hi all,


          The issue disappears and then reappears for no specific reasons. This time it is the same pattern, @Factory method on SFSB calling an SLSB doing database access. I'm beginning to think it's either a bug in seam transaction management or jboss AS bug.


          I would really appreciate if a Seam developer or other experts could look at this issue. Or at least give hints on how to troubleshoot this problem. After some research it seems like the reason people are hitting: Transaction not active error  is usually not the root cause. I searched for the real exception in the server logs but couldnt find anything, see the stacktrace I get on the @Factory case:



          2008-03-26 10:29:40,161 DEBUG [org.hibernate.util.JDBCExceptionReporter] Cannot open connection [???]
          
          org.jboss.util.NestedSQLException: Transaction is not active: tx=TransactionImple < ac, BasicAction: afac7f2:97c:47ea4ab3:2d2 status: ActionStatus.ABORT_ONLY >; - nested throwable: (javax.resource.ResourceException: Transaction is not active: tx=TransactionImple < ac, BasicAction: afac7f2:97c:47ea4ab3:2d2 status: ActionStatus.ABORT_ONLY >)
          
               at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:94)
          
               at org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider.getConnection(InjectedDataSourceConnectionProvider.java:47)
          
               at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:423)
          
               at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)
          
               at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:139)
          
               at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1547)
          
               at org.hibernate.loader.Loader.doQuery(Loader.java:673)
          
               at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
          
               at org.hibernate.loader.Loader.doList(Loader.java:2220)
          
               at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
          
               at org.hibernate.loader.Loader.list(Loader.java:2099)
          
               at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:378)
          
               at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
          
               at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
          
               at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
          
               at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
          
               at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:64)
          
               at com.archinsurance.rdmservices.stateless.impl.RefDomRelInstServiceImpl.findChildDomRelInstances(RefDomRelInstServiceImpl.java:207)
          
               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          
               at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          
               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          
               at java.lang.reflect.Method.invoke(Method.java:585)
          
               at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
          
               at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
          
               at com.archinsurance.rdmservices.interceptors.LoggingInterceptor.intercept(LoggingInterceptor.java:18)
          
               at sun.reflect.GeneratedMethodAccessor969.invoke(Unknown Source)
          
               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          
               at java.lang.reflect.Method.invoke(Method.java:585)
          
               at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
          
               at org.jboss.seam.intercept.EJBInvocationContext.proceed(EJBInvocationContext.java:44)
          
               at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
          
               at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:31)
          
               at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
          
               at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:46)
          
               at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
          
               at org.jboss.seam.bpm.BusinessProcessInterceptor.aroundInvoke(BusinessProcessInterceptor.java:49)
          
               at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
          
               at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
          
               at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
          
               at org.jboss.seam.persistence.EntityManagerProxyInterceptor.aroundInvoke(EntityManagerProxyInterceptor.java:26)
          
               at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
          
               at org.jboss.seam.persistence.HibernateSessionProxyInterceptor.aroundInvoke(HibernateSessionProxyInterceptor.java:27)
          
               at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
          
               at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
          
               at org.jboss.seam.intercept.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:50)
          
               at sun.reflect.GeneratedMethodAccessor968.invoke(Unknown Source)
          
               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          
               at java.lang.reflect.Method.invoke(Method.java:585)
          
               at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
          
               at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
          
               at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
          
               at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
          
               at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
          
               at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
          
               at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
          
               at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
          
               at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:195)
          
               at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
          
               at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:95)
          
               at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
          
               at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
          
               at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
          
               at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
          
               at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:110)
          
               at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
          
               at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
          
               at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
          
               at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
          
               at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
          
               at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:240)
          
               at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:210)
          
               at org.jboss.ejb3.stateless.StatelessLocalProxy.invoke(StatelessLocalProxy.java:84)
          
               at $Proxy666.findChildDomRelInstances(Unknown Source)
          
               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          
               at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          
               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          
               at java.lang.reflect.Method.invoke(Method.java:585)
          
               at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
          
               at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
          
               at org.jboss.seam.intercept.ClientSideInterceptor$1.proceed(ClientSideInterceptor.java:76)
          
               at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
          
               at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
          
               at org.jboss.seam.intercept.ClientSideInterceptor.invoke(ClientSideInterceptor.java:54)
          
               at org.javassist.tmp.java.lang.Object_$$_javassist_11.findChildDomRelInstances(Object_$$_javassist_11.java)
          
               at com.archinsurance.rdmservices.stateful.impl.RefDomRelateInstanceActionBean.init(RefDomRelateInstanceActionBean.java:92)
          
               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          
               at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          
               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          
               at java.lang.reflect.Method.invoke(Method.java:585)
          
               at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
          
               at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
          
               at com.archinsurance.rdmservices.interceptors.LoggingInterceptor.intercept(LoggingInterceptor.java:18)
          
               at sun.reflect.GeneratedMethodAccessor969.invoke(Unknown Source)
          
               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          
               at java.lang.reflect.Method.invoke(Method.java:585)
          
               at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
          
               at org.jboss.seam.intercept.EJBInvocationContext.proceed(EJBInvocationContext.java:44)
          
               at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
          
               at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:46)
          
               at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
          
               at org.jboss.seam.persistence.ManagedEntityIdentityInterceptor.aroundInvoke(ManagedEntityIdentityInterceptor.java:48)
          
               at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
          
               at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:31)
          
               at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
          
               at org.jboss.seam.bpm.BusinessProcessInterceptor.aroundInvoke(BusinessProcessInterceptor.java:49)
          
               at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
          
               at org.jboss.seam.core.ConversationalInterceptor.aroundInvoke(ConversationalInterceptor.java:43)
          
               at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
          
               at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
          
               at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
          
               at org.jboss.seam.persistence.EntityManagerProxyInterceptor.aroundInvoke(EntityManagerProxyInterceptor.java:26)
          
               at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
          
               at org.jboss.seam.persistence.HibernateSessionProxyInterceptor.aroundInvoke(HibernateSessionProxyInterceptor.java:27)
          
               at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
          
               at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
          
               at org.jboss.seam.intercept.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:50)
          
               at sun.reflect.GeneratedMethodAccessor968.invoke(Unknown Source)
          
               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          
               at java.lang.reflect.Method.invoke(Method.java:585)
          
               at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
          
               at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
          
               at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
          
               at org.jboss.ejb3.entity.ExtendedPersistenceContextPropagationInterceptor.invoke(ExtendedPersistenceContextPropagationInterceptor.java:57)
          
               at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
          
               at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
          
               at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
          
               at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
          
               at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
          
               at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
          
               at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:195)
          
               at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
          
               at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:95)
          
               at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
          
               at org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:83)
          
               at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
          
               at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
          
               at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:110)
          
               at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
          
               at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
          
               at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
          
               at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
          
               at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
          
               at org.jboss.ejb3.stateful.StatefulContainer.localInvoke(StatefulContainer.java:206)
          
               at org.jboss.ejb3.stateful.StatefulLocalProxy.invoke(StatefulLocalProxy.java:119)
          
               at $Proxy607.init(Unknown Source)
          
               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          
               at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          
               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          
               at java.lang.reflect.Method.invoke(Method.java:585)
          
               at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
          
               at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
          
               at org.jboss.seam.intercept.ClientSideInterceptor$1.proceed(ClientSideInterceptor.java:76)
          
               at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
          
               at org.jboss.seam.ejb.RemoveInterceptor.aroundInvoke(RemoveInterceptor.java:41)
          
               at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
          
               at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
          
               at org.jboss.seam.intercept.ClientSideInterceptor.invoke(ClientSideInterceptor.java:54)
          
               at org.javassist.tmp.java.lang.Object_$$_javassist_12.init(Object_$$_javassist_12.java)
          
               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          
               at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          
               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          
               at java.lang.reflect.Method.invoke(Method.java:585)
          
               at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
          
               at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:125)
          
               at org.jboss.seam.Component.callComponentMethod(Component.java:2082)
          
               at org.jboss.seam.Component.getInstanceFromFactory(Component.java:1926)
          
               at org.jboss.seam.Component.getInstance(Component.java:1863)
          
               at org.jboss.seam.Component.getInstance(Component.java:1840)
          
               at org.jboss.seam.Namespace.getComponentInstance(Namespace.java:55)
          
               at org.jboss.seam.Namespace.getComponentInstance(Namespace.java:50)
          
               at org.jboss.seam.el.SeamELResolver.resolveBase(SeamELResolver.java:166)
          
               at org.jboss.seam.el.SeamELResolver.getValue(SeamELResolver.java:53)
          
               at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
          
               at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:64)
          
               at org.jboss.el.parser.AstIdentifier.getValue(AstIdentifier.java:44)
          
               at org.jboss.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
          
               at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:71)
          
               at javax.faces.component.UISelectItems.getValue(UISelectItems.java:130)
          
               at org.jboss.seam.ui.component.UISelectItems.getValue(UISelectItems.java:156)
          
               at com.sun.faces.renderkit.RenderKitUtils.getSelectItems(RenderKitUtils.java:323)
          
               at com.sun.faces.renderkit.html_basic.MenuRenderer.getOptionNumber(MenuRenderer.java:675)
          
               at com.sun.faces.renderkit.html_basic.MenuRenderer.renderSelect(MenuRenderer.java:793)
          
               at com.sun.faces.renderkit.html_basic.MenuRenderer.encodeEnd(MenuRenderer.java:335)
          
               at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:836)
          
               at javax.faces.component.UIComponent.encodeAll(UIComponent.java:896)
          
               at javax.faces.component.UIComponent.encodeAll(UIComponent.java:892)
          
               at javax.faces.render.Renderer.encodeChildren(Renderer.java:137)
          
               at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:812)
          
               at javax.faces.component.UIComponent.encodeAll(UIComponent.java:886)
          
               at javax.faces.component.UIComponent.encodeAll(UIComponent.java:892)
          
               at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:592)
          
               at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
          
               at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:216)
          
               at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
          
               at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
          
               at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
          
               at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
          
               at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
          
               at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
          
               at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
          
               at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
          
               at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
          
               at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
          
               at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
          
               at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
          
               at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
          
               at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
          
               at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
          
               at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
          
               at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
          
               at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
          
               at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
          
               at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
          
               at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
          
               at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
          
               at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
          
               at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
          
               at jcifs.http.NtlmHttpFilter.doFilter(NtlmHttpFilter.java:118)
          
               at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
          
               at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
          
               at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
          
               at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
          
               at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
          
               at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
          
               at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
          
               at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
          
               at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
          
               at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
          
               at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
          
               at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
          
               at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
          
               at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
          
               at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
          
               at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
          
               at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
          
               at java.lang.Thread.run(Thread.java:595)
          
          Caused by: javax.resource.ResourceException: Transaction is not active: tx=TransactionImple < ac, BasicAction: afac7f2:97c:47ea4ab3:2d2 status: ActionStatus.ABORT_ONLY >
          
               at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:304)
          
               at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:396)
          
               at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:842)
          
               at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:88)
          
               ... 235 more


          • 2. Re: Transaction is not active with @Create annotation
            Guillaume Jeudy Master

            In case anybody is having the same issues.


            I found a temporary workaround, on my @Create or @Factory annotated method I also added:


            @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
            
            



            This solves the transaction is not active problem.


            Even though I would love to hear from Seam people as to why this might be happening and why it only happens on @Create and @Factory annotated methods.


            Regards,
            -Guillaume

            • 3. Re: Transaction is not active with @Create annotation
              Srinivasan N. Raguraman Newbie

              are you using SMPC (seam managed persistence context), and still running into this issue?

              • 4. Re: Transaction is not active with @Create annotation
                Guillaume Jeudy Master

                Yes the above issues occurred while using SMPC. I have to emphasize that the exception is sporadic and sometimes went away by itself (after a JBoss AS restart or a redeployment of the EAR). Hopefully my workaround is robust enough to permanently ban the exception from my logs :) It hasn't occurred again once I added the transactionattribute as stated above.


                I completely ditched @PersistenceContext because of it's hard to predict behavior depending of the context the session bean is being called. SMPC is more reliable as far as Seam development goes, afaik.

                • 5. Re: Transaction is not active with @Create annotation
                  Gábor Farkas Newbie

                  I have the same kind of exception, in 2.0.1GA and 2.1.0A1 as well, with AS 4.2.2GA. I have a single stateless session bean, injected to a jsf backing, both are seam components. The workaround with the transaction attribute works of course.


                  javax.resource.ResourceException: Transaction is not active: tx=TransactionImple < ac, BasicAction: -3f57fe9b:1339:47eb65ce:ab status: ActionStatus.ABORT_ONLY >
                       org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:304)
                       org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:396)
                       org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:842)
                       org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:88)
                       org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider.getConnection(InjectedDataSourceConnectionProvider.java:47)
                       org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:423)
                       org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)
                       org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:139)
                       org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1547)
                       org.hibernate.loader.Loader.doQuery(Loader.java:673)
                       org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
                       org.hibernate.loader.Loader.doList(Loader.java:2220)
                       org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
                       org.hibernate.loader.Loader.list(Loader.java:2099)
                       org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:378)
                       org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
                       org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
                       org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
                       org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
                       org.hibernate.ejb.QueryImpl.getSingleResult(QueryImpl.java:82)
                  [...]
                  

                  • 6. Re: Transaction is not active with @Create annotation
                    Olivier Thierry Apprentice

                    Same problem.
                    I solved it using @javax.ejb.TransactionAttribute(javax.ejb.TransactionAttributeType.REQUIRES_NEW) annotation too.

                    • 7. Re: Transaction is not active with @Create annotation
                      Guillaume Jeudy Master

                      For the common interest, Gabor and Olivier can you please state when you had the exception ? Is it also in @Create and @Factory annotated methods only ?


                      Regards,
                      -Guillaume

                      • 8. Re: Transaction is not active with @Create annotation
                        Gábor Farkas Newbie

                        Yup, sorry, I forgot that. It is not in a create or factory method, but in the first EM invocation in a normal business method of a stateless session bean, invoked from a JSF action. The call can be em.find or em.createQuery, it's always the same. I tried extended persistence context and SMPC as well. I'll have time soon to prepare a small application package which contains only the necessary elements to reproduce the exception.


                        What I don't really understand this is that normally the transaction begins on the invocation of the business method (from the backing). The same happens when the bean instance is already created by a previous call on the component. The bean has only the EntityManager injected. I see no point at which anything can happen to my transaction, which should be created just before my code runs.


                        If we declare REQUIRES NEW, everything goes fine. So, somewhy, in case of REQUIRED, a transaction is already running before I invoke the business method. I don't see when and why it begins.

                        • 9. Re: Transaction is not active with @Create annotation
                          Gábor Farkas Newbie

                          Yup, sorry, I forgot that. It is not in a create or factory method, but in the first EM invocation in a normal business method of a stateless session bean, invoked from a JSF action. The call can be em.find or em.createQuery, it's always the same. I tried extended persistence context and SMPC as well. I'll have time soon to prepare a small application package which contains only the necessary elements to reproduce the exception.


                          What I don't really understand this is that normally the transaction begins on the invocation of the business method (from the backing). The same happens when the bean instance is already created by a previous call on the component. The bean has only the EntityManager injected. I see no point at which anything can happen to my transaction, which should be created just before my code runs.


                          If we declare REQUIRES NEW, everything goes fine. So, somewhy, in case of REQUIRED, a transaction is already running before I invoke the business method. I don't see when and why it begins.

                          • 10. Re: Transaction is not active with @Create annotation
                            Srinivasan N. Raguraman Newbie

                            If you using SMPC then, seams starts and closes the transaction at various phases of JSF life-cycle. This helps to have the @Create and @Factory methods to access database inside transaction.


                            This is enabled by default, you should disable it if you don't want seam to start transactions for you.


                            http://docs.jboss.com/seam/2.1.0.A1/reference/en/html/persistence.html#d0e5891

                            • 11. Re: Transaction is not active with @Create annotation
                              Guillaume Jeudy Master

                              yes I have read the doc already see this excerpt:




                              Seam use two transactions per request; the first spans the beginning of the update model values phase until the end of the invoke application phase; the second spans the render response phase

                              I have verified and my @Create and @Factory annotated methods are invoked during the render response phase so they should be working inside a transaction correct ? It seems like it is not always the case. I suspect a bug in Seam transaction management especially due to inconsistent behavior observed. If Seam starts the transaction then it is no longer container managed ? Would it be why the default TransactionalAttribute.REQUIRED does not kick in and create a transaction for me ? Then how to explain that TransactionalAttribute.REQUIRES NEW fixes the problem ?


                              I don't want to disable seam transaction management because as you know, developing using the seam programming model requires many calls to SFSBs from the view layer and I don't want a new transaction created for every call.




                              • 12. Re: Transaction is not active with @Create annotation
                                Gábor Farkas Newbie

                                I was not aware of this, so I was testing always with SEAM starting the transaction before EJB calls. When disableing this, my exceptio n disappears.


                                Still I guess my problem is somehow related with that of Guillaume. I don't see why should that transaction be marked abort only.

                                • 13. Re: Transaction is not active with @Create annotation
                                  Gábor Farkas Newbie

                                  Would it be why the default TransactionalAttribute.REQUIRED does not kick in and create a transaction for me ? Then how to explain that TransactionalAttribute.REQUIRES NEW fixes the problem ?

                                  REQUIRED attribute joins the transaction previously created by SEAM, which is for some operation is marked abort only.
                                  REQUIRES NEW creates a brand new transaction for the EJB call which then I guess is not nested, so it gets committed on returning from the EJB call.

                                  • 14. Re: Transaction is not active with @Create annotation
                                    Gábor Farkas Newbie

                                    I've found our problem. We have an own navigation handler ported from a java 1.4 system, which throws a special exception from backings to signal some special navigation cases. These are handled by the navigation handler. But as the backings are now seam managed components, if an exception is thrown from them, the transaction aborts. By the time we get to the functionality itself, the transaction is already aborted because of the special navigation case handled before.

                                    1 2 Previous Next