You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "javier (JIRA)" <ji...@apache.org> on 2009/11/19 20:29:39 UTC

[jira] Created: (CXF-2550) transactions don't work in jaxws Endpoint with jms transport

transactions don't work in jaxws Endpoint  with jms transport
-------------------------------------------------------------

                 Key: CXF-2550
                 URL: https://issues.apache.org/jira/browse/CXF-2550
             Project: CXF
          Issue Type: Bug
          Components: Transports
    Affects Versions: 2.2.4
            Reporter: javier


i'm trying cxf with jms transport with transaction to process a message and it is dequeued  when the implementor object  throw an error .

the message is inonly and the code is:

	EndpointImpl endpoint = new EndpointImpl(new ObjectImpl());
	endpoint.setAddress("jms://");
        ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("tcp://localhost:61616");
        JMSConfiguration jmsConfig = new JMSConfiguration();

        jmsConfig.setConnectionFactory(connectionFactory);
        jmsConfig.setTargetDestination("sso2");
	jmsConfig.setSessionTransacted(true);
	jmsConfig.setPubSubDomain(false);
	jmsConfig.setUseJms11(true);
	jmsConfig.setTransactionManager(new JmsTransactionManager(connectionFactory));

	JMSConfigFeature jmsConfigFeature = new JMSConfigFeature();
	jmsConfigFeature.setJmsConfig(jmsConfig);
	endpoint.getFeatures().add(jmsConfigFeature);
	endpoint.publish();

seems that the exception never arrive to  AbstractMessageListenerContainer.doExecuteListener but it is catched inside

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Reopened: (CXF-2550) transactions don't work in jaxws Endpoint with jms transport

Posted by "javier (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-2550?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

javier reopened CXF-2550:
-------------------------


hi Daniel,

now the exceptions are propagated and transactions works fine when we are using a transaction manager (JmsTransactionManager or JtaTransactionManager) for transactional wrapping of message but they aren't  propagated if we use sessionTransacted = true and transactionManager = null (just local transactions of activemq)



> transactions don't work in jaxws Endpoint  with jms transport
> -------------------------------------------------------------
>
>                 Key: CXF-2550
>                 URL: https://issues.apache.org/jira/browse/CXF-2550
>             Project: CXF
>          Issue Type: Bug
>          Components: Transports
>    Affects Versions: 2.2.4, 2.2.5
>            Reporter: javier
>            Assignee: Daniel Kulp
>             Fix For: 2.1.9, 2.2.6
>
>         Attachments: jms_queue.zip
>
>
> i'm trying cxf with jms transport with transaction to process a message and it is dequeued  when the implementor object  throw an error .
> the message is inonly and the code is:
> 	EndpointImpl endpoint = new EndpointImpl(new ObjectImpl());
> 	endpoint.setAddress("jms://");
>         ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("tcp://localhost:61616");
>         JMSConfiguration jmsConfig = new JMSConfiguration();
>         jmsConfig.setConnectionFactory(connectionFactory);
>         jmsConfig.setTargetDestination("sso2");
> 	jmsConfig.setSessionTransacted(true);
> 	jmsConfig.setPubSubDomain(false);
> 	jmsConfig.setUseJms11(true);
> 	jmsConfig.setTransactionManager(new JmsTransactionManager(connectionFactory));
> 	JMSConfigFeature jmsConfigFeature = new JMSConfigFeature();
> 	jmsConfigFeature.setJmsConfig(jmsConfig);
> 	endpoint.getFeatures().add(jmsConfigFeature);
> 	endpoint.publish();
> seems that the exception never arrive to  AbstractMessageListenerContainer.doExecuteListener but it is catched inside

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CXF-2550) transactions don't work in jaxws Endpoint with jms transport

Posted by "javier (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-2550?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

javier updated CXF-2550:
------------------------

    Affects Version/s: 2.2.5

