Works too, i was thinking about something similar but programmatic but at the end it does the same (veto the default impl and replace it by a custom one which injects the txmgr), your solution is even less verbose ;).
Romain Manni-Bucau @rmannibucau <https://twitter.com/rmannibucau> | Blog <https://rmannibucau.metawerx.net/> | Old Blog <http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> | LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book <https://www.packtpub.com/application-development/java-ee-8-high-performance> Le jeu. 10 sept. 2020 à 02:04, Shultz, Dmitry <dmitry_shu...@kaltire.com> a écrit : > I was not sure what to do in the extension, so I just created this class > and made it part of the service codebase: > > > > @Specializes > > public class PatchedRequiredJtaTransactionPolicy extends > RequiredJtaTransactionPolicy { > > > > @Resource > > TransactionManager txMgr; > > > > @Override > > public void run(final Runnable runnable) throws Throwable { > > transactionManager = txMgr; > > runWithTransaction(runnable, !hasActiveTransaction()); > > } > > } > > > > And it all (Camel 3.5.0, SJMS transactions, Hibernate transactions, …) > works now in TomEE 7.0.6 J Thanks Romain! > > If there is anything I can do to make it ‘nicer’ (or maybe I’m missing > anything) –any suggestion will be appreciated J. > > > > Cheers, > > Dmitry > > > > > > *From:* Romain Manni-Bucau [mailto:rmannibu...@gmail.com] > *Sent:* Wednesday, September 9, 2020 10:55 AM > *To:* Shultz, Dmitry <dmitry_shu...@kaltire.com> > *Cc:* users@camel.apache.org > *Subject:* Re: CDI + SJMS + transacted > > > > As mentionned previously Camel needs to be patched. > > The easiest is a cdi extension replacing RequiredJtaTransactionPolicy by > a custom impl (likely using @Resource TransactionManager txMgr instead of > the lookup, should be trivial I think). > > > > Side note: this logic likely needs to move in a camel-ee module cause cdi > module seems inaccurate (in terms of dependencies and usage and it already > created troubles by the past even if the openjpa code could mitigate it). > > > Romain Manni-Bucau > @rmannibucau [twitter.com] > <https://urldefense.com/v3/__https:/twitter.com/rmannibucau__;!!LdWlNaMnLCM!KicObP30ibyFUuNzaC66jwhfJNxEBH78hcl9h6oK-0EvXz_jf8WmRe1tmDF0T0GI2jro$> > | Blog [rmannibucau.metawerx.net] > <https://urldefense.com/v3/__https:/rmannibucau.metawerx.net/__;!!LdWlNaMnLCM!KicObP30ibyFUuNzaC66jwhfJNxEBH78hcl9h6oK-0EvXz_jf8WmRe1tmDF0T_V5imJ7$> > | > Old Blog [rmannibucau.wordpress.com] > <https://urldefense.com/v3/__http:/rmannibucau.wordpress.com__;!!LdWlNaMnLCM!KicObP30ibyFUuNzaC66jwhfJNxEBH78hcl9h6oK-0EvXz_jf8WmRe1tmDF0T_p1aJXo$> > | Github [github.com] > <https://urldefense.com/v3/__https:/github.com/rmannibucau__;!!LdWlNaMnLCM!KicObP30ibyFUuNzaC66jwhfJNxEBH78hcl9h6oK-0EvXz_jf8WmRe1tmDF0T0NqDxib$> > | > LinkedIn [linkedin.com] > <https://urldefense.com/v3/__https:/www.linkedin.com/in/rmannibucau__;!!LdWlNaMnLCM!KicObP30ibyFUuNzaC66jwhfJNxEBH78hcl9h6oK-0EvXz_jf8WmRe1tmDF0TzdL7iSF$> > | > Book [packtpub.com] > <https://urldefense.com/v3/__https:/www.packtpub.com/application-development/java-ee-8-high-performance__;!!LdWlNaMnLCM!KicObP30ibyFUuNzaC66jwhfJNxEBH78hcl9h6oK-0EvXz_jf8WmRe1tmDF0T4_pbDb7$> > > > > > > Le mer. 9 sept. 2020 à 19:42, Shultz, Dmitry <dmitry_shu...@kaltire.com> > a écrit : > > Romain, > > > > My current Hibernate is 4.2.21.Final, here are the different outcomes I > see after I applied your suggestion to the persistence.xml: > > > > 1. name="hibernate.transaction.jta.platform" > value="org.apache.openejb.hibernate.OpenEJBJtaPlatform2" > > > > getting (as expected) java.lang.ClassNotFoundException: > org.hibernate.engine.transaction.jta.platform.internal.AbstractJtaPlatform > > > > 2. name="hibernate.transaction.jta.platform" > value="org.apache.openejb.hibernate.OpenEJBJtaPlatform" > > getting same WARN o.a.c.c.t.TransactionalJtaTransactionPolicy - Could not > find the transaction manager through java:/TransactionManager when Camel > boots > > > > 3. name="hibernate.transaction.manager_lookup_class" > value="org.apache.openejb.hibernate.TransactionManagerLookup" > > getting same WARN o.a.c.c.t.TransactionalJtaTransactionPolicy - Could not > find the transaction manager through java:/TransactionManager when Camel > boots > > > > In 2 & 3 the persistence unit starts successfully, it’s only when Camel > tries to find the TransactionManager it logs the warning. > > > > I tried to upgrade Hibernate to 5.4.20.Final but it doesn’t seem to be > compatible with my current TomEE 7.0.6 and I can’t easily update it at the > moment L > > > > Caused by: java.lang.ClassNotFoundException: > org.hibernate.ejb.HibernatePersistence > > at > org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1364) > > at > org.apache.tomee.catalina.TomEEWebappClassLoader.loadClass(TomEEWebappClassLoader.java:208) > > at > org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1185) > > at > org.apache.openejb.assembler.classic.EntityManagerFactoryCallable.call(EntityManagerFactoryCallable.java:84) > > at > org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory.createDelegate(ReloadableEntityManagerFactory.java:134) > > > > Is there anything else I can try? > > > > Cheers, > > Dmitry > > > > > > *From:* Romain Manni-Bucau [mailto:rmannibu...@gmail.com] > *Sent:* Wednesday, September 9, 2020 12:56 AM > *To:* users@camel.apache.org > *Cc:* Shultz, Dmitry <dmitry_shu...@kaltire.com> > *Subject:* Re: CDI + SJMS + transacted > > > > In hibernate configuration, you can try to force the transaction manager > lokup > hibernate.transaction.jta.platform=org.apache.openejb.hibernate.OpenEJBJtaPlatform2 > (if > you use older versions with the older hibernate key just drop the "2" at > the end of the platform and if you use a very old hibernate version > (manager_lookup_class), then use > org.apache.openejb.hibernate.TransactionManagerLookup) > > > Romain Manni-Bucau > @rmannibucau [twitter.com] > <https://urldefense.com/v3/__https:/twitter.com/rmannibucau__;!!LdWlNaMnLCM!L4bACvX05-Lb8u2ekiHyS3J3BxvhaVb4D1pnwM4ItphCC4flnrEsTsv-xjwZfoi1Cx-a$> > | Blog [rmannibucau.metawerx.net] > <https://urldefense.com/v3/__https:/rmannibucau.metawerx.net/__;!!LdWlNaMnLCM!L4bACvX05-Lb8u2ekiHyS3J3BxvhaVb4D1pnwM4ItphCC4flnrEsTsv-xjwZfsV0FRfY$> > | > Old Blog [rmannibucau.wordpress.com] > <https://urldefense.com/v3/__http:/rmannibucau.wordpress.com__;!!LdWlNaMnLCM!L4bACvX05-Lb8u2ekiHyS3J3BxvhaVb4D1pnwM4ItphCC4flnrEsTsv-xjwZfvdkhBJC$> > | Github [github.com] > <https://urldefense.com/v3/__https:/github.com/rmannibucau__;!!LdWlNaMnLCM!L4bACvX05-Lb8u2ekiHyS3J3BxvhaVb4D1pnwM4ItphCC4flnrEsTsv-xjwZflUkiucl$> > | > LinkedIn [linkedin.com] > <https://urldefense.com/v3/__https:/www.linkedin.com/in/rmannibucau__;!!LdWlNaMnLCM!L4bACvX05-Lb8u2ekiHyS3J3BxvhaVb4D1pnwM4ItphCC4flnrEsTsv-xjwZfiS4xUan$> > | > Book [packtpub.com] > <https://urldefense.com/v3/__https:/www.packtpub.com/application-development/java-ee-8-high-performance__;!!LdWlNaMnLCM!L4bACvX05-Lb8u2ekiHyS3J3BxvhaVb4D1pnwM4ItphCC4flnrEsTsv-xjwZfoOPIGUi$> > > > > > > Le mer. 9 sept. 2020 à 09:42, Zheng Feng <zf...@redhat.com> a écrit : > > Hi Dmitry, > > It seems that the TransactionManager can not be accessed via > "java:/TransactionManager" and I am not an expert of TomEE also I am not > sure if there is a way to set the transaction manager jndi name in the > configuration file ? > > Regards, > Zheng Feng > > On Wed, Sep 9, 2020 at 3:18 AM Shultz, Dmitry <dmitry_shu...@kaltire.com> > wrote: > > > Zheng, > > > > > > > > I’m still having problem and it seems to behave differently running on > the > > same TomEE version (7.0.6) but different Camel 3+ versions. > > > > > > > > To reproduce I corrupted the query (handled by Deltaspike Data Module > > repository). > > > > > > > > When it runs (fails) with Camel 3.4.5 it behaves as expected the first > > time, but when it tries to redeliver the same JMS message it complains > with > > ‘Cannot join transaction: do not override > > hibernate.transaction.factory_class’. Here is the full stack for > redelivery: > > > > > > > > 2020-09-08 11:07:56.428 [Thread-0 (ActiveMQ-client] WARN > > c.k.m.c.DeadLetterChannelBuilderProducer - redelivery attempt 1 to > > direct://process > > > > 2020-09-08 11:07:56.440 [Thread-0 (ActiveMQ-client] WARN > > o.h.ejb.AbstractEntityManagerImpl - HHH000326: Cannot join transaction: > do > > not override hibernate.transaction.factory_class > > > > 2020-09-08 11:07:56.442 [Thread-0 (ActiveMQ-client] ERROR > > c.k.m.c.DeadLetterChannelBuilderProducer - processing failed with: > > > > javax.persistence.TransactionRequiredException: No active JTA transaction > > on joinTransaction call > > > > at > > > org.hibernate.ejb.AbstractEntityManagerImpl.joinTransaction(AbstractEntityManagerImpl.java:1233) > > > > at > > > org.hibernate.ejb.AbstractEntityManagerImpl.joinTransaction(AbstractEntityManagerImpl.java:1183) > > > > at > > > org.apache.deltaspike.jpa.impl.transaction.BeanManagedUserTransactionStrategy.beforeProceed(BeanManagedUserTransactionStrategy.java:171) > > > > at > > > org.apache.deltaspike.jpa.impl.transaction.EnvironmentAwareTransactionStrategy.beforeProceed(EnvironmentAwareTransactionStrategy.java:109) > > > > at > > > org.apache.deltaspike.jpa.impl.transaction.ResourceLocalTransactionStrategy.execute(ResourceLocalTransactionStrategy.java:127) > > > > at > > > org.apache.deltaspike.jpa.impl.transaction.TransactionalInterceptor.executeInTransaction(TransactionalInterceptor.java:57) > > > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native > > Method) > > > > at > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > > > > at > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > > > > at java.lang.reflect.Method.invoke(Method.java:498) > > > > at > > > org.apache.webbeans.component.InterceptorBean.intercept(InterceptorBean.java:136) > > > > at > > > org.apache.webbeans.intercept.InterceptorInvocationContext.proceed(InterceptorInvocationContext.java:63) > > > > at > > > org.apache.webbeans.intercept.DefaultInterceptorHandler.invoke(DefaultInterceptorHandler.java:139) > > > > at > > > com.kaltire.mix.tirelodge.camel.beans.EventProcessor$$OwbInterceptProxy0.process(com/kaltire/mix/tirelodge/camel/beans/EventProcessor.java) > > > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native > > Method) > > > > at > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > > > > at > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > > > > at java.lang.reflect.Method.invoke(Method.java:498) > > > > at > > > org.apache.camel.support.ObjectHelper.invokeMethodSafe(ObjectHelper.java:209) > > > > at > > org.apache.camel.component.bean.MethodInfo.invoke(MethodInfo.java:421) > > > > at > > > org.apache.camel.component.bean.MethodInfo$1.doProceed(MethodInfo.java:242) > > > > at > > org.apache.camel.component.bean.MethodInfo$1.proceed(MethodInfo.java:213) > > > > at > > > org.apache.camel.component.bean.AbstractBeanProcessor.process(AbstractBeanProcessor.java:154) > > > > at > > > org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:56) > > > > at > > > org.apache.camel.management.DefaultInstrumentationProcessor.process(DefaultInstrumentationProcessor.java:91) > > > > at > > > org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$RedeliveryTask.redeliver(RedeliveryErrorHandler.java:766) > > > > at > > > org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.schedule(DefaultReactiveExecutor.java:148) > > > > at > > > org.apache.camel.impl.engine.DefaultReactiveExecutor.scheduleSync(DefaultReactiveExecutor.java:65) > > > > at > > > org.apache.camel.processor.errorhandler.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:175) > > > > at > > > org.apache.camel.impl.engine.DefaultAsyncProcessorAwaitManager.process(DefaultAsyncProcessorAwaitManager.java:83) > > > > at > > > org.apache.camel.processor.errorhandler.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:158) > > > > at > > > org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:260) > > > > at > > > org.apache.camel.processor.ChoiceProcessor.process(ChoiceProcessor.java:115) > > > > at > > > org.apache.camel.impl.engine.DefaultAsyncProcessorAwaitManager.process(DefaultAsyncProcessorAwaitManager.java:83) > > > > at > > > org.apache.camel.support.AsyncProcessorSupport.process(AsyncProcessorSupport.java:40) > > > > at > > > org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:260) > > > > at > > > org.apache.camel.impl.engine.DefaultAsyncProcessorAwaitManager.process(DefaultAsyncProcessorAwaitManager.java:83) > > > > at > > > org.apache.camel.support.AsyncProcessorSupport.process(AsyncProcessorSupport.java:40) > > > > at > > > org.apache.camel.jta.TransactionErrorHandler.processByErrorHandler(TransactionErrorHandler.java:242) > > > > at > > > org.apache.camel.jta.TransactionErrorHandler$1.run(TransactionErrorHandler.java:203) > > > > at > > > org.apache.camel.cdi.transaction.TransactionalJtaTransactionPolicy.runWithTransaction(TransactionalJtaTransactionPolicy.java:51) > > > > at > > > org.apache.camel.cdi.transaction.RequiredJtaTransactionPolicy.run(RequiredJtaTransactionPolicy.java:26) > > > > at > > > org.apache.camel.jta.TransactionErrorHandler.doInTransactionTemplate(TransactionErrorHandler.java:193) > > > > at > > > org.apache.camel.jta.TransactionErrorHandler.processInTransaction(TransactionErrorHandler.java:144) > > > > at > > > org.apache.camel.jta.TransactionErrorHandler.process(TransactionErrorHandler.java:108) > > > > at > > > org.apache.camel.jta.TransactionErrorHandler.process(TransactionErrorHandler.java:117) > > > > at > > > org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$SimpleTask.run(RedeliveryErrorHandler.java:395) > > > > at > > > org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.schedule(DefaultReactiveExecutor.java:148) > > > > at > > > org.apache.camel.impl.engine.DefaultReactiveExecutor.scheduleSync(DefaultReactiveExecutor.java:65) > > > > at > > > org.apache.camel.processor.errorhandler.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:175) > > > > at > > > org.apache.camel.impl.engine.DefaultAsyncProcessorAwaitManager.process(DefaultAsyncProcessorAwaitManager.java:83) > > > > at > > > org.apache.camel.processor.errorhandler.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:158) > > > > at > > > org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:260) > > > > at > > org.apache.camel.processor.Pipeline$PipelineTask.run(Pipeline.java:90) > > > > at > > > org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.schedule(DefaultReactiveExecutor.java:148) > > > > at > > > org.apache.camel.impl.engine.DefaultReactiveExecutor.scheduleSync(DefaultReactiveExecutor.java:65) > > > > at > > org.apache.camel.processor.Pipeline.process(Pipeline.java:145) > > > > at > > > org.apache.camel.impl.engine.DefaultAsyncProcessorAwaitManager.process(DefaultAsyncProcessorAwaitManager.java:83) > > > > at > > > org.apache.camel.support.AsyncProcessorSupport.process(AsyncProcessorSupport.java:40) > > > > at > > > org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:260) > > > > at > > > org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:66) > > > > at > > org.apache.camel.processor.SendProcessor.process(SendProcessor.java:168) > > > > at > > > org.apache.camel.impl.engine.DefaultAsyncProcessorAwaitManager.process(DefaultAsyncProcessorAwaitManager.java:83) > > > > at > > > org.apache.camel.support.AsyncProcessorSupport.process(AsyncProcessorSupport.java:40) > > > > at > > > org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:260) > > > > at > > org.apache.camel.processor.Pipeline$PipelineTask.run(Pipeline.java:90) > > > > at > > > org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.schedule(DefaultReactiveExecutor.java:148) > > > > at > > > org.apache.camel.impl.engine.DefaultReactiveExecutor.scheduleSync(DefaultReactiveExecutor.java:65) > > > > at > > org.apache.camel.processor.Pipeline.process(Pipeline.java:145) > > > > at > > > org.apache.camel.impl.engine.DefaultAsyncProcessorAwaitManager.process(DefaultAsyncProcessorAwaitManager.java:83) > > > > at > > > org.apache.camel.support.AsyncProcessorSupport.process(AsyncProcessorSupport.java:40) > > > > at > > > org.apache.camel.jta.TransactionErrorHandler.processByErrorHandler(TransactionErrorHandler.java:242) > > > > at > > > org.apache.camel.jta.TransactionErrorHandler$1.run(TransactionErrorHandler.java:203) > > > > at > > > org.apache.camel.cdi.transaction.TransactionalJtaTransactionPolicy.runWithTransaction(TransactionalJtaTransactionPolicy.java:51) > > > > at > > > org.apache.camel.cdi.transaction.RequiredJtaTransactionPolicy.run(RequiredJtaTransactionPolicy.java:26) > > > > at > > > org.apache.camel.jta.TransactionErrorHandler.doInTransactionTemplate(TransactionErrorHandler.java:193) > > > > at > > > org.apache.camel.jta.TransactionErrorHandler.processInTransaction(TransactionErrorHandler.java:144) > > > > at > > > org.apache.camel.jta.TransactionErrorHandler.process(TransactionErrorHandler.java:108) > > > > at > > > org.apache.camel.jta.TransactionErrorHandler.process(TransactionErrorHandler.java:117) > > > > at > > > org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$SimpleTask.run(RedeliveryErrorHandler.java:395) > > > > at > > > org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.schedule(DefaultReactiveExecutor.java:148) > > > > at > > > org.apache.camel.impl.engine.DefaultReactiveExecutor.scheduleMain(DefaultReactiveExecutor.java:60) > > > > at > > org.apache.camel.processor.Pipeline.process(Pipeline.java:147) > > > > at > > > org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:286) > > > > at > > > org.apache.camel.impl.engine.DefaultAsyncProcessorAwaitManager.process(DefaultAsyncProcessorAwaitManager.java:83) > > > > at > > > org.apache.camel.support.AsyncProcessorSupport.process(AsyncProcessorSupport.java:40) > > > > at > > > org.apache.camel.component.sjms.consumer.InOnlyMessageHandler.handleMessage(InOnlyMessageHandler.java:52) > > > > at > > > org.apache.camel.component.sjms.consumer.AbstractMessageHandler.onMessage(AbstractMessageHandler.java:81) > > > > at > > > org.apache.activemq.artemis.jms.client.JMSMessageListenerWrapper.onMessage(JMSMessageListenerWrapper.java:110) > > > > at > > > org.apache.activemq.artemis.core.client.impl.ClientConsumerImpl.callOnMessage(ClientConsumerImpl.java:1030) > > > > at > > > org.apache.activemq.artemis.core.client.impl.ClientConsumerImpl.access$400(ClientConsumerImpl.java:49) > > > > at > > > org.apache.activemq.artemis.core.client.impl.ClientConsumerImpl$Runner.run(ClientConsumerImpl.java:1153) > > > > at > > > org.apache.activemq.artemis.utils.actors.OrderedExecutor.doTask(OrderedExecutor.java:42) > > > > at > > > org.apache.activemq.artemis.utils.actors.OrderedExecutor.doTask(OrderedExecutor.java:31) > > > > at > > > org.apache.activemq.artemis.utils.actors.ProcessorBase.executePendingTasks(ProcessorBase.java:65) > > > > at > > > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) > > > > at > > > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) > > > > at > > > org.apache.activemq.artemis.utils.ActiveMQThreadFactory$1.run(ActiveMQThreadFactory.java:118) > > > > Suppressed: javax.persistence.PersistenceException: > > org.hibernate.exception.SQLGrammarException: could not execute statement > > > > at > > > org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1387) > > > > at > > > org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1310) > > > > at > > > org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:1397) > > > > at > > > org.hibernate.ejb.AbstractQueryImpl.executeUpdate(AbstractQueryImpl.java:111) > > > > at > > > org.apache.deltaspike.data.impl.builder.result.QueryProcessorFactory$ExecuteUpdateQueryProcessor.executeQuery(QueryProcessorFactory.java:192) > > > > at > > > org.apache.deltaspike.data.impl.handler.CdiQueryInvocationContext.executeQuery(CdiQueryInvocationContext.java:253) > > > > at > > > org.apache.deltaspike.data.impl.builder.AnnotatedQueryBuilder.execute(AnnotatedQueryBuilder.java:51) > > > > at > > > org.apache.deltaspike.data.impl.builder.QueryBuilder.executeQuery(QueryBuilder.java:57) > > > > at > > > org.apache.deltaspike.data.impl.builder.AnnotatedQueryBuilder$$OwbNormalScopeProxy0.executeQuery(org/apache/deltaspike/data/impl/builder/AnnotatedQueryBuilder.java) > > > > at > > > org.apache.deltaspike.data.impl.tx.TransactionalQueryRunner$1.proceed(TransactionalQueryRunner.java:73) > > > > at > > > org.apache.deltaspike.jpa.impl.transaction.ResourceLocalTransactionStrategy.execute(ResourceLocalTransactionStrategy.java:130) > > > > at > > > org.apache.deltaspike.data.impl.tx.TransactionalQueryRunner.executeTransactional(TransactionalQueryRunner.java:68) > > > > at > > > org.apache.deltaspike.data.impl.tx.TransactionalQueryRunner.executeQuery(TransactionalQueryRunner.java:50) > > > > at > > > org.apache.deltaspike.data.impl.tx.TransactionalQueryRunner$$OwbNormalScopeProxy0.executeQuery(org/apache/deltaspike/data/impl/tx/TransactionalQueryRunner.java) > > > > at > > > org.apache.deltaspike.data.impl.handler.QueryHandler.process(QueryHandler.java:151) > > > > at > > > org.apache.deltaspike.data.impl.handler.QueryHandler$1.proceed(QueryHandler.java:119) > > > > at > > > org.apache.deltaspike.jpa.impl.transaction.ResourceLocalTransactionStrategy.execute(ResourceLocalTransactionStrategy.java:130) > > > > at > > > org.apache.deltaspike.data.impl.handler.QueryHandler.invoke(QueryHandler.java:111) > > > > at > > > org.apache.deltaspike.data.impl.handler.QueryHandler$$OwbNormalScopeProxy0.invoke(org/apache/deltaspike/data/impl/handler/QueryHandler.java) > > > > at > > > org.apache.deltaspike.proxy.spi.invocation.DeltaSpikeProxyInvocationHandler.proceed(DeltaSpikeProxyInvocationHandler.java:97) > > > > at > > > org.apache.deltaspike.proxy.spi.invocation.DeltaSpikeProxyInvocationContext.proceed(DeltaSpikeProxyInvocationContext.java:101) > > > > at > > > org.apache.deltaspike.jpa.impl.transaction.ResourceLocalTransactionStrategy.execute(ResourceLocalTransactionStrategy.java:130) > > > > at > > > org.apache.deltaspike.jpa.impl.transaction.TransactionalInterceptor.executeInTransaction(TransactionalInterceptor.java:57) > > > > at > > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > > > at > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > > > > at > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > > > > at > > java.lang.reflect.Method.invoke(Method.java:498) > > > > at > > > org.apache.webbeans.component.InterceptorBean.intercept(InterceptorBean.java:136) > > > > at > > > org.apache.deltaspike.proxy.spi.invocation.DeltaSpikeProxyInvocationContext.proceed(DeltaSpikeProxyInvocationContext.java:80) > > > > at > > > org.apache.deltaspike.proxy.spi.invocation.DeltaSpikeProxyInvocationHandler.invoke(DeltaSpikeProxyInvocationHandler.java:63) > > > > at > > > org.apache.deltaspike.proxy.spi.invocation.DeltaSpikeProxyInvocationHandler$$OwbNormalScopeProxy0.invoke(org/apache/deltaspike/proxy/spi/invocation/DeltaSpikeProxyInvocationHandler.java) > > > > at > > > com.kaltire.mix.tirelodge.dao.StorageRecordRepository$$DSPartialBeanProxy.updateStorageRecord(Unknown > > Source) > > > > at > > > com.kaltire.mix.tirelodge.camel.beans.EventProcessor.process(EventProcessor.java:96) > > > > at > > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > > > at > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > > > > at > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > > > > at > > java.lang.reflect.Method.invoke(Method.java:498) > > > > at > > > org.apache.webbeans.intercept.AbstractInvocationContext.directProceed(AbstractInvocationContext.java:113) > > > > at > > > org.apache.webbeans.intercept.AbstractInvocationContext.proceed(AbstractInvocationContext.java:106) > > > > at > > > org.apache.webbeans.intercept.InterceptorInvocationContext.proceed(InterceptorInvocationContext.java:67) > > > > at > > > org.apache.deltaspike.jpa.impl.transaction.ResourceLocalTransactionStrategy.execute(ResourceLocalTransactionStrategy.java:130) > > > > at > > > org.apache.deltaspike.jpa.impl.transaction.TransactionalInterceptor.executeInTransaction(TransactionalInterceptor.java:57) > > > > at > > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > > > at > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > > > > at > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > > > > at > > java.lang.reflect.Method.invoke(Method.java:498) > > > > at > > > org.apache.webbeans.component.InterceptorBean.intercept(InterceptorBean.java:136) > > > > at > > > org.apache.webbeans.intercept.InterceptorInvocationContext.proceed(InterceptorInvocationContext.java:63) > > > > at > > > org.apache.webbeans.intercept.DefaultInterceptorHandler.invoke(DefaultInterceptorHandler.java:139) > > > > at > > > com.kaltire.mix.tirelodge.camel.beans.EventProcessor$$OwbInterceptProxy0.process(com/kaltire/mix/tirelodge/camel/beans/EventProcessor.java) > > > > at > > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > > > at > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > > > > at > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > > > > at > > java.lang.reflect.Method.invoke(Method.java:498) > > > > at > > > org.apache.camel.support.ObjectHelper.invokeMethodSafe(ObjectHelper.java:209) > > > > at > > org.apache.camel.component.bean.MethodInfo.invoke(MethodInfo.java:421) > > > > at > > > org.apache.camel.component.bean.MethodInfo$1.doProceed(MethodInfo.java:242) > > > > at > > org.apache.camel.component.bean.MethodInfo$1.proceed(MethodInfo.java:213) > > > > at > > > org.apache.camel.component.bean.AbstractBeanProcessor.process(AbstractBeanProcessor.java:154) > > > > at > > > org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:56) > > > > at > > > org.apache.camel.management.DefaultInstrumentationProcessor.process(DefaultInstrumentationProcessor.java:91) > > > > at > > > org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$RedeliveryTask.doRun(RedeliveryErrorHandler.java:702) > > > > at > > > org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$RedeliveryTask.run(RedeliveryErrorHandler.java:616) > > > > ... 72 common frames omitted > > > > Caused by: org.hibernate.exception.SQLGrammarException: > > could not execute statement > > > > at > > > org.hibernate.exception.internal.SQLExceptionTypeDelegate.convert(SQLExceptionTypeDelegate.java:82) > > > > at > > > org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:49) > > > > at > > > org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:124) > > > > at > > > org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:109) > > > > at > > > org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:189) > > > > at > > > org.hibernate.engine.query.spi.NativeSQLQueryPlan.performExecuteUpdate(NativeSQLQueryPlan.java:204) > > > > at > > > org.hibernate.internal.SessionImpl.executeNativeUpdate(SessionImpl.java:1238) > > > > at > > org.hibernate.internal.SQLQueryImpl.executeUpdate(SQLQueryImpl.java:401) > > > > at > > org.hibernate.ejb.QueryImpl.internalExecuteUpdate(QueryImpl.java:198) > > > > at > > > org.hibernate.ejb.AbstractQueryImpl.executeUpdate(AbstractQueryImpl.java:102) > > > > ... 131 common frames omitted > > > > Caused by: java.sql.SQLSyntaxErrorException: Table > > 'KTDN_TM.badTable doesn't exist > > > > at > > > com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120) > > > > at > > > com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97) > > > > at > > > com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122) > > > > at > > > com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:953) > > > > at > > > com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:1092) > > > > at > > > com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:1040) > > > > at > > > com.mysql.cj.jdbc.ClientPreparedStatement.executeLargeUpdate(ClientPreparedStatement.java:1347) > > > > at > > > com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdate(ClientPreparedStatement.java:1025) > > > > at > > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > > > at > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > > > > at > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > > > > at > > java.lang.reflect.Method.invoke(Method.java:498) > > > > at > > > org.apache.tomcat.jdbc.pool.StatementFacade$StatementProxy.invoke(StatementFacade.java:114) > > > > at > > com.sun.proxy.$Proxy238.executeUpdate(Unknown Source) > > > > at > > > org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:186) > > > > ... 136 common frames omitted > > > > > > > > Updating the pom.xml to use Camel 3.5.0 I see multiple entries like this > > during the boot (16 times to be exact): > > > > > > > > 2020-09-08 10:24:00.174 [http-nio-8081-exec-4] WARN > > o.a.c.c.t.TransactionalJtaTransactionPolicy - Could not find the > > transaction manager through java:/TransactionManager > > > > > > > > Then this (same stacktrace and message) 5 times: > > > > > > > > 2020-09-08 11:53:23.487 [Thread-0 (ActiveMQ-client] WARN > > o.a.c.jta.TransactionErrorHandler - Transaction rollback (0x41543024) > > redelivered(true) for (MessageId: ID:07638789-f1fb-11ea-b2f4-564c8aece8ca > > on ExchangeId: ID-Kal030841-1599591203098-0-2) caught: null > > > > 2020-09-08 11:53:23.496 [Thread-0 (ActiveMQ-client] ERROR > > o.a.c.jta.TransactionErrorHandler - Failed delivery for (MessageId: > > ID:07638789-f1fb-11ea-b2f4-564c8aece8ca on ExchangeId: > > ID-Kal030841-1599591203098-0-2). Exhausted after delivery attempt: 1 > > caught: java.lang.NullPointerException > > > > > > > > Message History (complete message history is disabled) > > > > > > > --------------------------------------------------------------------------------------------------------------------------------------- > > > > RouteId ProcessorId > > Processor > > Elapsed (ms) > > > > [easybook-events ] [easybook-events ] > > > [from[sjms://topic:kt.mix.easybook.events?durableSubscriptionId=tire-lodge-dev&] > > [ 31] > > > > ... > > > > [easybook-events ] [transacted1 ] > > [transacted > > ] [ 0] > > > > > > > > Stacktrace > > > > > > > --------------------------------------------------------------------------------------------------------------------------------------- > > > > > > > > java.lang.NullPointerException: null > > > > at > > > org.apache.camel.cdi.transaction.TransactionalJtaTransactionPolicy.hasActiveTransaction(TransactionalJtaTransactionPolicy.java:114) > > > > at > > > org.apache.camel.cdi.transaction.RequiredJtaTransactionPolicy.run(RequiredJtaTransactionPolicy.java:26) > > > > at > > > org.apache.camel.jta.TransactionErrorHandler.doInTransactionTemplate(TransactionErrorHandler.java:186) > > > > at > > > org.apache.camel.jta.TransactionErrorHandler.processInTransaction(TransactionErrorHandler.java:137) > > > > at > > > org.apache.camel.jta.TransactionErrorHandler.process(TransactionErrorHandler.java:101) > > > > at > > > org.apache.camel.jta.TransactionErrorHandler.process(TransactionErrorHandler.java:110) > > > > at > > > org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$SimpleTask.run(RedeliveryErrorHandler.java:404) > > > > at > > > org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.schedule(DefaultReactiveExecutor.java:148) > > > > at > > > org.apache.camel.impl.engine.DefaultReactiveExecutor.scheduleMain(DefaultReactiveExecutor.java:60) > > > > at > > org.apache.camel.processor.Pipeline.process(Pipeline.java:147) > > > > at > > > org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:287) > > > > at > > > org.apache.camel.impl.engine.DefaultAsyncProcessorAwaitManager.process(DefaultAsyncProcessorAwaitManager.java:83) > > > > at > > > org.apache.camel.support.AsyncProcessorSupport.process(AsyncProcessorSupport.java:41) > > > > at > > > org.apache.camel.component.sjms.consumer.InOnlyMessageHandler.handleMessage(InOnlyMessageHandler.java:53) > > > > at > > > org.apache.camel.component.sjms.consumer.AbstractMessageHandler.onMessage(AbstractMessageHandler.java:81) > > > > at > > > org.apache.activemq.artemis.jms.client.JMSMessageListenerWrapper.onMessage(JMSMessageListenerWrapper.java:110) > > > > at > > > org.apache.activemq.artemis.core.client.impl.ClientConsumerImpl.callOnMessage(ClientConsumerImpl.java:1030) > > > > at > > > org.apache.activemq.artemis.core.client.impl.ClientConsumerImpl.access$400(ClientConsumerImpl.java:49) > > > > at > > > org.apache.activemq.artemis.core.client.impl.ClientConsumerImpl$Runner.run(ClientConsumerImpl.java:1153) > > > > at > > > org.apache.activemq.artemis.utils.actors.OrderedExecutor.doTask(OrderedExecutor.java:42) > > > > at > > > org.apache.activemq.artemis.utils.actors.OrderedExecutor.doTask(OrderedExecutor.java:31) > > > > at > > > org.apache.activemq.artemis.utils.actors.ProcessorBase.executePendingTasks(ProcessorBase.java:65) > > > > at > > > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) > > > > at > > > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) > > > > at > > > org.apache.activemq.artemis.utils.ActiveMQThreadFactory$1.run(ActiveMQThreadFactory.java:118) > > > > > > > > And then JMS message disappears from the topic. > > > > Note when using 3.4.5 message stays unacknowledged, I will stick to > 3.4.5 > > for now… Please let me know if you need any more info. > > > > > > > > Cheers, > > > > Dmitry > > > > > > > > > > > > *From:* Shultz, Dmitry > > *Sent:* Wednesday, September 2, 2020 9:17 PM > > *To:* Zheng Feng <zf...@redhat.com>; users@camel.apache.org > > *Subject:* Re: CDI + SJMS + transacted > > > > > > > > You are right, I forgot to specify transacted=true on the endpoint uri... > > > > To be exact I looked at all the places (even changed the AMQ connection > > URL :) except this probably because for some stupid reason wishfully > > thought the .transacted() on the route is enough for the component to set > > it true automagically. > > > > The interesting thing is that it worked (infinite redeliveries) - message > > was not committed to the broker (not lost) without the URI change just by > > using the JTA error handler builder (comes with CDI component). Now it > > works even with no redeliveries configured at all, but they are never > > stopping (do there is some good automation already:) > > ------------------------------ > > > > *From:* Zheng Feng <zf...@redhat.com> > > *Sent:* 01 September 2020 23:09 > > *To:* users@camel.apache.org <users@camel.apache.org> > > *Subject:* Re: CDI + SJMS + transacted > > > > > > > > Yeah, TomEE could provide the "java:/TransactionManager" since it is a > J2EE > > container. I wonder if you use the "transacted=true" option on the sjms > > consumer which will rollback the transaction if the router is failed. > > > > > > On Tue, Sep 1, 2020 at 4:35 AM Shultz, Dmitry <dmitry_shu...@kaltire.com > > > > wrote: > > > > > Thanks for the reply Zheng. > > > > > > I'm running very similar code in the TomEE and It doesn't fail on NPE. > > See > > > similar behaviour though: > > > > > > [Thread-0 (ActiveMQ-client] WARN o.a.c.jta.TransactionErrorHandler - > > > Transaction rollback (0x30730302) redelivered(false) for (MessageId: > > > ID:9fd77209-ebc6-11ea-955a-1ee7171b8787 on ExchangeId: > > > ID-Kal030841-1598904862181-0-2) caught: test > > > > > > And after process restart the message is gone. > > > > > > I can confirm that when I use infinite re-delivery (the error handler > > > never exhausted) the message stays in the durable topic as forever even > > > after restart. So, I'm not sure if my expectation are correct i.e. does > > it > > > supposed to stay in the topic after error handler redeliveries are > > > exhausted? > > > > > > Cheers, > > > Dmitry > > > > > > > > > -----Original Message----- > > > From: Zheng Feng [mailto:zf...@redhat.com <zf...@redhat.com>] > > > Sent: Sunday, August 30, 2020 8:58 AM > > > To: users@camel.apache.org > > > Subject: Re: CDI + SJMS + transacted > > > > > > Hi Dmitry, > > > > > > It seems that SJMS [1] currently only supports the use of internal JMS > > > Transactions. There is no support for the Camel Transaction Processor > or > > > the Java Transaction API (JTA). Also if you want to use the JTA > > transaction > > > provided by the camel-cdi, the TransactionManager should be available > via > > > JNDI "java:/TransactionManager". Then you are running the camel in the > > > standalone environment, and the transaction manager should be provided > by > > > the third party implementation, such as Narayana ( you can find the jta > > > standalone example here [2]). The NPE I think should be fixed by > > > CAMEL-14918 [3], and I will try to backport it to the 3.4.x > > > > > > Regards, > > > Zheng Feng > > > > > > [1] > > > > > > https://urldefense.com/v3/__https://camel.apache.org/components/latest/sjms-component.html__;!!LdWlNaMnLCM!OJ-X6YfRy0exjKJ8PNWy-d5aHbD6mgnBfTRZXXKak6kEojLVTmcKwcF4puKY9P1BTwqO$ > <https://urldefense.com/v3/__https:/camel.apache.org/components/latest/sjms-component.html__;!!LdWlNaMnLCM!OJ-X6YfRy0exjKJ8PNWy-d5aHbD6mgnBfTRZXXKak6kEojLVTmcKwcF4puKY9P1BTwqO$> > > < > https://urldefense.com/v3/__https:/camel.apache.org/components/latest/sjms-component.html__;!!LdWlNaMnLCM!OJ-X6YfRy0exjKJ8PNWy-d5aHbD6mgnBfTRZXXKak6kEojLVTmcKwcF4puKY9P1BTwqO$ > > > > > [2] > > > > > > https://urldefense.com/v3/__https://github.com/jbosstm/quickstart/tree/master/jta-1_2-standalone__;!!LdWlNaMnLCM!OJ-X6YfRy0exjKJ8PNWy-d5aHbD6mgnBfTRZXXKak6kEojLVTmcKwcF4puKY9Py3UShj$ > <https://urldefense.com/v3/__https:/github.com/jbosstm/quickstart/tree/master/jta-1_2-standalone__;!!LdWlNaMnLCM!OJ-X6YfRy0exjKJ8PNWy-d5aHbD6mgnBfTRZXXKak6kEojLVTmcKwcF4puKY9Py3UShj$> > > < > https://urldefense.com/v3/__https:/github.com/jbosstm/quickstart/tree/master/jta-1_2-standalone__;!!LdWlNaMnLCM!OJ-X6YfRy0exjKJ8PNWy-d5aHbD6mgnBfTRZXXKak6kEojLVTmcKwcF4puKY9Py3UShj$ > > > > > [3] > > > > > > > > > https://urldefense.com/v3/__https://github.com/apache/camel/commit/4421b2bba294dd8828621684c7670f78d811ecd8*diff-773b20d331dac13fb17acfa0f58ac01f__;Iw!!LdWlNaMnLCM!OJ-X6YfRy0exjKJ8PNWy-d5aHbD6mgnBfTRZXXKak6kEojLVTmcKwcF4puKY9F_CLTBw$ > <https://urldefense.com/v3/__https:/github.com/apache/camel/commit/4421b2bba294dd8828621684c7670f78d811ecd8*diff-773b20d331dac13fb17acfa0f58ac01f__;Iw!!LdWlNaMnLCM!OJ-X6YfRy0exjKJ8PNWy-d5aHbD6mgnBfTRZXXKak6kEojLVTmcKwcF4puKY9F_CLTBw$> > > < > https://urldefense.com/v3/__https:/github.com/apache/camel/commit/4421b2bba294dd8828621684c7670f78d811ecd8*diff-773b20d331dac13fb17acfa0f58ac01f__;Iw!!LdWlNaMnLCM!OJ-X6YfRy0exjKJ8PNWy-d5aHbD6mgnBfTRZXXKak6kEojLVTmcKwcF4puKY9F_CLTBw$ > > > > > > > > On Sat, Aug 29, 2020 at 5:50 AM Shultz, Dmitry < > > dmitry_shu...@kaltire.com> > > > wrote: > > > > > > > Hi All, > > > > > > > > I'm probably doing something wrong/stupid, but I can't get the sjms > > > > (recent Camel, but same true for 2.25.2) to leave failed messages in > > > > the JMS topic (AMQ Artemis) after exception. > > > > This is what logged: > > > > > > > > [ctiveMQ-client-global-threads)] TransactionErrorHandler WARN > > > > Transaction rollback (0x5cd1283) redelivered(false) for (MessageId: > > > > ID:bbaa590d-e975-11ea-9ad0-6c4b902fc0e1 on ExchangeId: > > > > ID-Kal030841-1598650245838-0-1) caught: null > > > > [ctiveMQ-client-global-threads)] TransactionErrorHandler WARN > > > > Transaction rollback (0x5cd1283) redelivered(false) for (MessageId: > > > > ID:bbaa590d-e975-11ea-9ad0-6c4b902fc0e1 on ExchangeId: > > > > ID-Kal030841-1598650245838-0-1) caught: null > > > > [ctiveMQ-client-global-threads)] TransactionErrorHandler WARN > > > > Transaction rollback (0x5cd1283) redelivered(false) for (MessageId: > > > > ID:bbaa590d-e975-11ea-9ad0-6c4b902fc0e1 on ExchangeId: > > > > ID-Kal030841-1598650245838-0-1) caught: null > > > > [ctiveMQ-client-global-threads)] TransactionErrorHandler ERROR > > > > Failed delivery for (MessageId: > > > > ID:bbaa590d-e975-11ea-9ad0-6c4b902fc0e1 on > > > > ExchangeId: ID-Kal030841-1598650245838-0-1). Exhausted after delivery > > > > attempt: 3 caught: java.lang.NullPointerException > > > > > > > > Message History (complete message history is disabled) > > > > > > > > > > > > > > --------------------------------------------------------------------------------------------------------------------------------------- > > > > RouteId ProcessorId Processor > > > > Elapsed (ms) > > > > [route1 ] [route1 ] > > > > [from[sjms://topic:topic:test?durableSubscriptionId=dmitr] [ > 1999] > > > > ... > > > > [route1 ] [transacted1 ] [transacted > > > > ] [ 0] > > > > > > > > Stacktrace > > > > > > > > > ---------------------------------------------------------------------- > > > > ----------------------------------------------------------------- > > > > > > > > java.lang.NullPointerException: null > > > > at > > > > > org.apache.camel.cdi.transaction.TransactionalJtaTransactionPolicy.has > > > > ActiveTransaction(TransactionalJtaTransactionPolicy.java:105) > > > > ~[camel-cdi-3.4.3.jar:3.4.3] > > > > at > > > > > org.apache.camel.cdi.transaction.RequiredJtaTransactionPolicy.run(Requ > > > > iredJtaTransactionPolicy.java:26) > > > > ~[camel-cdi-3.4.3.jar:3.4.3] > > > > at > > > > > org.apache.camel.jta.TransactionErrorHandler.doInTransactionTemplate(T > > > > ransactionErrorHandler.java:193) > > > > ~[camel-jta-3.4.3.jar:3.4.3] > > > > at > > > > > org.apache.camel.jta.TransactionErrorHandler.processInTransaction(Tran > > > > sactionErrorHandler.java:144) > > > > ~[camel-jta-3.4.3.jar:3.4.3] > > > > at > > > > > org.apache.camel.jta.TransactionErrorHandler.process(TransactionErrorH > > > > andler.java:108) > > > > ~[camel-jta-3.4.3.jar:3.4.3] > > > > at > > > > > org.apache.camel.jta.TransactionErrorHandler.process(TransactionErrorH > > > > andler.java:117) > > > > ~[camel-jta-3.4.3.jar:3.4.3] > > > > at > > > > > org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$Redeliv > > > > eryTask.redeliver(RedeliveryErrorHandler.java:766) > > > > ~[camel-base-3.4.3.jar:3.4.3] > > > > at > > > > > org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.schedule(D > > > > efaultReactiveExecutor.java:148) > > > > ~[camel-base-3.4.3.jar:3.4.3] > > > > at > > > > > org.apache.camel.impl.engine.DefaultReactiveExecutor.scheduleMain(Defa > > > > ultReactiveExecutor.java:60) > > > > ~[camel-base-3.4.3.jar:3.4.3] > > > > at > > > > org.apache.camel.processor.Pipeline.process(Pipeline.java:147) > > > > ~[camel-base-3.4.3.jar:3.4.3] > > > > at > > > > > org.apache.camel.processor.CamelInternalProcessor.process(CamelInterna > > > > lProcessor.java:286) > > > > ~[camel-base-3.4.3.jar:3.4.3] > > > > at > > > > > org.apache.camel.impl.engine.DefaultAsyncProcessorAwaitManager.process > > > > (DefaultAsyncProcessorAwaitManager.java:83) > > > > ~[camel-base-3.4.3.jar:3.4.3] > > > > at > > > > > org.apache.camel.support.AsyncProcessorSupport.process(AsyncProcessorS > > > > upport.java:40) > > > > ~[camel-support-3.4.3.jar:3.4.3] > > > > at > > > > > org.apache.camel.component.sjms.consumer.InOnlyMessageHandler.handleMe > > > > ssage(InOnlyMessageHandler.java:52) > > > > ~[camel-sjms-3.4.3.jar:3.4.3] > > > > at > > > > > org.apache.camel.component.sjms.consumer.AbstractMessageHandler.onMess > > > > age(AbstractMessageHandler.java:81) > > > > ~[camel-sjms-3.4.3.jar:3.4.3] > > > > at > > > > > org.apache.activemq.artemis.jms.client.JMSMessageListenerWrapper.onMes > > > > sage(JMSMessageListenerWrapper.java:110) > > > > ~[artemis-jms-client-2.14.0.jar:2.14.0] > > > > at > > > > > org.apache.activemq.artemis.core.client.impl.ClientConsumerImpl.callOn > > > > Message(ClientConsumerImpl.java:1030) > > > > ~[artemis-core-client-2.14.0.jar:2.14.0] > > > > > > > > So, it looks like rollback is kicked off, but when I restart the > > > > process message is gone from the JMS topic. > > > > > > > > Sample reproducer (generated using > > > > -DarchetypeArtifactId=camel-archetype-cdi as described here > > > > > https://urldefense.com/v3/__https://camel.apache.org/components/latest > <https://urldefense.com/v3/__https:/camel.apache.org/components/latest> > > <https://urldefense.com/v3/__https:/camel.apache.org/components/latest> > > > > > /others/cdi.html__;!!LdWlNaMnLCM!OJ-X6YfRy0exjKJ8PNWy-d5aHbD6mgnBfTRZX > > > > XKak6kEojLVTmcKwcF4puKY9NnrgwcA$ ) is here > > > > > https://urldefense.com/v3/__https://github.com/zeppelinux/CamelCDISjms > <https://urldefense.com/v3/__https:/github.com/zeppelinux/CamelCDISjms> > > <https://urldefense.com/v3/__https:/github.com/zeppelinux/CamelCDISjms> > > > > > > Test__;!!LdWlNaMnLCM!OJ-X6YfRy0exjKJ8PNWy-d5aHbD6mgnBfTRZXXKak6kEojLVT > > > > mcKwcF4puKY9HBU5Opk$ > > > > Please have a look. > > > > > > > > Cheers, > > > > Dmitry > > > > > > > > > > >