Hi Claus, Please find the bean definition in the camel context. <bean id="springTransactionStrategy" class="org.apacheextras.camel.component.hibernate.SpringTransactionStrategy"> <constructor-arg ref="sessionFactory"/> <constructor-arg ref="transactionTemplate"/> </bean> <bean id="transactionManager" class="org.springframework.orm.hibernate4.HibernateTransactionManager"> <property name="sessionFactory" ref="sessionFactory"/> </bean> <bean id="transactionTemplate" class="org.springframework.transaction.support.TransactionTemplate"> <property name="transactionManager" ref="transactionManager"/> </bean>
<!-- setup Hibernate session factory --> <bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"> <property name="dataSource" ref="dataSource"/> <!-- here we define the hibernate mapping files we use --> <property name="mappingResources"> <list> <value>name.hbm.xml</value> </list> </property> <!-- and here we have additional hibernate options --> <property name="hibernateProperties"> <value> hibernate.dialect=org.hibernate.dialect.SQLServerDialect hibernate.hbm2ddl.auto=create hibernate.query.factory_class=org.hibernate.hql.internal.classic.ClassicQueryTranslatorFactory </value> </property> </bean> Thanks Ganesh -----Original Message----- From: Kanagavel, Ganesh Kumar: CRES (NYK) Sent: Monday, March 11, 2013 3:04 PM To: users@camel.apache.org Subject: RE: Hibernate Current Session issue in Camel Camel Version is 2.10.3 Camel-Extra Version is 2.10.1 camel-hibernate Version is 2.10.1 spring-tx Version is 3.2.1.RELEASE spring-jdbc Version is 3.1.0.RELEASE spring-expression is 3.1.0.RELEASE -----Original Message----- From: Claus Ibsen [mailto:claus.ib...@gmail.com] Sent: Monday, March 11, 2013 1:57 PM To: users@camel.apache.org<mailto:users@camel.apache.org> Subject: Re: Hibernate Current Session issue in Camel Hi What version of Camel, Hibernate, camel-extra and Spring are you using? On Mon, Mar 11, 2013 at 6:17 PM, <ganeshkumar.kanaga...@barclays.com<mailto:ganeshkumar.kanaga...@barclays.com>> wrote: > Hi, > Please advise if anyone has faced this problem of implementing hibernate in > Camel? > > by: java.lang.NoSuchMethodError: > org.hibernate.SessionFactory.getCurrentSession()Lorg/hibernate/classic/Session; > at > org.apacheextras.camel.component.hibernate.SpringTransactionStrategy$1.doInTransaction(SpringTransactionStrategy.java:43) > at > org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:131) > at > org.apacheextras.camel.component.hibernate.SpringTransactionStrategy.execute(SpringTransactionStrategy.java:40) > at > org.apacheextras.camel.component.hibernate.HibernateProducer.process(HibernateProducer.java:49) > at > org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncPr > ocessorBridge.process(AsyncProcessorConverterHelper.java:61) > > Thanks > Ganesh > > > _______________________________________________ > > This message may contain information that is confidential or privileged. If > you are not an intended recipient of this message, please delete it and any > attachments, and notify the sender that you have received it in error. Unless > specifically stated in the message or otherwise indicated, you may not > uplicate, redistribute or forward this message or any portion thereof, > including any attachments, by any means to any other person, including any > retail investor or customer. This message is not a recommendation, advice, > offer or solicitation, to buy/sell any product or service, and is not an > official confirmation of any transaction. Any opinions presented are solely > those of the author and do not necessarily represent those of Barclays. > > This message is subject to terms available at: > www.barclays.com/emaildisclaimer<http://www.barclays.com/emaildisclaimer> > and, if received from Barclays' Sales or Trading desk, the terms available > at: > www.barclays.com/salesandtradingdisclaimer/<http://www.barclays.com/salesandtradingdisclaimer/>. > By messaging with Barclays you consent to the foregoing. Barclays Bank PLC > is a company registered in England (number 1026167) with its registered > office at 1 Churchill Place, London, E14 5HP. This email may relate to or be > sent from other members of the Barclays group. > > _______________________________________________ -- Claus Ibsen ----------------- Red Hat, Inc. FuseSource is now part of Red Hat Email: cib...@redhat.com<mailto:cib...@redhat.com> Web: http://fusesource.com Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen _______________________________________________ This message may contain information that is confidential or privileged. If you are not an intended recipient of this message, please delete it and any attachments, and notify the sender that you have received it in error. Unless specifically stated in the message or otherwise indicated, you may not uplicate, redistribute or forward this message or any portion thereof, including any attachments, by any means to any other person, including any retail investor or customer. This message is not a recommendation, advice, offer or solicitation, to buy/sell any product or service, and is not an official confirmation of any transaction. Any opinions presented are solely those of the author and do not necessarily represent those of Barclays. This message is subject to terms available at: www.barclays.com/emaildisclaimer<http://www.barclays.com/emaildisclaimer> and, if received from Barclays' Sales or Trading desk, the terms available at: www.barclays.com/salesandtradingdisclaimer/<http://www.barclays.com/salesandtradingdisclaimer/>. By messaging with Barclays you consent to the foregoing. Barclays Bank PLC is a company registered in England (number 1026167) with its registered office at 1 Churchill Place, London, E14 5HP. This email may relate to or be sent from other members of the Barclays group. _______________________________________________ _______________________________________________ This message may contain information that is confidential or privileged. If you are not an intended recipient of this message, please delete it and any attachments, and notify the sender that you have received it in error. Unless specifically stated in the message or otherwise indicated, you may not uplicate, redistribute or forward this message or any portion thereof, including any attachments, by any means to any other person, including any retail investor or customer. This message is not a recommendation, advice, offer or solicitation, to buy/sell any product or service, and is not an official confirmation of any transaction. Any opinions presented are solely those of the author and do not necessarily represent those of Barclays. This message is subject to terms available at: www.barclays.com/emaildisclaimer and, if received from Barclays' Sales or Trading desk, the terms available at: www.barclays.com/salesandtradingdisclaimer/. By messaging with Barclays you consent to the foregoing. Barclays Bank PLC is a company registered in England (number 1026167) with its registered office at 1 Churchill Place, London, E14 5HP. This email may relate to or be sent from other members of the Barclays group. _______________________________________________