> transactions don't work in jaxws Endpoint  with jms transport
> -------------------------------------------------------------
>
>                 Key: CXF-2550
>                 URL: https://issues.apache.org/jira/browse/CXF-2550
>             Project: CXF
>          Issue Type: Bug
>          Components: Transports
>    Affects Versions: 2.2.4, 2.2.5
>            Reporter: javier
>         Attachments: jms_queue.zip
>
>
> i'm trying cxf with jms transport with transaction to process a message and it is dequeued  when the implementor object  throw an error .
> the message is inonly and the code is:
> 	EndpointImpl endpoint = new EndpointImpl(new ObjectImpl());
> 	endpoint.setAddress("jms://");
>         ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("tcp://localhost:61616");
>         JMSConfiguration jmsConfig = new JMSConfiguration();
>         jmsConfig.setConnectionFactory(connectionFactory);
>         jmsConfig.setTargetDestination("sso2");
> 	jmsConfig.setSessionTransacted(true);
> 	jmsConfig.setPubSubDomain(false);
> 	jmsConfig.setUseJms11(true);
> 	jmsConfig.setTransactionManager(new JmsTransactionManager(connectionFactory));
> 	JMSConfigFeature jmsConfigFeature = new JMSConfigFeature();
> 	jmsConfigFeature.setJmsConfig(jmsConfig);
> 	endpoint.getFeatures().add(jmsConfigFeature);
> 	endpoint.publish();
> seems that the exception never arrive to  AbstractMessageListenerContainer.doExecuteListener but it is catched inside

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (CXF-2550) transactions don't work in jaxws Endpoint with jms transport

Posted by "Daniel Kulp (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-2550?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Kulp reassigned CXF-2550:
--------------------------------

    Assignee: Daniel Kulp

> transactions don't work in jaxws Endpoint  with jms transport
> -------------------------------------------------------------
>
>                 Key: CXF-2550
>                 URL: https://issues.apache.org/jira/browse/CXF-2550
>             Project: CXF
>          Issue Type: Bug
>          Components: Transports
>    Affects Versions: 2.2.4, 2.2.5
>            Reporter: javier
>            Assignee: Daniel Kulp
>         Attachments: jms_queue.zip
>
>
> i'm trying cxf with jms transport with transaction to process a message and it is dequeued  when the implementor object  throw an error .
> the message is inonly and the code is:
> 	EndpointImpl endpoint = new EndpointImpl(new ObjectImpl());
> 	endpoint.setAddress("jms://");
>         ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("tcp://localhost:61616");
>         JMSConfiguration jmsConfig = new JMSConfiguration();
>         jmsConfig.setConnectionFactory(connectionFactory);
>         jmsConfig.setTargetDestination("sso2");
> 	jmsConfig.setSessionTransacted(true);
> 	jmsConfig.setPubSubDomain(false);
> 	jmsConfig.setUseJms11(true);
> 	jmsConfig.setTransactionManager(new JmsTransactionManager(connectionFactory));
> 	JMSConfigFeature jmsConfigFeature = new JMSConfigFeature();
> 	jmsConfigFeature.setJmsConfig(jmsConfig);
> 	endpoint.getFeatures().add(jmsConfigFeature);
> 	endpoint.publish();
> seems that the exception never arrive to  AbstractMessageListenerContainer.doExecuteListener but it is catched inside

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CXF-2550) transactions don't work in jaxws Endpoint with jms transport

Posted by "Daniel Kulp (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-2550?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12780902#action_12780902 ] 

Daniel Kulp commented on CXF-2550:
----------------------------------


Can I ask what version of ActiveMQ?   There is definitely a bug in 5.2 around the transaction stuff.   We couldn't use 5.2 in our unit tests due to the transaction tests failing.   5.3 did fix it and 5.1 worked fine as well.

> transactions don't work in jaxws Endpoint  with jms transport
> -------------------------------------------------------------
>
>                 Key: CXF-2550
>                 URL: https://issues.apache.org/jira/browse/CXF-2550
>             Project: CXF
>          Issue Type: Bug
>          Components: Transports
>    Affects Versions: 2.2.4
>            Reporter: javier
>
> i'm trying cxf with jms transport with transaction to process a message and it is dequeued  when the implementor object  throw an error .
> the message is inonly and the code is:
> 	EndpointImpl endpoint = new EndpointImpl(new ObjectImpl());
> 	endpoint.setAddress("jms://");
>         ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("tcp://localhost:61616");
>         JMSConfiguration jmsConfig = new JMSConfiguration();
>         jmsConfig.setConnectionFactory(connectionFactory);
>         jmsConfig.setTargetDestination("sso2");
> 	jmsConfig.setSessionTransacted(true);
> 	jmsConfig.setPubSubDomain(false);
> 	jmsConfig.setUseJms11(true);
> 	jmsConfig.setTransactionManager(new JmsTransactionManager(connectionFactory));
> 	JMSConfigFeature jmsConfigFeature = new JMSConfigFeature();
> 	jmsConfigFeature.setJmsConfig(jmsConfig);
> 	endpoint.getFeatures().add(jmsConfigFeature);
> 	endpoint.publish();
> seems that the exception never arrive to  AbstractMessageListenerContainer.doExecuteListener but it is catched inside

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CXF-2550) transactions don't work in jaxws Endpoint with jms transport

Posted by "javier (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-2550?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

javier updated CXF-2550:
------------------------

    Fix Version/s:     (was: 2.2.6)
                       (was: 2.1.9)
                   2.2.7

> transactions don't work in jaxws Endpoint  with jms transport
> -------------------------------------------------------------
>
>                 Key: CXF-2550
>                 URL: https://issues.apache.org/jira/browse/CXF-2550
>             Project: CXF
>          Issue Type: Bug
>          Components: Transports
>    Affects Versions: 2.2.4, 2.2.5
>            Reporter: javier
>            Assignee: Daniel Kulp
>             Fix For: 2.2.7
>
>         Attachments: jms_queue.zip
>
>
> i'm trying cxf with jms transport with transaction to process a message and it is dequeued  when the implementor object  throw an error .
> the message is inonly and the code is:
> 	EndpointImpl endpoint = new EndpointImpl(new ObjectImpl());
> 	endpoint.setAddress("jms://");
>         ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("tcp://localhost:61616");
>         JMSConfiguration jmsConfig = new JMSConfiguration();
>         jmsConfig.setConnectionFactory(connectionFactory);
>         jmsConfig.setTargetDestination("sso2");
> 	jmsConfig.setSessionTransacted(true);
> 	jmsConfig.setPubSubDomain(false);
> 	jmsConfig.setUseJms11(true);
> 	jmsConfig.setTransactionManager(new JmsTransactionManager(connectionFactory));
> 	JMSConfigFeature jmsConfigFeature = new JMSConfigFeature();
> 	jmsConfigFeature.setJmsConfig(jmsConfig);
> 	endpoint.getFeatures().add(jmsConfigFeature);
> 	endpoint.publish();
> seems that the exception never arrive to  AbstractMessageListenerContainer.doExecuteListener but it is catched inside

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CXF-2550) transactions don't work in jaxws Endpoint with jms transport

Posted by "javier (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-2550?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

javier updated CXF-2550:
------------------------

    Attachment: jms_queue.zip

project with TransactionSample class to test error using transactions

> transactions don't work in jaxws Endpoint  with jms transport
> -------------------------------------------------------------
>
>                 Key: CXF-2550
>                 URL: https://issues.apache.org/jira/browse/CXF-2550
>             Project: CXF
>          Issue Type: Bug
>          Components: Transports
>    Affects Versions: 2.2.4
>            Reporter: javier
>         Attachments: jms_queue.zip
>
>
> i'm trying cxf with jms transport with transaction to process a message and it is dequeued  when the implementor object  throw an error .
> the message is inonly and the code is:
> 	EndpointImpl endpoint = new EndpointImpl(new ObjectImpl());
> 	endpoint.setAddress("jms://");
>         ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("tcp://localhost:61616");
>         JMSConfiguration jmsConfig = new JMSConfiguration();
>         jmsConfig.setConnectionFactory(connectionFactory);
>         jmsConfig.setTargetDestination("sso2");
> 	jmsConfig.setSessionTransacted(true);
> 	jmsConfig.setPubSubDomain(false);
> 	jmsConfig.setUseJms11(true);
> 	jmsConfig.setTransactionManager(new JmsTransactionManager(connectionFactory));
> 	JMSConfigFeature jmsConfigFeature = new JMSConfigFeature();
> 	jmsConfigFeature.setJmsConfig(jmsConfig);
> 	endpoint.getFeatures().add(jmsConfigFeature);
> 	endpoint.publish();
> seems that the exception never arrive to  AbstractMessageListenerContainer.doExecuteListener but it is catched inside

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CXF-2550) transactions don't work in jaxws Endpoint with jms transport

