java - Hibernate Annotations together with EntityManager -


i've created jar module hibernate dependency of

<dependency>     <groupid>org.hibernate</groupid>     <artifactid>hibernate-annotations</artifactid>     <version>3.5.6-final</version> </dependency> 

and jar module compiles properly. jar module referenced war module has hibernate dependency of

<dependency>     <groupid>org.hibernate</groupid>     <artifactid>hibernate-entitymanager</artifactid>     <version>3.6.0.final</version> </dependency> 

at run-time war module gives exception of

org.springframework.beans.factory.beancreationexception: error creating bean name 'org.springframework.dao.annotation.persistenceexceptiontranslationpostprocessor#0': initialization of bean failed; nested exception org.springframework.beans.factory.beancreationexception: error creating bean name 'entitymanagerfactory' defined in class path resource 

and followed by

java.lang.nosuchmethoderror: org.hibernate.mapping.simplevalue.<init>(lorg/hibernate/mapping/table;)v 

it seems there incompatibility of versions of hibernate. once dependency removed jar module. work fine. need dependency jar module. how can overcome ?

since hibernate 3.6 hibernate-annotations merged hibernate-core (which transitive dependency of hibernate-entitymanager). don't need declare hibernate-annotations explicitly anymore.


Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -