Antw: Re: Problem with NamedXAResource.

2017-12-17 Thread alexander.sahler
Hi Benjamin!

Thank you very much! That's indeed solved the issue.

Best, Alexander


>>> 
> 
Hi Alexander,
you didn't name your JMS XA resource. Set a name property at 
JcaPooledConnectionFactory e.g. amq. That should solve this Exception
Regards,
Benjamin

Am 15.12.2017 um 16:41 schrieb alexander.sah...@brodos.de:


Hi there.

Following the description on http://cxf.apache.org/docs/jms-transactions.html, 
I set up a JMS XA transaction together with pax-jdbc datasource in karaf 4.1.2.

The datasource looks like this:

osgi.jdbc.driver.name = mariadb
dataSourceName = jmsTest
databaseName = test
user = test
password = test
pool = aries
xa = true
url = jdbc:mariadb://172.17.42.50:3309/test?characterEncoding=UTF-8

the jms config is like this (blueprint.xml):


























However, I still get an exception when committing the transaction:

2017-12-15T15:31:02,989 | ERROR | 
DefaultQuartzScheduler-com.brodos.example.jmstest.jmsTest-service-quartzCamelPublisher_Worker-4
 | Transaction | 216 - org.apache.aries.transaction.manager - 1.3.3 | Please 
correct the integration and supply a NamedXAResource
java.lang.IllegalStateException: Cannot log transactions as 
TransactionContext{transactionId=null,connection=ActiveMQConnection{id=ID:dbserver-p2-46845-1513344298542-9:2,clientId=ID:dbserver-p2-46845-1513344298542-8:1,started=false}}
 is not a NamedXAResource.
at 
org.apache.geronimo.transaction.manager.TransactionImpl$TransactionBranch.getResourceName(TransactionImpl.java:781)
 [216:org.apache.aries.transaction.manager:1.3.3]
at org.apache.geronimo.transaction.log.HOWLLog.prepare(HOWLLog.java:287) 
[216:org.apache.aries.transaction.manager:1.3.3]
at 
org.apache.geronimo.transaction.manager.TransactionImpl.internalPrepare(TransactionImpl.java:467)
 [216:org.apache.aries.transaction.manager:1.3.3]
at 
org.apache.geronimo.transaction.manager.TransactionImpl.commit(TransactionImpl.java:312)
 [216:org.apache.aries.transaction.manager:1.3.3]
at 
org.apache.geronimo.transaction.manager.TransactionManagerImpl.commit(TransactionManagerImpl.java:252)
 [216:org.apache.aries.transaction.manager:1.3.3]
at Proxy288c74b2_e728_4a18_9e5f_69dd12784603.commit(Unknown Source) [?:?]
at 
org.apache.aries.transaction.TransactionAttribute$5.finish(TransactionAttribute.java:138)
 [215:org.apache.aries.transaction.blueprint:2.1.0]
at 
org.apache.aries.transaction.TxInterceptorImpl.postCallWithReturn(TxInterceptorImpl.java:105)
 [215:org.apache.aries.transaction.blueprint:2.1.0]
at 
org.apache.aries.blueprint.proxy.SingleInterceptorCollaborator.postInvoke(SingleInterceptorCollaborator.java:76)
 [11:org.apache.aries.blueprint.core:1.8.2]
at Proxy1e31f2f9_b5f0_4b21_b4f7_80d8cf3712a1.publishNotifications(Unknown 
Source) [?:?]
at 
com.brodos.jmsconurrent.service.notification.NotificationBatchProcessor.publishNotifications(NotificationBatchProcessor.java:46)
 [194:com.brodos.example.jmstest.jmsTest-service:1.0.0.SNAPSHOT]
at sun.reflect.GeneratedMethodAccessor250.invoke(Unknown Source) ~[?:?]
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:497) ~[?:?]
at org.apache.camel.component.bean.MethodInfo.invoke(MethodInfo.java:472) 
[21:org.apache.camel.camel-core:2.19.2]
at org.apache.camel.component.bean.MethodInfo$1.doProceed(MethodInfo.java:291) 
[21:org.apache.camel.camel-core:2.19.2]
at org.apache.camel.component.bean.MethodInfo$1.proceed(MethodInfo.java:264) 
[21:org.apache.camel.camel-core:2.19.2]
at 
org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:178) 
[21:org.apache.camel.camel-core:2.19.2]
at org.apache.camel.component.bean.BeanProducer.process(BeanProducer.java:41) 
[21:org.apache.camel.camel-core:2.19.2]
at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:145) 
[21:org.apache.camel.camel-core:2.19.2]
at 
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:77)
 [21:org.apache.camel.camel-core:2.19.2]
...

I'm using JPA/2.6.1 feature and hibernate 5.2.10.Final as persistence provider.

Could anyone please give a hint what's wrong here?

Best,
Alexander
 



Re: Problem with NamedXAResource.

2017-12-16 Thread Benjamin Graf
Hi Alexander,

you didn't name your JMS XA resource. Set a name property at
JcaPooledConnectionFactory e.g. amq. That should solve this Exception

Regards,

Benjamin


Am 15.12.2017 um 16:41 schrieb alexander.sah...@brodos.de:
> Hi there.
>
> Following the description on
> http://cxf.apache.org/docs/jms-transactions.html, I set up a JMS XA
> transaction together with pax-jdbc datasource in karaf 4.1.2.
>
> The datasource looks like this:
>
> osgi.jdbc.driver.name = mariadb
> dataSourceName = jmsTest
> databaseName = test
> user = test
> password = test
> pool = aries
> xa = true
> url = jdbc:mariadb://172.17.42.50:3309/test?characterEncoding=UTF-8
>
> the jms config is like this (blueprint.xml):
>
>         interface="javax.transaction.TransactionManager" />
>
>      class="org.apache.activemq.ActiveMQXAConnectionFactory">
>     
>     
>     
>
>      class="org.apache.activemq.jms.pool.JcaPooledConnectionFactory"
>     init-method="start" destroy-method="stop">
>     
>     
>     
>     
>
>      class="org.apache.activemq.camel.component.ActiveMQConfiguration">
>     
>     
>     
>     
>     
>     
>
>      class="org.apache.activemq.camel.component.ActiveMQComponent" >
>     
>     
>
> However, I still get an exception when committing the transaction:
>
> 2017-12-15T15:31:02,989 | ERROR |
> DefaultQuartzScheduler-com.brodos.example.jmstest.jmsTest-service-quartzCamelPublisher_Worker-4
> | Transaction  | 216 -
> org.apache.aries.transaction.manager - 1.3.3 | Please correct the
> integration and supply a NamedXAResource
> java.lang.IllegalStateException: Cannot log transactions as
> TransactionContext{transactionId=null,connection=ActiveMQConnection
> {id=ID:dbserver-p2-46845-1513344298542-9:2,clientId=ID:dbserver-p2-46845-1513344298542-8:1,started=false}}
> is not a NamedXAResource.
>     at
> org.apache.geronimo.transaction.manager.TransactionImpl$TransactionBranch.getResourceName(TransactionImpl.java:781)
> [216:org.apache.aries.transaction.manager:1.3.3]
>     at
> org.apache.geronimo.transaction.log.HOWLLog.prepare(HOWLLog.java:287)
> [216:org.apache.aries.transaction.manager:1.3.3]
>     at
> org.apache.geronimo.transaction.manager.TransactionImpl.internalPrepare(TransactionImpl.java:467)
> [216:org.apache.aries.transaction.manager:1.3.3]
>     at
> org.apache.geronimo.transaction.manager.TransactionImpl.commit(TransactionImpl.java:312)
> [216:org.apache.aries.transaction.manager:1.3.3]
>     at
> org.apache.geronimo.transaction.manager.TransactionManagerImpl.commit(TransactionManagerImpl.java:252)
> [216:org.apache.aries.transaction.manager:1.3.3]
>     at Proxy288c74b2_e728_4a18_9e5f_69dd12784603.commit(Unknown
> Source) [?:?]
>     at
> org.apache.aries.transaction.TransactionAttribute$5.finish(TransactionAttribute.java:138)
> [215:org.apache.aries.transaction.blueprint:2.1.0]
>     at
> org.apache.aries.transaction.TxInterceptorImpl.postCallWithReturn(TxInterceptorImpl.java:105)
> [215:org.apache.aries.transaction.blueprint:2.1.0]
>     at
> org.apache.aries.blueprint.proxy.SingleInterceptorCollaborator.postInvoke(SingleInterceptorCollaborator.java:76)
> [11:org.apache.aries.blueprint.core:1.8.2]
>     at
> Proxy1e31f2f9_b5f0_4b21_b4f7_80d8cf3712a1.publishNotifications(Unknown
> Source) [?:?]
>     at
> com.brodos.jmsconurrent.service.notification.NotificationBatchProcessor.publishNotifications(NotificationBatchProcessor.java:46)
> [194:com.brodos.example.jmstest.jmsTest-service:1.0.0.SNAPSHOT]
>     at sun.reflect.GeneratedMethodAccessor250.invoke(Unknown
> Source) ~[?:?]
>     at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> ~[?:?]
>     at java.lang.reflect.Method.invoke(Method.java:497) ~[?:?]
>     at
> org.apache.camel.component.bean.MethodInfo.invoke(MethodInfo.java:472)
> [21:org.apache.camel.camel-core:2.19.2]
>     at
> org.apache.camel.component.bean.MethodInfo$1.doProceed(MethodInfo.java:291)
> [21:org.apache.camel.camel-core:2.19.2]
>     at
> org.apache.camel.component.bean.MethodInfo$1.proceed(MethodInfo.java:264)
> [21:org.apache.camel.camel-core:2.19.2]
>     at
> org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:178)
> [21:org.apache.camel.camel-core:2.19.2]
>     at
> org.apache.camel.component.bean.BeanProducer.process(BeanProducer.java:41)
> [21:org.apache.camel.camel-core:2.19.2]
>     at
> org.apache.camel.processor.SendProcessor.process(SendProcessor.java:145)
> [21:org.apache.camel.camel-core:2.19.2]
>     at
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:77)
> [21:org.apache.camel.camel-core:2.19.2]
> ...
>
> I'm using JPA/2.6.1 feature and hibernate 5.2.10.Final as persistence
> provider.
>
> Could anyone please give a hint what's wrong here?
>
> Best,
> Alexander