Posted by "javier (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-2550?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12781302#action_12781302 ] 

javier commented on CXF-2550:
-----------------------------

hi daniel,

i'm using activemq 5.3, so i've attached a project to show you the error, please have a look


> transactions don't work in jaxws Endpoint  with jms transport
> -------------------------------------------------------------
>
>                 Key: CXF-2550
>                 URL: https://issues.apache.org/jira/browse/CXF-2550
>             Project: CXF
>          Issue Type: Bug
>          Components: Transports
>    Affects Versions: 2.2.4
>            Reporter: javier
>         Attachments: jms_queue.zip
>
>
> i'm trying cxf with jms transport with transaction to process a message and it is dequeued  when the implementor object  throw an error .
> the message is inonly and the code is:
> 	EndpointImpl endpoint = new EndpointImpl(new ObjectImpl());
> 	endpoint.setAddress("jms://");
>         ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("tcp://localhost:61616");
>         JMSConfiguration jmsConfig = new JMSConfiguration();
>         jmsConfig.setConnectionFactory(connectionFactory);
>         jmsConfig.setTargetDestination("sso2");
> 	jmsConfig.setSessionTransacted(true);
> 	jmsConfig.setPubSubDomain(false);
> 	jmsConfig.setUseJms11(true);
> 	jmsConfig.setTransactionManager(new JmsTransactionManager(connectionFactory));
> 	JMSConfigFeature jmsConfigFeature = new JMSConfigFeature();
> 	jmsConfigFeature.setJmsConfig(jmsConfig);
> 	endpoint.getFeatures().add(jmsConfigFeature);
> 	endpoint.publish();
> seems that the exception never arrive to  AbstractMessageListenerContainer.doExecuteListener but it is catched inside

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (CXF-2550) transactions don't work in jaxws Endpoint with jms transport

Posted by "javier (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-2550?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12904522#action_12904522 ] 

javier edited comment on CXF-2550 at 8/31/10 1:46 AM:
------------------------------------------------------

Hi Daniel,

Is it possible modify JMSDestination. Modify the onMessage method to propagate the exception without consider TransactionManager. Throw the exception to Spring if there is an exception. "Local resource transactions can simply be activated through the sessionTransacted " according http://static.springsource.org/spring/docs/2.5.x/reference/jms.html. Can work with local resource transaction or with a transaction manager. 

instead 
{code:xml} 
            //need to propagate any exceptions back to Spring container 
            //so transactions can occur
            if (inMessage.getContent(Exception.class) != null && session != null) {
            	
     
            	PlatformTransactionManager m = jmsConfig.getTransactionManager();
                if (m != null) {
                    TransactionStatus status = m.getTransaction(null);
                    JmsResourceHolder resourceHolder =
                        (JmsResourceHolder) TransactionSynchronizationManager
                            .getResource(jmsConfig.getConnectionFactory());
                    boolean trans = resourceHolder == null 
                        || !resourceHolder.containsSession(session);
                    if (status != null && !status.isCompleted() && trans) {
                        Exception ex = inMessage.getContent(Exception.class);
                        if (ex.getCause() instanceof RuntimeException) {
                            throw (RuntimeException)ex.getCause();
                        } else {
                            throw new RuntimeException(ex);
                        }
                    }
                }
            }
{code} 

use

{code:xml} 
            //need to propagate any exceptions back to Spring container 
            //so transactions can occur
            if (inMessage.getContent(Exception.class) != null && session != null) {
            	
                Exception ex = inMessage.getContent(Exception.class);
                if (ex.getCause() instanceof RuntimeException) {
                    throw (RuntimeException)ex.getCause();
                } else {
                    throw new RuntimeException(ex);
                }
            }
{code} 


      was (Author: javier):
    Hi Daniel,

Is it possible modify JMSDestination. Modify the onMessage method to propagate the exception without consider TransactionManager. Throw the exception to Spring if there is an exception. "Local resource transactions can simply be activated through the sessionTransacted " according http://static.springsource.org/spring/docs/2.5.x/reference/jms.html. Can work with local resource transaction or with a transaction manager. 

