-
Bug
-
Resolution: Done
-
Blocker
-
1.2.7.Final
-
None
Client applications get stuck with "Transaction not active exception"
Scenario:
1) Create provider organization, create and lock a plan, create and publish API
2) Create organization for client A and sign a contract
3) Create organization for client B and sign a contract
4) Register contract of client A, then register contract of client B
5) Unregister contract of client A, then unregister contract of client B
Observed: Transaction not active exception, contract B get stuck and cannot be successfully registered/unregistered in apimanui (it throws the same exception)
Automated script to reproduce a bug is attached.
Stack trace
ERROR [io.undertow.request] (default task-31) UT005023: Exception handling reques at org.jboss.resteasy.core.ExceptionHandler.handleApplicationException(ExceptionHandler.java:7 at org.jboss.resteasy.core.ExceptionHandler.handleException(ExceptionHandler.java:212) at org.jboss.resteasy.core.SynchronousDispatcher.writeException(SynchronousDispatcher.java:168 at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:411) at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:202) at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContain at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatch at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatch at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85) at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129) at io.apiman.common.servlet.RootResourceFilter.doFilter(RootResourceFilter.java:59) at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60) at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) at io.apiman.manager.api.war.TransactionWatchdogFilter.doFilter(TransactionWatchdogFilter.java at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60) at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) at io.apiman.manager.api.security.impl.DefaultSecurityContextFilter.doFilter(DefaultSecurityCo at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60) at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) at io.apiman.common.servlet.DisableCachingFilter.doFilter(DisableCachingFilter.java:59) at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60) at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) at io.apiman.common.servlet.ApimanCorsFilter.doFilter(ApimanCorsFilter.java:71) at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60) at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) at io.apiman.common.servlet.LocaleFilter.doFilter(LocaleFilter.java:61) at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60) at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84) at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecur at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHand at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(Sec at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) at org.keycloak.adapters.undertow.UndertowAuthenticatedActionsHandler.handleRequest(UndertowAu at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInf at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(Servle at io.undertow.server.handlers.DisableCacheHandler.handleRequest(DisableCacheHandler.java:33) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) at io.undertow.security.handlers.AuthenticationConstraintHandler.handleRequest(AuthenticationC at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfiden at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest at io.undertow.servlet.handlers.security.ServletSecurityConstraintHandler.handleRequest(Servle at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationM at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(Cache at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceive at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(Abstr at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContext at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) at org.keycloak.adapters.undertow.ServletPreAuthActionsHandler.handleRequest(ServletPreAuthAct at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.ja at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81 at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.ja at io.undertow.server.Connectors.executeRootHandler(Connectors.java:202) at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:793) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.RuntimeException: Transaction not active. at io.apiman.manager.api.jpa.AbstractJpaStorage.rollbackTx(AbstractJpaStorage.java:114) at io.apiman.manager.api.jpa.JpaStorage.rollbackTx(JpaStorage.java:146) at sun.reflect.GeneratedMethodAccessor163.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.jboss.weld.bean.proxy.AbstractBeanInstance.invoke(AbstractBeanInstance.java:38) at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:100) at org.jboss.weld.proxies.IStorage$816713466$Proxy$_$$_WeldClientProxy.rollbackTx(Unknown Sour at io.apiman.manager.api.rest.impl.ActionResourceImpl.unregisterClient(ActionResourceImpl.java at io.apiman.manager.api.rest.impl.ActionResourceImpl.performAction(ActionResourceImpl.java:11 at io.apiman.manager.api.rest.impl.ActionResourceImpl$Proxy$_$$_WeldClientProxy.performAction( at sun.reflect.GeneratedMethodAccessor246.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:139) at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:295 at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:249) at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:236) at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:395) ... 57 more