signature.asc
Descripti

Problem with NamedXAResource.

2017-12-15 Thread alexander.sahler
Hi there.

Following the description on http://cxf.apache.org/docs/jms-transactions.html, 
I set up a JMS XA transaction together with pax-jdbc datasource in karaf 4.1.2.

The datasource looks like this:

osgi.jdbc.driver.name = mariadb
dataSourceName = jmsTest
databaseName = test
user = test
password = test
pool = aries
xa = true
url = jdbc:mariadb://172.17.42.50:3309/test?characterEncoding=UTF-8

the jms config is like this (blueprint.xml):


























However, I still get an exception when committing the transaction:

2017-12-15T15:31:02,989 | ERROR | 
DefaultQuartzScheduler-com.brodos.example.jmstest.jmsTest-service-quartzCamelPublisher_Worker-4
 | Transaction   | 216 - 
org.apache.aries.transaction.manager - 1.3.3 | Please correct the integration 
and supply a NamedXAResource
java.lang.IllegalStateException: Cannot log transactions as 
TransactionContext{transactionId=null,connection=ActiveMQConnection 
{id=ID:dbserver-p2-46845-1513344298542-9:2,clientId=ID:dbserver-p2-46845-1513344298542-8:1,started=false}}
 is not a NamedXAResource.
at 
org.apache.geronimo.transaction.manager.TransactionImpl$TransactionBranch.getResourceName(TransactionImpl.java:781)
 [216:org.apache.aries.transaction.manager:1.3.3]
at 
org.apache.geronimo.transaction.log.HOWLLog.prepare(HOWLLog.java:287) 
[216:org.apache.aries.transaction.manager:1.3.3]
at 
org.apache.geronimo.transaction.manager.TransactionImpl.internalPrepare(TransactionImpl.java:467)
 [216:org.apache.aries.transaction.manager:1.3.3]
at 
org.apache.geronimo.transaction.manager.TransactionImpl.commit(TransactionImpl.java:312)
 [216:org.apache.aries.transaction.manager:1.3.3]
at 
org.apache.geronimo.transaction.manager.TransactionManagerImpl.commit(TransactionManagerImpl.java:252)
 [216:org.apache.aries.transaction.manager:1.3.3]
at Proxy288c74b2_e728_4a18_9e5f_69dd12784603.commit(Unknown Source) 
[?:?]
at 
org.apache.aries.transaction.TransactionAttribute$5.finish(TransactionAttribute.java:138)
 [215:org.apache.aries.transaction.blueprint:2.1.0]
at 
org.apache.aries.transaction.TxInterceptorImpl.postCallWithReturn(TxInterceptorImpl.java:105)
 [215:org.apache.aries.transaction.blueprint:2.1.0]
at 
org.apache.aries.blueprint.proxy.SingleInterceptorCollaborator.postInvoke(SingleInterceptorCollaborator.java:76)
 [11:org.apache.aries.blueprint.core:1.8.2]
at 
Proxy1e31f2f9_b5f0_4b21_b4f7_80d8cf3712a1.publishNotifications(Unknown Source) 
[?:?]
at 
com.brodos.jmsconurrent.service.notification.NotificationBatchProcessor.publishNotifications(NotificationBatchProcessor.java:46)
 [194:com.brodos.example.jmstest.jmsTest-service:1.0.0.SNAPSHOT]
at sun.reflect.GeneratedMethodAccessor250.invoke(Unknown Source) 
~[?:?]
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:497) ~[?:?]
at 
org.apache.camel.component.bean.MethodInfo.invoke(MethodInfo.java:472) 
[21:org.apache.camel.camel-core:2.19.2]
at 
org.apache.camel.component.bean.MethodInfo$1.doProceed(MethodInfo.java:291) 
[21:org.apache.camel.camel-core:2.19.2]
at 
org.apache.camel.component.bean.MethodInfo$1.proceed(MethodInfo.java:264) 
[21:org.apache.camel.camel-core:2.19.2]
at 
org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:178) 
[21:org.apache.camel.camel-core:2.19.2]
at 
org.apache.camel.component.bean.BeanProducer.process(BeanProducer.java:41) 
[21:org.apache.camel.camel-core:2.19.2]
at 
org.apache.camel.processor.SendProcessor.process(SendProcessor.java:145) 
[21:org.apache.camel.camel-core:2.19.2]
at 
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:77)
 [21:org.apache.camel.camel-core:2.19.2]
...

I'm using JPA/2.6.1 feature and hibernate 5.2.10.Final as persistence provider.

Could anyone please give a hint what's wrong here?

Best,
Alexander