instead 

            //need to propagate any exceptions back to Spring container 
            //so transactions can occur
            if (inMessage.getContent(Exception.class) != null && session != null) {
            	
     
            	PlatformTransactionManager m = jmsConfig.getTransactionManager();
                if (m != null) {
                    TransactionStatus status = m.getTransaction(null);
                    JmsResourceHolder resourceHolder =
                        (JmsResourceHolder) TransactionSynchronizationManager
                            .getResource(jmsConfig.getConnectionFactory());
                    boolean trans = resourceHolder == null 
                        || !resourceHolder.containsSession(session);
                    if (status != null && !status.isCompleted() && trans) {
                        Exception ex = inMessage.getContent(Exception.class);
                        if (ex.getCause() instanceof RuntimeException) {
                            throw (RuntimeException)ex.getCause();
                        } else {
                            throw new RuntimeException(ex);
                        }
                    }
                }
            }


use


            //need to propagate any exceptions back to Spring container 
            //so transactions can occur
            if (inMessage.getContent(Exception.class) != null && session != null) {
            	
                Exception ex = inMessage.getContent(Exception.class);
                if (ex.getCause() instanceof RuntimeException) {
                    throw (RuntimeException)ex.getCause();
                } else {
                    throw new RuntimeException(ex);
                }
            }


  
> transactions don't work in jaxws Endpoint  with jms transport
> -------------------------------------------------------------
>
>                 Key: CXF-2550
>                 URL: https://issues.apache.org/jira/browse/CXF-2550
>             Project: CXF
>          Issue Type: Bug
>          Components: Transports
>    Affects Versions: 2.2.4, 2.2.5
>            Reporter: javier
>            Assignee: Daniel Kulp
>         Attachments: jms_queue.zip
>
>
> i'm trying cxf with jms transport with transaction to process a message and it is dequeued  when the implementor object  throw an error .
> the message is inonly and the code is:
> 	EndpointImpl endpoint = new EndpointImpl(new ObjectImpl());
> 	endpoint.setAddress("jms://");
>         ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("tcp://localhost:61616");
>         JMSConfiguration jmsConfig = new JMSConfiguration();
>         jmsConfig.setConnectionFactory(connectionFactory);
>         jmsConfig.setTargetDestination("sso2");
> 	jmsConfig.setSessionTransacted(true);
> 	jmsConfig.setPubSubDomain(false);
> 	jmsConfig.setUseJms11(true);
> 	jmsConfig.setTransactionManager(new JmsTransactionManager(connectionFactory));
> 	JMSConfigFeature jmsConfigFeature = new JMSConfigFeature();
> 	jmsConfigFeature.setJmsConfig(jmsConfig);
> 	endpoint.getFeatures().add(jmsConfigFeature);
> 	endpoint.publish();
> seems that the exception never arrive to  AbstractMessageListenerContainer.doExecuteListener but it is catched inside

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (CXF-2550) transactions don't work in jaxws Endpoint with jms transport

Posted by "Daniel Kulp (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-2550?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Kulp resolved CXF-2550.
------------------------------

       Resolution: Fixed
    Fix Version/s: 2.2.6
                   2.1.9

> transactions don't work in jaxws Endpoint  with jms transport
> -------------------------------------------------------------
>
>                 Key: CXF-2550
>                 URL: https://issues.apache.org/jira/browse/CXF-2550
>             Project: CXF
>          Issue Type: Bug
>          Components: Transports
>    Affects Versions: 2.2.4, 2.2.5
>            Reporter: javier
>            Assignee: Daniel Kulp
>             Fix For: 2.1.9, 2.2.6
>
>         Attachments: jms_queue.zip
>
>
> i'm trying cxf with jms transport with transaction to process a message and it is dequeued  when the implementor object  throw an error .
> the message is inonly and the code is:
> 	EndpointImpl endpoint = new EndpointImpl(new ObjectImpl());
> 	endpoint.setAddress("jms://");
>         ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("tcp://localhost:61616");
>         JMSConfiguration jmsConfig = new JMSConfiguration();
>         jmsConfig.setConnectionFactory(connectionFactory);
>         jmsConfig.setTargetDestination("sso2");
> 	jmsConfig.setSessionTransacted(true);
> 	jmsConfig.setPubSubDomain(false);
> 	jmsConfig.setUseJms11(true);
> 	jmsConfig.setTransactionManager(new JmsTransactionManager(connectionFactory));
> 	JMSConfigFeature jmsConfigFeature = new JMSConfigFeature();
> 	jmsConfigFeature.setJmsConfig(jmsConfig);
> 	endpoint.getFeatures().add(jmsConfigFeature);
> 	endpoint.publish();
> seems that the exception never arrive to  AbstractMessageListenerContainer.doExecuteListener but it is catched inside

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CXF-2550) transactions don't work in jaxws Endpoint with jms transport

