Struts2 integrating with Hibernate 3 Failed

540 Views Asked by At

I want to use Hibernate with Struts2. When the SessionFactory is loaded the following error is occurred.

Initial SessionFactory creation failed.java.lang.NoClassDefFoundError: javax/persistence/JoinTable  

When I got the session factory in a normal class in a psvm, no error given,But when only jsp page or Tomcate is run ,above error is thrown.

I searched it in Internet.It is said that it is because that some libraries are not matching..

this said to add some jars listed in that page.And to find them, a link also given. But no jars found.
Also there is another page found saying full-hibernate-plugin-for-struts2 But I couldn't find any useful libraries. It had only war files(normal classes) and some web projects not struts or hibernate libraries.

I use

  • NetBeansIDE 7.0.1

  • Tomcat 7

Please any one know how to solve this problem or any working library set ?

2

There are 2 best solutions below

3
On

check this out:

libraries

or you can use maven:

maven dependencies

0
On

If any one face this problem,

my solution was to use new Hibernate version 4.1.4 . Then every thing was OK .
My Struts version is 2.2.3 .