I\'m new to Java and Hibernate (being a Rails and C# developer). Anyway, I have a test program that works fine with Hibernate but my actual web app (Struts 1) crashes with:
It looks like you have several versions of Hibernate jars in the classpath.
@axtavt says right. I know you already solved the problem, I post my comments as it might be helpful to other people.
If you are using maven dependencies, say you already have your own hibernate dependency. And later, another dependency (like org.codehaus.jackson or drools-spring) is added to the pom. It might cause this error because org.codehaus.jackson and drools-spring have their own dependency on a different version hibernate. exclude hibernate when you add org.codehaus.jackson or drools-spring would solve the prob.
Removing these two dependency worked for me.
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-commons-annotations</artifactId>
<version>3.0.0.ga</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
<version>3.3.0.ga</version>
</dependency>
These are my hibernate dependencies.
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>3.6.3.Final</version>
</dependency>
<dependency>
<groupId>org.javassist</groupId>
<artifactId>javassist</artifactId>
<version>3.17.1-GA</version>
</dependency>
<dependency>
<groupId>asm</groupId>
<artifactId>asm-all</artifactId>
<version>2.2</version>
</dependency>
<dependency>
<groupId>antlr</groupId>
<artifactId>antlr</artifactId>
<version>2.7.7</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>3.6.3.Final</version>
</dependency>