Posted by "javier (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-2550?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12904522#action_12904522 ] 

javier commented on CXF-2550:
-----------------------------

Hi Daniel,

Is it possible modify JMSDestination. Modify the onMessage method to propagate the exception without consider TransactionManager. Throw the exception to Spring if there is an exception. "Local resource transactions can simply be activated through the sessionTransacted " according http://static.springsource.org/spring/docs/2.5.x/reference/jms.html. Can work with local resource transaction or with a transaction manager. 

instead 

            //need to propagate any exceptions back to Spring container 
            //so transactions can occur
            if (inMessage.getContent(Exception.class) != null && session != null) {
            	
     
            	PlatformTransactionManager m = jmsConfig.getTransactionManager();
                if (m != null) {
                    TransactionStatus status = m.getTransaction(null);
                    JmsResourceHolder resourceHolder =
                        (JmsResourceHolder) TransactionSynchronizationManager
                            .getResource(jmsConfig.getConnectionFactory());
                    boolean trans = resourceHolder == null 
                        || !resourceHolder.containsSession(session);
                    if (status != null && !status.isCompleted() && trans) {
                        Exception ex = inMessage.getContent(Exception.class);
                        if (ex.getCause() instanceof RuntimeException) {
                            throw (RuntimeException)ex.getCause();
                        } else {
                            throw new RuntimeException(ex);
                        }
                    }
                }
            }


use


            //need to propagate any exceptions back to Spring container 
            //so transactions can occur
            if (inMessage.getContent(Exception.class) != null && session != null) {
            	
                Exception ex = inMessage.getContent(Exception.class);
                if (ex.getCause() instanceof RuntimeException) {
                    throw (RuntimeException)ex.getCause();
                } else {
                    throw new RuntimeException(ex);
                }
            }



> transactions don't work in jaxws Endpoint  with jms transport
> -------------------------------------------------------------
>
>                 Key: CXF-2550
>                 URL: https://issues.apache.org/jira/browse/CXF-2550
>             Project: CXF
>          Issue Type: Bug
>          Components: Transports
>    Affects Versions: 2.2.4, 2.2.5
>            Reporter: javier
>            Assignee: Daniel Kulp
>         Attachments: jms_queue.zip
>
>
> i'm trying cxf with jms transport with transaction to process a message and it is dequeued  when the implementor object  throw an error .
> the message is inonly and the code is:
> 	EndpointImpl endpoint = new EndpointImpl(new ObjectImpl());
> 	endpoint.setAddress("jms://");
>         ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("tcp://localhost:61616");
>         JMSConfiguration jmsConfig = new JMSConfiguration();
>         jmsConfig.setConnectionFactory(connectionFactory);
>         jmsConfig.setTargetDestination("sso2");
> 	jmsConfig.setSessionTransacted(true);
> 	jmsConfig.setPubSubDomain(false);
> 	jmsConfig.setUseJms11(true);
> 	jmsConfig.setTransactionManager(new JmsTransactionManager(connectionFactory));
> 	JMSConfigFeature jmsConfigFeature = new JMSConfigFeature();
> 	jmsConfigFeature.setJmsConfig(jmsConfig);
> 	endpoint.getFeatures().add(jmsConfigFeature);
> 	endpoint.publish();
> seems that the exception never arrive to  AbstractMessageListenerContainer.doExecuteListener but it is catched inside

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.