Return-Path: Delivered-To: apmail-camel-users-archive@www.apache.org Received: (qmail 27425 invoked from network); 3 Jul 2009 14:01:22 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 3 Jul 2009 14:01:22 -0000 Received: (qmail 15326 invoked by uid 500); 3 Jul 2009 14:01:32 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 15265 invoked by uid 500); 3 Jul 2009 14:01:32 -0000 Mailing-List: contact users-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@camel.apache.org Delivered-To: mailing list users@camel.apache.org Received: (qmail 15255 invoked by uid 99); 3 Jul 2009 14:01:32 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Jul 2009 14:01:32 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of cmoulliard@gmail.com designates 209.85.220.209 as permitted sender) Received: from [209.85.220.209] (HELO mail-fx0-f209.google.com) (209.85.220.209) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Jul 2009 14:01:20 +0000 Received: by fxm5 with SMTP id 5so2047717fxm.20 for ; Fri, 03 Jul 2009 07:00:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=W8RCEMYjH7+C4p5wPhfQQHc4k7/QQL6YwjhwVMzuddM=; b=G+JZ49OAc354tF2ZnN5cvCAAItc6VyePRrcZMTX3m5sOZER8fy3wjN0a9Q/cV9LF8f dK6OXc5a+rlsv1/vailQ7HxlcvPPT7Mxt8Zs+GZMgsK7vbSnXzlp+8hUcKGF9ywAR0sV /b7Pq4CVO8xF55u5uN0Uh3zh4bnXJrOG2g3+U= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=MX43MZKVzqTRAx44pgqZPR3q4yzh7Nwzngfg7oDBYcTJjhfISGKTaMYQDTCS2DK8dv U2/1uh4v3P7UkKH269DrGDmR6ESgx/nEDseklJFrQti91YttWTrf2AOTM+FtIzNAq0CO ur6hjcIKGxkF0wtDYEgdsLqcD/NVUtf0B8VSk= MIME-Version: 1.0 Received: by 10.103.246.1 with SMTP id y1mr804735mur.120.1246629658157; Fri, 03 Jul 2009 07:00:58 -0700 (PDT) In-Reply-To: References: <5380c69c0907030125o57e67894pfae2a4a0a779032@mail.gmail.com> <5380c69c0907030126p6efec456m747b8c93d7ec5ff8@mail.gmail.com> <5380c69c0907030328n446f8072mc2a1a4e167a35e4e@mail.gmail.com> Date: Fri, 3 Jul 2009 16:00:58 +0200 Message-ID: Subject: Re: Error using Transacted with Camel 2.0 From: Charles Moulliard To: users@camel.apache.org Content-Type: multipart/alternative; boundary=0016367ed58ff0e5ff046dcd958d X-Virus-Checked: Checked by ClamAV on apache.org --0016367ed58ff0e5ff046dcd958d Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit After verification, it appears that the message has not been redelivered. So, only one record is created in the DB. What I try to do is based on the camel test example : apache-camel-source\components\camel-spring\src\test\java\org\apache\camel\spring\interceptor\TransactionalClientDataSourceTest.java where error is generated in the second bean called and rollback is done on records created by bean 1. The message is saved in the DB when the following bean is called : CreateRequest do the following : // Instantiate the Request class Request request = new Request(); // Add the CSV records to the body field, ... request.setMessageContent(body.getBytes()); request.setFileName(fileName); request.setRequestType(messageType); // Set the status request.setRequestStatus(ProcessingStatusType.NEW.getValue()); // Save the request in the DB this.requestService.saveRequest(request); The service requestService is injected by Spring and is transactional : PROPAGATION_REQUIRED Charles Moulliard Senior Enterprise Architect Apache Camel Committer ***************************** blog : http://cmoulliard.blogspot.com On Fri, Jul 3, 2009 at 3:52 PM, Guillaume Nodet wrote: > If the message is redelivered, this means there is a rollback. > I guess the problem is that your DB is not enlisted in the transaction. > However, if you don't want to use XA and two phase commit, you should > try to perform the database step as late as possible so that there is very > few > chances that anything wrong happen after the data has been written to the > DB. > Btw, in your route, I don't see at which step the message is written > to the DB ... ? > > On Fri, Jul 3, 2009 at 15:26, Charles Moulliard > wrote: > > I have created a small route without JMS stuff. > > > > Here is the route : > > > > > > > > > > > > file > > > > > > OINP > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Unfortunately when a throw error is generated in bean called > "generateError" > > > > public void generateError() { > > throw new IllegalArgumentException("Generate error to test > > rollback"); > > } > > > > records are committed in the DB and not rollbacked > > > > > > I see that when the error is throw the message is redelivered a second > time > > as this parameter has been defined in the ActiveMq > > > > > > * * > > > > > > > class="org.apache.activemq.ActiveMQConnectionFactory"> > > > > > > > > > > Question : Why policy defined in the ActiveMq is taken into account here > ? > > Why the rollback does not occur ? > > > > Charles Moulliard > > Senior Enterprise Architect > > Apache Camel Committer > > > > ***************************** > > blog : http://cmoulliard.blogspot.com > > > > > > On Fri, Jul 3, 2009 at 12:28 PM, Claus Ibsen > wrote: > > > >> On Fri, Jul 3, 2009 at 12:16 PM, Guillaume Nodet > wrote: > >> > In this case, you should not use transactions for the DB at all, but > >> > if any error occurs while saving the data, an exception should be > >> > thrown and should rollback the transaction for the JMS layer. > >> Yeah that would be perfect unless he does some work afterwards the DB > >> and that throws an Exception. > >> Then the DB layer have already committed. > >> > >> So trying to avoid doing work after the DB layer would help. > >> > >> > >> Is this not possible? > >> But he is doing JPA/Hibernte stuff so he could grab the "session" and > >> invoke a rollback manually in case errors happen afterwards. > >> > >> > >> > >> > >> > > >> > On Fri, Jul 3, 2009 at 10:48, Charles Moulliard > >> wrote: > >> >> Claus, > >> >> > >> >> I don't want at all to use XA transaction. Correct me if I'm wrong > but > >> the > >> >> example of the documentation (Camel 2.0 - JMS Sample - part Spring > XML) > >> does > >> >> not use at all a XA driver and the message will not be removed from > the > >> >> queue if a rollback occurs in the bean MyProcessor ? > >> >> > >> >> My concern is to avoid to lost messages from a file, queues if > something > >> >> happen in one of the services called where by example we have to save > >> data > >> >> in a DB or generate a report for a client. If such errors occur, then > we > >> >> have to investigate why can't save data in DB (maybe related to a > >> connection > >> >> issue, DB shutdown, ...) or generates files (maybe due to disk full, > >> access > >> >> right, ....). Sometimes, this is related to conditions out of the > >> control of > >> >> our application but sometimes no, then we have to correct the error > and > >> >> install a new version of the code. After the restart of the > application > >> and > >> >> recovery of messages (persisted in the case of activemq), messages > will > >> be > >> >> reprocessed. > >> >> > >> >> Regards, > >> >> > >> >> Charles Moulliard > >> >> Senior Enterprise Architect > >> >> Apache Camel Committer > >> >> > >> >> ***************************** > >> >> blog : http://cmoulliard.blogspot.com > >> >> > >> >> > >> >> On Fri, Jul 3, 2009 at 10:26 AM, Claus Ibsen > >> wrote: > >> >> > >> >>> And reconsider if you need XA at all. Its slow and hard to get > setup. > >> >>> > >> >>> Try to let the DB be the last stuff you do and afterwards send the > >> >>> message to another queue for further processing in a 2nd route. > >> >>> If that is possible in your use-case. > >> >>> > >> >>> > >> >>> On Fri, Jul 3, 2009 at 10:25 AM, Claus Ibsen > >> wrote: > >> >>> > Hi > >> >>> > > >> >>> > Get it working outside OSGi, eg in a small unit test thats easy to > >> run > >> >>> > and test from within your IDE. > >> >>> > Google for JMS + hibernate + TX + XA to find some samples that > work. > >> >>> > > >> >>> > And since you use JMS + DB in the same TX you need to use XA db > >> driver. > >> >>> > > >> >>> > It can be a painful to get setup > >> >>> > > >> >>> > >> > http://coffeedrivenjava.blogspot.com/2006/08/distributed-xa-transactions-w-hibernate.html > >> >>> > > >> >>> > And you need an XA TX manager such as JOTM > >> >>> > http://jotm.ow2.org/xwiki/bin/view/Main/WebHome > >> >>> > > >> >>> > In j2ee land there was a JTA with the container that could do it. > But > >> >>> > in your OSGi container I do not know if it provides one out of the > >> >>> > box. > >> >>> > > >> >>> > > >> >>> > On Fri, Jul 3, 2009 at 10:09 AM, Charles Moulliard< > >> cmoulliard@gmail.com> > >> >>> wrote: > >> >>> >> I'm still fighting against Spring config or Camel because > Rollback > >> does > >> >>> not > >> >>> >> occur. I have been able to configure Hibernate to use the same > >> >>> >> TransactionManager as the one used by JMS > >> >>> >> > >> >>> >> Here is the different part of the config. I don't know where the > >> issue > >> >>> could > >> >>> >> be ! > >> >>> >> > >> >>> >> 1) ActiveMQ > >> >>> >> > >> >>> >> ... > >> >>> >> > >> >>> >> >> >>> >> class="org.apache.activemq.ActiveMQConnectionFactory"> > >> >>> >> /> > >> >>> >> > >> >>> >> > >> >>> >> >> >>> >> class="org.apache.activemq.pool.PooledConnectionFactoryBean"> > >> >>> >> > >> >>> >> > >> >>> >> ref="transactionManager" > >> /> > >> >>> >> >> >>> ref="activemqConnectionFactory" > >> >>> >> /> > >> >>> >> > >> >>> >> > >> >>> >> > >> >>> >> >> >>> >> class="org.apache.activemq.pool.ActiveMQResourceManager" > >> >>> >> init-method="recoverResource"> > >> >>> >> >> ref="transactionManager" /> > >> >>> >> >> >>> ref="activemqConnectionFactory" > >> >>> >> /> > >> >>> >> /> > >> >>> >> > >> >>> >> > >> >>> >> >> >>> >> interface="javax.transaction.TransactionManager" /> // This OSGI > >> service > >> >>> is > >> >>> >> published by Geronimo Transaction bundle > >> >>> >> > >> >>> >> > >> >>> >> > >> >>> >> javax.jms.ConnectionFactory > >> >>> >> > >> >>> >> > >> >>> >> > >> >>> >> > >> >>> >> > >> >>> >> > >> >>> >> 2) Camel ActiveMQComponent > >> >>> >> > >> >>> >> >> >>> >> class="org.apache.activemq.camel.component.ActiveMQComponent"> > >> >>> >> > >> >>> >> > >> >>> >> interface="javax.jms.ConnectionFactory"/> > >> // > >> >>> >> OSGI service is published by ActiveMQ service > >> >>> >> > >> >>> >> > >> >>> >> >> >>> >> > >> interface="org.springframework.transaction.PlatformTransactionManager"/> > >> >>> >> > >> >>> >> > >> >>> >> > >> >>> >> 2) Hibernate - DAO > >> >>> >> > >> >>> >> >> >>> >> > class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> > >> >>> >> > >> >>> >> > >> >>> >> > >> >>> >> > >> >>> >> > >> >>> > >> > classpath*:META-INF/com/xpectis/x3s/platform/model/*.hbm.xml > >> >>> >> > >> >>> >> > >> >>> >> > >> >>> >> > >> >>> >> > >> >>> >> >> >>> >> key="hibernate.dialect">org.hibernate.dialect.MySQLDialect > >> >>> >> true > >> >>> >> true > >> >>> >> >> >>> >> key="hibernate.cglib.use_reflection_optimizer">true > >> >>> >> 10 > >> >>> >> >> >>> >> > >> >>> > >> > key="hibernate.query.factory_class">org.hibernate.hql.classic.ClassicQueryTranslatorFactory > >> >>> >> >> >>> >> > >> >>> > >> > key="hibernate.transaction.factory_class">org.springframework.orm.hibernate3.SpringTransactionFactory > >> >>> >> > >> >>> >> > >> >>> >> > >> >>> >> > >> >>> >> > >> >>> >> > >> >>> >> Remark : To avoid the JNDI lookup issue, we use > >> springTransactionFactory > >> >>> as > >> >>> >> the TransactionFactory for Hibernate ( > >> >>> >> http://forum.springsource.org/showthread.php?p=215720) > >> >>> >> > >> >>> >> 3) Service layer > >> >>> >> > >> >>> >> Here is the definition of the service used from Camel route : > >> >>> >> > >> >>> >> >> >>> >> > >> class="com.xpectis.x3s.platform.service.impl.NotificationServiceImpl"> > >> >>> >> > >> >>> >> >> >>> >> interface="com.xpectis.x3s.platform.dao.NotificationDAO"/> > >> >>> >> > >> >>> >> > >> >>> >> > >> >>> >> > >> >>> >> > >> >>> >> >> >>> >> > >> >>> > >> > class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"> > >> >>> >> > >> >>> >> >> >>> >> > >> interface="org.springframework.transaction.PlatformTransactionManager"/> > >> >>> >> > >> >>> >> > >> >>> >> > >> >>> >> >> >>> >> parent="abstractService" > >> >>> >> > >> >>> >> > >> >>> > >> > class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"> > >> >>> >> > >> >>> >> > >> >>> >> > >> >>> >> > >> >>> >> > >> >>> >> > >> >>> >> > >> >>> >> PROPAGATION_REQUIRED > >> >>> >> > >> >>> >> > >> >>> >> > >> >>> >> > >> >>> >> 4) Route > >> >>> >> > >> >>> >> >> >>> class="org.apache.camel.processor.RedeliveryPolicy"> > >> >>> >> > >> >>> >> > >> >>> >> > >> >>> >> >> >>> >> > class="org.apache.camel.spring.spi.TransactionErrorHandlerBuilder"> > >> >>> >> >> >>> >> ref="PROPAGATION_REQUIRED"/> > >> >>> >> > >> >>> >> > >> >>> >> > >> >>> >> >> >>> >> class="org.apache.camel.spring.spi.SpringTransactionPolicy"> > >> >>> >> > >> >>> >> >> >>> >> > >> interface="org.springframework.transaction.PlatformTransactionManager"/> > >> >>> >> > >> >>> >> > >> >>> >> > >> >>> >> > >> >>> >> > >> >>> >> > >> >>> >> > >> >>> >> >> method="createNotification" > >> >>> /> > >> >>> >> /> > >> >>> >> > >> >>> >> > >> >>> >> > >> >>> >> Any ideas are welcome > >> >>> >> > >> >>> >> Regards, > >> >>> >> > >> >>> >> Charles Moulliard > >> >>> >> Senior Enterprise Architect > >> >>> >> Apache Camel Committer > >> >>> >> > >> >>> >> ***************************** > >> >>> >> blog : http://cmoulliard.blogspot.com > >> >>> >> > >> >>> >> > >> >>> >> On Thu, Jul 2, 2009 at 5:02 PM, Charles Moulliard < > >> cmoulliard@gmail.com > >> >>> >wrote: > >> >>> >> > >> >>> >>> OK. I will try to create my own Hibernate JTATransaction manager > as > >> the > >> >>> >>> existing try to perform a JNDI lookup to find the transaction > >> manager > >> >>> on > >> >>> >>> OSGI platform (inheritage from J2EE world) > >> >>> >>> > >> >>> >>> > >> >>> >>> > >> >>> > >> > http://mail-archives.apache.org/mod_mbox/servicemix-dev/200904.mbox/%3Cb23ecedc0904020615y55df4d0fhb303a2ea22df7a53@mail.gmail.com%3E > >> >>> >>> > >> >>> >>> > >> >>> >>> Charles Moulliard > >> >>> >>> Senior Enterprise Architect > >> >>> >>> Apache Camel Committer > >> >>> >>> > >> >>> >>> ***************************** > >> >>> >>> blog : http://cmoulliard.blogspot.com > >> >>> >>> > >> >>> >>> > >> >>> >>> On Thu, Jul 2, 2009 at 4:56 PM, Claus Ibsen < > claus.ibsen@gmail.com > >> > > >> >>> wrote: > >> >>> >>> > >> >>> >>>> On Thu, Jul 2, 2009 at 4:53 PM, Charles Moulliard< > >> >>> cmoulliard@gmail.com> > >> >>> >>>> wrote: > >> >>> >>>> > queueQuickFixInEndpoint is a JMS queue. > >> >>> >>>> > > >> >>> >>>> > I will add the ref to the transacted and retest > >> >>> >>>> > > >> >>> >>>> > Question : I suppose that rollback will not occur if by > example > >> JMS > >> >>> and > >> >>> >>>> DB > >> >>> >>>> > (=Hibernate) does not use the same TransactionManager and > don't > >> use > >> >>> this > >> >>> >>>> > spring class together : > >> >>> >>>> > org.springframework.transaction.PlatformTransactionManager > >> >>> >>>> Yes they must be configured to use the same TX manager. > >> >>> >>>> > >> >>> >>>> > >> >>> >>>> > > >> >>> >>>> > Regards, > >> >>> >>>> > > >> >>> >>>> > Charles Moulliard > >> >>> >>>> > Senior Enterprise Architect > >> >>> >>>> > Apache Camel Committer > >> >>> >>>> > > >> >>> >>>> > ***************************** > >> >>> >>>> > blog : http://cmoulliard.blogspot.com > >> >>> >>>> > > >> >>> >>>> > > >> >>> >>>> > On Thu, Jul 2, 2009 at 4:46 PM, Claus Ibsen < > >> claus.ibsen@gmail.com> > >> >>> >>>> wrote: > >> >>> >>>> > > >> >>> >>>> >> Transacted also have a ref attribute > >> >>> >>>> >> > >> >>> >>>> >> > >> >>> >>>> >> > >> >>> >>>> >> Is queueQuickFixInEndpoint a JMS queue? > >> >>> >>>> >> You need to use a TX manager that can do both JMS and DB. > >> >>> >>>> >> > >> >>> >>>> >> > >> >>> >>>> >> > >> >>> >>>> >> On Thu, Jul 2, 2009 at 4:31 PM, Charles Moulliard< > >> >>> cmoulliard@gmail.com > >> >>> >>>> > > >> >>> >>>> >> wrote: > >> >>> >>>> >> > I have been able to solve my problem by adding the > following > >> bean > >> >>> >>>> >> definition > >> >>> >>>> >> > : > >> >>> >>>> >> > > >> >>> >>>> >> > >> >>> >>>> >> > > class="org.apache.camel.spring.spi.SpringTransactionPolicy"> > >> >>> >>>> >> > > >> >>> >>>> >> > >> >>> >>>> >> > > >> >>> >>>> > >> >>> > >> interface="org.springframework.transaction.PlatformTransactionManager"/> > >> >>> >>>> >> > > >> >>> >>>> >> > > >> >>> >>>> >> > > >> >>> >>>> >> > and in the route > >> >>> >>>> >> > > >> >>> >>>> >> > > >> >>> >>>> >> > > >> >>> >>>> >> > > >> >>> >>>> >> > > >> >>> >>>> >> > > >> >>> >>>> >> > >> >>> >>>> method="createNotification" /> > >> >>> >>>> >> > >> method="generateError" > >> >>> /> > >> >>> >>>> >> > > >> >>> >>>> >> > > >> >>> >>>> >> > > >> >>> >>>> >> > Unfortunately, the rollback does not occur in the DB and 6 > >> >>> records > >> >>> >>>> have > >> >>> >>>> >> been > >> >>> >>>> >> > created by the method createNotification when error has > been > >> >>> raised > >> >>> >>>> by > >> >>> >>>> >> the > >> >>> >>>> >> > method generateError. > >> >>> >>>> >> > > >> >>> >>>> >> > What is missing ? > >> >>> >>>> >> > > >> >>> >>>> >> > Charles Moulliard > >> >>> >>>> >> > Senior Enterprise Architect > >> >>> >>>> >> > Apache Camel Committer > >> >>> >>>> >> > > >> >>> >>>> >> > ***************************** > >> >>> >>>> >> > blog : http://cmoulliard.blogspot.com > >> >>> >>>> >> > > >> >>> >>>> >> > > >> >>> >>>> >> > On Thu, Jul 2, 2009 at 4:19 PM, Charles Moulliard < > >> >>> >>>> cmoulliard@gmail.com > >> >>> >>>> >> >wrote: > >> >>> >>>> >> > > >> >>> >>>> >> >> When I compare the example : > >> >>> JMSTransactionalClientRollbackTest.xml > >> >>> >>>> >> >> > >> >>> >>>> >> >> > >> >>> >>>> >> >> > >> >>> >>>> >> >> >> >>> >>>> >> >> class="org.apache.activemq.ActiveMQConnectionFactory"> > >> >>> >>>> >> >> >> >>> >>>> >> >> > >> >>> >>>> > >> >>> > >> value="vm://localhost?broker.persistent=false&broker.useJmx=false"/> > >> >>> >>>> >> >> > >> >>> >>>> >> >> > >> >>> >>>> >> >> > >> >>> >>>> >> >> >> >>> >>>> >> >> > >> >>> class="org.springframework.jms.connection.JmsTransactionManager"> > >> >>> >>>> >> >> >> >>> >>>> ref="jmsConnectionFactory"/> > >> >>> >>>> >> >> > >> >>> >>>> >> >> > >> >>> >>>> >> >> > >> >>> >>>> >> >> >> >>> >>>> >> >> > >> class="org.apache.activemq.camel.component.ActiveMQComponent"> > >> >>> >>>> >> >> >> >>> >>>> ref="jmsConnectionFactory"/> > >> >>> >>>> >> >> > >> >>> >>>> >> >> > >> >>> >>>> >> >> > >> >>> >>>> >> >> > >> >>> >>>> >> >> >> >>> >>>> >> ref="jmsTransactionManager"/> > >> >>> >>>> >> >> > >> >>> >>>> >> >> > >> >>> >>>> >> >> > >> >>> >>>> >> >> > >> >>> >>>> >> >> > >> >>> >>>> >> >> > >> >>> >>>> >> >> > >> >>> >>>> >> >> > >> >>> >>>> >> >> > >> >>> >>>> >> >> > >> >>> >>>> >> >> > >> >>> >>>> >> >> > >> >>> >>>> >> >> > >> >>> >>>> >> >> > >> >>> >>>> >> >> > >> >>> >>>> >> >> > >> >>> >>>> >> >> > >> >>> >>>> >> >> with mine. > >> >>> >>>> >> >> > >> >>> >>>> >> >> What is different concerns the TransactionManager used. > >> >>> >>>> >> >> > >> >>> >>>> >> >> In the example, this is the Spring one: > >> >>> >>>> >> >> > >> >>> >>>> >> >> > >> >>> >>>> >> >> >> >>> >>>> >> >> > >> >>> class="org.springframework.jms.connection.JmsTransactionManager"> > >> >>> >>>> >> >> >> >>> >>>> ref="jmsConnectionFactory"/> > >> >>> >>>> >> >> > >> >>> >>>> >> >> > >> >>> >>>> >> >> and in my case, ActiveMQ is configured to use Geronimo > >> >>> Transaction > >> >>> >>>> >> Manager > >> >>> >>>> >> >> bundle (which in fact uses spring Transaction manager : > >> >>> >>>> >> >> > org.springframework.transaction.jta.JtaTransactionManager;) > >> >>> >>>> >> >> > >> >>> >>>> >> >> I suppose that in the example, the policy is defined by > >> default > >> >>> by > >> >>> >>>> >> spring > >> >>> >>>> >> >> when instantiating the class : > >> >>> >>>> >> >> org.springframework.jms.connection.JmsTransactionManager > >> >>> >>>> >> >> > >> >>> >>>> >> >> Is it possible to do the same using a JtaTransaction > manager > >> ? > >> >>> >>>> >> >> > >> >>> >>>> >> >> Regards, > >> >>> >>>> >> >> > >> >>> >>>> >> >> Charles Moulliard > >> >>> >>>> >> >> Senior Enterprise Architect > >> >>> >>>> >> >> Apache Camel Committer > >> >>> >>>> >> >> > >> >>> >>>> >> >> ***************************** > >> >>> >>>> >> >> blog : http://cmoulliard.blogspot.com > >> >>> >>>> >> >> > >> >>> >>>> >> >> > >> >>> >>>> >> >> On Thu, Jul 2, 2009 at 3:57 PM, Claus Ibsen < > >> >>> claus.ibsen@gmail.com> > >> >>> >>>> >> wrote: > >> >>> >>>> >> >> > >> >>> >>>> >> >>> Hi > >> >>> >>>> >> >>> > >> >>> >>>> >> >>> Yeah you need to add all the spring transaction stuff. > >> >>> >>>> >> >>> > >> >>> >>>> >> >>> > >> >>> >>>> >> >>> On Thu, Jul 2, 2009 at 3:47 PM, Charles Moulliard< > >> >>> >>>> cmoulliard@gmail.com > >> >>> >>>> >> > > >> >>> >>>> >> >>> wrote: > >> >>> >>>> >> >>> > Camel generates the following error with my route : > >> >>> >>>> >> >>> > > >> >>> >>>> >> >>> > Route > >> >>> >>>> >> >>> > > >> >>> >>>> >> >>> > > >> >>> >>>> >> >>> > /> > >> >>> >>>> >> >>> > type="quickfix.Message" > >> /> > >> >>> >>>> >> >>> > > >> >>> >>>> >> >>> > >> >>> >>>> >> method="createNotification" > >> >>> >>>> >> >>> /> > >> >>> >>>> >> >>> > >> >>> method="generateError" > >> >>> >>>> /> > >> >>> >>>> >> >>> > /> > >> >>> >>>> >> >>> > > >> >>> >>>> >> >>> > > >> >>> >>>> >> >>> > It seems that policy must be defined but in the > example > >> here > >> >>> it > >> >>> >>>> is > >> >>> >>>> >> not > >> >>> >>>> >> >>> > mentioned : > >> >>> http://camel.apache.org/transactional-client.html > >> >>> >>>> >> >>> > > >> >>> >>>> >> >>> > Error : > >> >>> >>>> >> >>> > > >> >>> >>>> >> >>> > 15:43:07,838 | ERROR | xtenderThread-30 | > >> >>> ContextLoaderListener > >> >>> >>>> >> >>> | > >> >>> >>>> >> >>> > BundleApplicationContextListener 50 | Application > >> context > >> >>> >>>> refresh > >> >>> >>>> >> >>> failed > >> >>> >>>> >> >>> > > >> >>> (OsgiBundleXmlApplicationContext(bundle=com.xpectis.x3s.x3s-core, > >> >>> >>>> >> >>> > config=osgibundle:/META-INF/spring/*.xml)) > >> >>> >>>> >> >>> > org.apache.camel.RuntimeCamelException: > >> >>> >>>> >> >>> java.lang.IllegalArgumentException: > >> >>> >>>> >> >>> > policy must be specified on: Transacted[ref: null] > >> >>> >>>> >> >>> > at > >> >>> >>>> >> >>> > > >> >>> >>>> >> >>> > >> >>> >>>> >> > >> >>> >>>> > >> >>> > >> > org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:986) > >> >>> >>>> >> >>> > at > >> >>> >>>> >> >>> > > >> >>> >>>> >> >>> > >> >>> >>>> >> > >> >>> >>>> > >> >>> > >> > org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:121) > >> >>> >>>> >> >>> > at > >> >>> >>>> >> >>> > > >> >>> >>>> >> >>> > >> >>> >>>> >> > >> >>> >>>> > >> >>> > >> > org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:465) > >> >>> >>>> >> >>> > at > >> >>> >>>> >> >>> > > >> >>> >>>> >> >>> > >> >>> >>>> >> > >> >>> >>>> > >> >>> > >> > org.springframework.context.event.SimpleApplicationEventMulticaster$1.run(SimpleApplicationEventMulticaster.java:78) > >> >>> >>>> >> >>> > at > >> >>> >>>> >> >>> > > >> >>> >>>> >> >>> > >> >>> >>>> >> > >> >>> >>>> > >> >>> > >> > org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49) > >> >>> >>>> >> >>> > at > >> >>> >>>> >> >>> > > >> >>> >>>> >> >>> > >> >>> >>>> >> > >> >>> >>>> > >> >>> > >> > org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:76) > >> >>> >>>> >> >>> > at > >> >>> >>>> >> >>> > > >> >>> >>>> >> >>> > >> >>> >>>> >> > >> >>> >>>> > >> >>> > >> > org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:274) > >> >>> >>>> >> >>> > at > >> >>> >>>> >> >>> > > >> >>> >>>> >> >>> > >> >>> >>>> >> > >> >>> >>>> > >> >>> > >> > org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:736) > >> >>> >>>> >> >>> > at > >> >>> >>>> >> >>> > > >> >>> >>>> >> >>> > >> >>> >>>> >> > >> >>> >>>> > >> >>> > >> > org.springframework.osgi.context.support.AbstractOsgiBundleApplicationContext.finishRefresh(AbstractOsgiBundleApplicationContext.java:235) > >> >>> >>>> >> >>> > at > >> >>> >>>> >> >>> > > >> >>> >>>> >> >>> > >> >>> >>>> >> > >> >>> >>>> > >> >>> > >> > org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:358) > >> >>> >>>> >> >>> > at > >> >>> >>>> >> >>> > > >> >>> >>>> >> >>> > >> >>> >>>> >> > >> >>> >>>> > >> >>> > >> > org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85) > >> >>> >>>> >> >>> > at > >> >>> >>>> >> >>> > > >> >>> >>>> >> >>> > >> >>> >>>> >> > >> >>> >>>> > >> >>> > >> > org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:320) > >> >>> >>>> >> >>> > at > >> >>> >>>> >> >>> > > >> >>> >>>> >> >>> > >> >>> >>>> >> > >> >>> >>>> > >> >>> > >> > org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:136) > >> >>> >>>> >> >>> > at java.lang.Thread.run(Thread.java:619) > >> >>> >>>> >> >>> > Caused by: java.lang.IllegalArgumentException: policy > >> must be > >> >>> >>>> >> specified > >> >>> >>>> >> >>> on: > >> >>> >>>> >> >>> > Transacted[ref: null] > >> >>> >>>> >> >>> > at > >> >>> >>>> >> > >> org.apache.camel.util.ObjectHelper.notNull(ObjectHelper.java:258) > >> >>> >>>> >> >>> > at > >> >>> >>>> >> >>> > > >> >>> >>>> >> >>> > >> >>> >>>> >> > >> >>> >>>> > >> >>> > >> > org.apache.camel.model.TransactedDefinition.createProcessor(TransactedDefinition.java:129) > >> >>> >>>> >> >>> > at > >> >>> >>>> >> >>> > > >> >>> >>>> >> >>> > >> >>> >>>> >> > >> >>> >>>> > >> >>> > >> > org.apache.camel.model.ProcessorDefinition.makeProcessor(ProcessorDefinition.java:226) > >> >>> >>>> >> >>> > at > >> >>> >>>> >> >>> > > >> >>> >>>> >> >>> > >> >>> >>>> >> > >> >>> >>>> > >> >>> > >> > org.apache.camel.model.ProcessorDefinition.addRoutes(ProcessorDefinition.java:111) > >> >>> >>>> >> >>> > at > >> >>> >>>> >> >>> > > >> >>> >>>> >> >>> > >> >>> >>>> >> > >> >>> >>>> > >> >>> > >> > org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:294) > >> >>> >>>> >> >>> > at > >> >>> >>>> >> >>> > > >> >>> >>>> >> >>> > >> >>> >>>> >> > >> >>> >>>> > >> >>> > >> > org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:120) > >> >>> >>>> >> >>> > at > >> >>> >>>> >> >>> > > >> >>> >>>> >> >>> > >> >>> >>>> >> > >> >>> >>>> > >> >>> > >> > org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:552) > >> >>> >>>> >> >>> > at > >> >>> >>>> >> >>> > > >> >>> >>>> >> >>> > >> >>> >>>> >> > >> >>> >>>> > >> >>> > >> > org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:969) > >> >>> >>>> >> >>> > at > >> >>> >>>> >> >>> > > >> >>> >>>> >> >>> > >> >>> >>>> >> > >> >>> >>>> > >> >>> > >> > org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:946) > >> >>> >>>> >> >>> > at > >> >>> >>>> >> >>> > > >> >>> >>>> >> >>> > >> >>> >>>> >> > >> >>> >>>> > >> >>> > >> > org.apache.camel.spring.SpringCamelContext.maybeDoStart(SpringCamelContext.java:165) > >> >>> >>>> >> >>> > at > >> >>> >>>> >> >>> > > >> >>> >>>> >> >>> > >> >>> >>>> >> > >> >>> >>>> > >> >>> > >> > org.apache.camel.spring.SpringCamelContext.doStart(SpringCamelContext.java:160) > >> >>> >>>> >> >>> > at > >> >>> >>>> >> > >> org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:52) > >> >>> >>>> >> >>> > at > >> >>> >>>> >> >>> > > >> >>> >>>> >> >>> > >> >>> >>>> >> > >> >>> >>>> > >> >>> > >> > org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:863) > >> >>> >>>> >> >>> > at > >> >>> >>>> >> >>> > > >> >>> >>>> >> >>> > >> >>> >>>> >> > >> >>> >>>> > >> >>> > >> > org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:99) > >> >>> >>>> >> >>> > at > >> >>> >>>> >> >>> > > >> >>> >>>> >> >>> > >> >>> >>>> >> > >> >>> >>>> > >> >>> > >> > org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:119) > >> >>> >>>> >> >>> > Charles Moulliard > >> >>> >>>> >> >>> > Senior Enterprise Architect > >> >>> >>>> >> >>> > Apache Camel Committer > >> >>> >>>> >> >>> > > >> >>> >>>> >> >>> > ***************************** > >> >>> >>>> >> >>> > blog : http://cmoulliard.blogspot.com > >> >>> >>>> >> >>> > > >> >>> >>>> >> >>> > >> >>> >>>> >> >>> > >> >>> >>>> >> >>> > >> >>> >>>> >> >>> -- > >> >>> >>>> >> >>> Claus Ibsen > >> >>> >>>> >> >>> Apache Camel Committer > >> >>> >>>> >> >>> > >> >>> >>>> >> >>> Open Source Integration: http://fusesource.com > >> >>> >>>> >> >>> Blog: http://davsclaus.blogspot.com/ > >> >>> >>>> >> >>> Twitter: http://twitter.com/davsclaus > >> >>> >>>> >> >>> > >> >>> >>>> >> >> > >> >>> >>>> >> >> > >> >>> >>>> >> > > >> >>> >>>> >> > >> >>> >>>> >> > >> >>> >>>> >> > >> >>> >>>> >> -- > >> >>> >>>> >> Claus Ibsen > >> >>> >>>> >> Apache Camel Committer > >> >>> >>>> >> > >> >>> >>>> >> Open Source Integration: http://fusesource.com > >> >>> >>>> >> Blog: http://davsclaus.blogspot.com/ > >> >>> >>>> >> Twitter: http://twitter.com/davsclaus > >> >>> >>>> >> > >> >>> >>>> > > >> >>> >>>> > >> >>> >>>> > >> >>> >>>> > >> >>> >>>> -- > >> >>> >>>> Claus Ibsen > >> >>> >>>> Apache Camel Committer > >> >>> >>>> > >> >>> >>>> Open Source Integration: http://fusesource.com > >> >>> >>>> Blog: http://davsclaus.blogspot.com/ > >> >>> >>>> Twitter: http://twitter.com/davsclaus > >> >>> >>>> > >> >>> >>> > >> >>> >>> > >> >>> >> > >> >>> > > >> >>> > > >> >>> > > >> >>> > -- > >> >>> > Claus Ibsen > >> >>> > Apache Camel Committer > >> >>> > > >> >>> > Open Source Integration: http://fusesource.com > >> >>> > Blog: http://davsclaus.blogspot.com/ > >> >>> > Twitter: http://twitter.com/davsclaus > >> >>> > > >> >>> > >> >>> > >> >>> > >> >>> -- > >> >>> Claus Ibsen > >> >>> Apache Camel Committer > >> >>> > >> >>> Open Source Integration: http://fusesource.com > >> >>> Blog: http://davsclaus.blogspot.com/ > >> >>> Twitter: http://twitter.com/davsclaus > >> >>> > >> >> > >> > > >> > > >> > > >> > -- > >> > Cheers, > >> > Guillaume Nodet > >> > ------------------------ > >> > Blog: http://gnodet.blogspot.com/ > >> > ------------------------ > >> > Open Source SOA > >> > http://fusesource.com > >> > > >> > >> > >> > >> -- > >> Claus Ibsen > >> Apache Camel Committer > >> > >> Open Source Integration: http://fusesource.com > >> Blog: http://davsclaus.blogspot.com/ > >> Twitter: http://twitter.com/davsclaus > >> > > > > > > -- > Cheers, > Guillaume Nodet > ------------------------ > Blog: http://gnodet.blogspot.com/ > ------------------------ > Open Source SOA > http://fusesource.com > --0016367ed58ff0e5ff046dcd958d--