This forum is my only hope, still fighting with the transaction issue. I have
attached the zip file with all the code that i have. I did exactly what you
suggested but the sendSync() never returned back. It just hang there, then I
changed it to send () method call . It comes back because it is an async
call.

Bean class never received any done or error message . 

Jut trying to understand could be there some other way to define this class
instead of extending from messageExchangeListener.  Transaction with
MessageExchangeListener class ever worked for anyone?

Here is little background of the usage of bean class, I am using it to parse
incoming soap message and set to HTTP_DESTINATION_URI so that at runtime I
can set location URI of httpconsumer. I know somehow i have to use recipient
list instead of pipeline to make this scenaro works. But for now I am just
trying to make sure transaction works with my bean class with fixed HTTP
location URI. then I will move to next



Here are my log 

010-04-22 15:57:52,308 | 15:57:52,308 | INFO  | x-bean-thread-21 |
RouterBean                       | com.pf.eipconsumer.RouterBean     126 |
channel send done
2010-04-22 15:57:52,340 | 15:57:52,340 | ERROR | x-http-thread-15 |
HttpComponent                    | icemix.common.AsyncBaseLifeCycle  509 |
Transaction is still active after exchange processing. Trying to rollback
transaction.
2010-04-22 15:57:52,340 | 15:57:52,340 | ERROR | mix-eip-thread-4 |
EIPComponent                     | icemix.common.AsyncBaseLifeCycle  480 |
Error processing exchange
org.apache.servicemix.jbi.runtime.impl.inonlyi...@1a07e15
javax.jbi.messaging.MessagingException:
javax.transaction.InvalidTransactionException: Specified transaction is
already associated with another thread
        at
org.apache.servicemix.common.EndpointDeliveryChannel.resumeTx(EndpointDeliveryChannel.java:137)
        at
org.apache.servicemix.common.EndpointDeliveryChannel.sendSync(EndpointDeliveryChannel.java:118)
        at
org.apache.servicemix.common.endpoints.SimpleEndpoint.sendSync(SimpleEndpoint.java:74)
        at
org.apache.servicemix.eip.patterns.Pipeline.processSync(Pipeline.java:246)
        at org.apache.servicemix.eip.EIPEndpoint.process(EIPEndpoint.java:183)
        at
org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:627)
        at
org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:581)
        at
org.apache.servicemix.common.AsyncBaseLifeCycle.processExchangeInTx(AsyncBaseLifeCycle.java:478)
        at
org.apache.servicemix.common.AsyncBaseLifeCycle$2.run(AsyncBaseLifeCycle.java:347)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:619)
Caused by: javax.transaction.InvalidTransactionException: Specified
transaction is already associated with another thread
        at
org.apache.geronimo.transaction.manager.TransactionManagerImpl.associate(TransactionManagerImpl.java:114)
        at
org.apache.geronimo.transaction.manager.TransactionManagerImpl.resume(TransactionManagerImpl.java:183)
        at sun.reflect.GeneratedMethodAccessor189.invoke(Unknown Source)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at
org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:64)
        at
org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:78)
        at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
        at
org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
        at
org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
        at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
        at
org.springframework.osgi.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:59)
        at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
        at
org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
        at
org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
        at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
        at
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
        at $Proxy23.resume(Unknown Source)
        at
org.apache.servicemix.common.EndpointDeliveryChannel.resumeTx(EndpointDeliveryChannel.java:135)
        ... 11 more
2010-04-22 15:57:52,340 | 15:57:52,340 | ERROR | pool-5-thread-2  |
JcaConsumerProcessor             | mix.jms.jca.JcaConsumerProcessor  117 |
Error while handling jms message
java.lang.IllegalStateException: Cannot set rollback only, status is
STATUS_NO_TRANSACTION
        at
org.apache.geronimo.transaction.manager.TransactionImpl.setRollbackOnly(TransactionImpl.java:140)
        at
org.apache.geronimo.transaction.manager.TransactionManagerImpl.setRollbackOnly(TransactionManagerImpl.java:236)
        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:597)
        at
org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:64)
        at
org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:78)
        at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
        at
org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
        at
org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
        at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
        at
org.springframework.osgi.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:59)
        at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
        at
org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
        at
org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
        at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
        at
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
        at $Proxy23.setRollbackOnly(Unknown Source)
        at
org.apache.servicemix.jms.jca.JcaConsumerProcessor.process(JcaConsumerProcessor.java:133)
        at
org.apache.servicemix.jms.jca.JcaConsumerProcessor.onMessage(JcaConsumerProcessor.java:111)
        at org.jencks.XAEndpoint.onMessage(XAEndpoint.java:129)
        at
org.apache.activemq.ra.MessageEndpointProxy$MessageEndpointAlive.onMessage(MessageEndpointProxy.java:123)
        at
org.apache.activemq.ra.MessageEndpointProxy.onMessage(MessageEndpointProxy.java:64)
        at org.apache.activemq.ActiveMQSession.run(ActiveMQSession.java:735)
        at 
org.apache.activemq.ra.ServerSessionImpl.run(ServerSessionImpl.java:169)
        at
org.apache.geronimo.connector.work.WorkerContext.run(WorkerContext.java:290)
        at
org.apache.geronimo.connector.work.pool.NamedRunnable.run(NamedRunnable.java:32)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:619)
2010-04-22 15:57:52,340 | 15:57:52,340 | WARN  | pool-5-thread-2  |
ServerSessionImpl:0              | he.activemq.ra.ServerSessionImpl  234 |
Local transaction had not been commited. Commiting now.
2010-04-22 15:57:52,340 | 15:57:52,340 | INFO  | pool-5-thread-2  |
ServerSessionImpl:0              | he.activemq.ra.ServerSessionImpl  177 |
Endpoint failed to process message. Reason: Endpoint after delivery
notification failure



iocanel wrote:
> 
> Hi granda,
> 
> I think that it should go like this:
> 
>                        public void onMessage(MessageExchange exchange)
> throws MessagingException {
>                        // Here is the part that handles the exchange
> received from Jms Consumer
>                        if (exchange instanceof InOut &&
> exchange.getStatus() == ExchangeStatus.ACTIVE) {
>                                 channel.sendSync(exchange);                   
>   
>                         }
>                         //You receive the exchange from the Web Service
> with DONE status
>                          else if (exchange instanceof InOut &&
> exchange.getStatus() == ExchangeStatus.DONE) {                                
>                                
>                                  log.info("inside DONE block");
>                                  // You can also add here your fault
> auditing.
>                                 channel.send(exchange); 
>                         }
>                         //If the exhcange is with status ERROR
>                         else if (exchange.getStatus() ==
> ExchangeStatus.ERROR) { 
>                                 log.info("inside ERROR block"); 
>                                 channel.send(exchange); 
>                         }
>                         //In all other cases (which means not InOut
> Exchange, you should throw error 
>                         else throw new IllegalStateException();
> }
> 
> If this doesn't work for you (then I prolly missed something so please
> send me your assembly to further investigate.
> 
> Hope it helps.
> 
http://old.nabble.com/file/p28334196/eipconsumer.zip eipconsumer.zip 
-- 
View this message in context: 
http://old.nabble.com/smx4-javax.transaction.InvalidTransactionException%3A-tp28287860p28334196.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Reply via email to