Spring JDBC throws java.lang.NoSuchMethodError: org.hibernate.Session.connection()Ljava/sql/Connection; -


my problem same 1 - java.lang.nosuchmethoderror: org.hibernate.sessionfactory.opensession()lorg/hibernate/classic/session

i following exception while using spring jdbctemplate.

java.lang.nosuchmethoderror: org.hibernate.session.connection()ljava/sql/connection; 

the accepted answer in link above, recommends downgrading hibernate version supported spring.

this not acceptable me need latest version of hibernate use new features (and benefit bug fixes).

is there way work without downgrading hibernate?

the transaction manager being used jpa transaction manager. left on days when using jpa via spring. no longer that, not expecting spring break on hibernate version update. on searching bean definition, found incorrect reference jpa/hibernate , removed it. application runs fine now.

changed this:

<bean id="transactionmanager" class="org.springframework.orm.jpa.jpatransactionmanager">       <property name="entitymanagerfactory" ref="entitymanagerfactory" />   </bean> 

to this:

<bean id="transactionmanager" class="org.springframework.jdbc.datasource.datasourcetransactionmanager">     <property name="datasource" ref="datasource"></property> </bean> 

Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -