java.lang.IllegalStateException: A JTA EntityManager can not use the EntityTransaction API. See JPA 1.0 section 5.5

Apache's JIRA Issue Tracker | Manuel Blechschmidt | 10 months ago
  1. 0

    Like I already mentioned in ONLINGO-754 the EntityManager is closed by Olingo. This creates a problem if the EntityManager is managed by an application server. We now decomposed our application and are consuming olingo through a transitive dependency. Therefore our dirty hack by "overwritten" classes by putting them in our own codebase does not work anymore. The problem is here: {code:title=https://github.com/apache/olingo-odata2/blob/2.0.6/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/ODataJPAProcessor.java} https://github.com/apache/olingo-odata2/blob/2.0.6/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/ODataJPAProcessor.java {code} I will implement my own ODataJPAProcessor to workaround {code} JBAS011424: Container managed entity manager can only be closed by the container (auto-cleared at tx/invocation end and closed when owning component is closed.)"},"innererror":"Stacktrace : java.lang.IllegalStateException: JBAS011424: Container managed entity manager can only be closed by the container (auto-cleared at tx/invocation end and closed when owning component is closed.)\n\tat org.jboss.as.jpa.container.TransactionScopedEntityManager.close(TransactionScopedEntityManager.java:105)\n\tat org.apache.olingo.odata2.jpa.processor.api.ODataJPAProcessor.close(ODataJPAProcessor.java:88)\n\tat de.pcagrar.cloud.rest.odata.filter.FilteringJpaProcessor.executeBatch(FilteringJpaProcessor.java:376)\n\tat org.apache.olingo.odata2.core.Dispatcher.dispatch(Dispatcher.java:190)\n\tat org.apache.olingo.odata2.core.ODataRequestHandler.handle(ODataRequestHandler.java:130)\n\tat org.apache.olingo.odata2.core.rest.ODataSubLocator.handle(ODataSubLocator.java:164)\n\tat org.apache.olingo.odata2.core.rest.ODataSubLocator.handlePost(ODataSubLocator.java:100)\n\tat de.pcagrar.cloud.rest.odata.ODataRootLocator.handleRequest(ODataRootLocator.java:93)\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat java.lang.reflect.Method.invoke(Method.java:498)\n\tat org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:52)\n\tat org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)\n\tat org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)\n\tat org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)\n\tat org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)\n\tat org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:407)\n\tat org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:82)\n\tat org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:93)\n\tat org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)\n\tat org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)\n\tat org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)\n\tat org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)\n\tat org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)\n\tat org.jboss.as.ejb3.component.invocationmetrics.ExecutionTimeInterceptor.processInvocation(ExecutionTimeInterceptor.java:43)\n\tat org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)\n\tat org.jboss.as.jpa.interceptor.SBInvocationInterceptor.processInvocation(SBInvocationInterceptor.java:47)\n\tat org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)\n\tat org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:407)\n\tat org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:46)\n\tat org.jboss.as.weld.ejb.EjbRequestScopeActivationInterceptor.processInvocation(EjbRequestScopeActivationInterceptor.java:83)\n\tat org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)\n\tat org.jboss.as.ee.concurrent.ConcurrentContextInterceptor.processInvocation(ConcurrentContextInterceptor.java:45)\n\tat org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)\n\tat org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21)\n\tat org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)\n\tat org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)\n\tat org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:53)\n\tat org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)\n\tat org.jboss.as.ejb3.component.interceptors.NonPooledEJBComponentInstanceAssociatingInterceptor.processInvocation(NonPooledEJBComponentInstanceAssociatingInterceptor.java:59)\n\tat org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)\n\tat org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:273)\n\tat org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:340)\n\tat org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:239)\n\tat org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)\n\tat org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41)\n\tat org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)\n\tat org.jboss.as.ejb3.component.invocationmetrics.WaitTimeInterceptor.processInvocation(WaitTimeInterceptor.java:43)\n\tat org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)\n\tat org.jboss.as.ejb3.security.SecurityContextInterceptor.processInvocation(SecurityContextInterceptor.java:95)\n\tat org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)\n\tat org.jboss.as.ejb3.component.interceptors.ShutDownInterceptorFactory$1.processInvocation(ShutDownInterceptorFactory.java:64)\n\tat org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)\n\tat org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:59)\n\tat org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)\n\tat org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)\n\tat org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)\n\tat org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:55)\n\tat org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)\n\tat org.jboss.invocation.ContextClassLoaderInterceptor.processInvocation(ContextClassLoaderInterceptor.java:64)\n\tat org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)\n\tat org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:326)\n\tat org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:448)\n\tat org.jboss.invocation.AccessCheckingInterceptor.processInvocation(AccessCheckingInterceptor.java:61)\n\tat org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)\n\tat org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:326)\n\tat org.jboss.invocation.PrivilegedWithCombinerInterceptor.processInvocation(PrivilegedWithCombinerInterceptor.java:80)\n\tat org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)\n\tat org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)\n\tat org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:185)\n\tat org.jboss.as.ee.component.ViewDescription$1.processInvocation(ViewDescription.java:182)\n\tat org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)\n\tat org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)\n\tat org.jboss.as.ee.component.ProxyInvocationHandler.invoke(ProxyInvocationHandler.java:73)\n\tat de.pcagrar.cloud.rest.odata.ODataRootLocator$$$view284.handleRequest(Unknown Source)\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat java.lang.reflect.Method.invoke(Method.java:498)\n\tat org.jboss.weld.util.reflection.Reflections.invokeAndUnwrap(Reflections.java:414)\n\tat org.jboss.weld.bean.proxy.EnterpriseBeanProxyMethodHandler.invoke(EnterpriseBeanProxyMethodHandler.java:127)\n\tat org.jboss.weld.bean.proxy.EnterpriseTargetBeanInstance.invoke(EnterpriseTargetBeanInstance.java:56)\n\tat org.jboss.weld.bean.proxy.InjectionPointPropagatingEnterpriseTargetBeanInstance.invoke(InjectionPointPropagatingEnterpriseTargetBeanInstance.java:65)\n\tat org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:100)\n\tat de.pcagrar.cloud.rest.odata.ODataRootLocator$Proxy$_$$_Weld$EnterpriseProxy$.handleRequest(Unknown Source)\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat java.lang.reflect.Method.invoke(Method.java:498)\n\tat org.jboss.resteasy.core.ResourceLocatorInvoker.createResource(ResourceLocatorInvoker.java:81)\n\tat org.jboss.resteasy.core.ResourceLocatorInvoker.createResource(ResourceLocatorInvoker.java:60)\n\tat org.jboss.resteasy.core.ResourceLocatorInvoker.invoke(ResourceLocatorInvoker.java:102)\n\tat org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:356)\n\tat org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:179)\n\tat org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:220)\n\tat org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56)\n\tat org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51)\n\tat javax.servlet.http.HttpServlet.service(HttpServlet.java:790)\n\tat io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)\n\tat io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:130)\n\tat de.pcagrar.cloud.rest.odata.CachingFilter.doFilter(CachingFilter.java:61)\n\tat io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60)\n\tat io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:132)\n\tat de.pcagrar.cloud.security.AgrarAuthenticationFilter.doFilter(AgrarAuthenticationFilter.java:297)\n\tat io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60)\n\tat io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:132)\n\tat io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:85)\n\tat io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:61)\n\tat io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)\n\tat org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)\n\tat io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)\n\tat io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)\n\tat io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:56)\n\tat io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)\n\tat io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:45)\n\tat io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:63)\n\tat io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:58)\n\tat io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:70)\n\tat io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76)\n\tat io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)\n\tat org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)\n\tat io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)\n\tat io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)\n\tat io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:261)\n\tat io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:247)\n\tat io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:76)\n\tat io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:166)\n\tat io.undertow.server.Connectors.executeRootHandler(Connectors.java:197)\n\tat io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:759)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)\n\tat java.lang.Thread.run(Thread.java:745)\n {code}

    Apache's JIRA Issue Tracker | 10 months ago | Manuel Blechschmidt
    java.lang.IllegalStateException: A JTA EntityManager can not use the EntityTransaction API. See JPA 1.0 section 5.5
  2. 0

    EclipseLink - Users - TENANT_PER_TABLE Problem. Can't compile Named Query.

    nabble.com | 5 months ago
    java.lang.IllegalStateException: A JTA EntityManager can not use the EntityTransaction API.  See JPA 1.0 section 5.5
  3. 0

    TomEE Users - Transaction required exception

    nabble.com | 8 months ago
    java.lang.IllegalStateException: A JTA EntityManager can not use the EntityTransaction API.  See JPA 1.0 section 5.5
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    [OpenEJB-users] Transaction required exception - Grokbase

    grokbase.com | 12 months ago
    java.lang.IllegalStateException: A JTA EntityManager can not use the EntityTransaction API. See JPA 1.0 section 5.5

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.IllegalStateException

      A JTA EntityManager can not use the EntityTransaction API. See JPA 1.0 section 5.5

      at org.apache.openejb.persistence.JtaEntityManager.getTransaction()
    2. OpenEJB :: OSGi :: Core
      JtaEntityManager.getTransaction
      1. org.apache.openejb.persistence.JtaEntityManager.getTransaction(JtaEntityManager.java:349)
      1 frame
    3. org.apache.olingo
      ODataJPAProcessorDefault.createEntity
      1. org.apache.olingo.odata2.jpa.processor.core.ODataJPATransactionLocalDefault.<init>(ODataJPATransactionLocalDefault.java:31)
      2. org.apache.olingo.odata2.jpa.processor.core.ODataJPAContextImpl.getODataJPATransaction(ODataJPAContextImpl.java:178)
      3. org.apache.olingo.odata2.jpa.processor.core.access.data.JPAProcessorImpl.setTransaction(JPAProcessorImpl.java:451)
      4. org.apache.olingo.odata2.jpa.processor.core.access.data.JPAProcessorImpl.processCreate(JPAProcessorImpl.java:335)
      5. org.apache.olingo.odata2.jpa.processor.core.access.data.JPAProcessorImpl.process(JPAProcessorImpl.java:223)
      6. org.apache.olingo.odata2.jpa.processor.core.ODataJPAProcessorDefault.createEntity(ODataJPAProcessorDefault.java:122)
      6 frames
    4. ${project.artifactId}
      ODataSubLocator.handlePost
      1. org.apache.olingo.odata2.core.Dispatcher.dispatch(Dispatcher.java:79)
      2. org.apache.olingo.odata2.core.ODataRequestHandler.handle(ODataRequestHandler.java:130)
      3. org.apache.olingo.odata2.core.rest.ODataSubLocator.handle(ODataSubLocator.java:164)
      4. org.apache.olingo.odata2.core.rest.ODataSubLocator.handlePost(ODataSubLocator.java:86)
      4 frames