0

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 ?

Roman C
  • 49,761
  • 33
  • 66
  • 176
Débora
  • 5,816
  • 28
  • 99
  • 171

2 Answers2

1

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 .

Débora
  • 5,816
  • 28
  • 99
  • 171
0

check this out:

libraries

or you can use maven:

maven dependencies

Jaiwo99
  • 9,687
  • 3
  • 36
  • 53
  • Thanks. I m not familier with Maven. It will be appreciate more if I can have a link where I can get them downloaded. Also, I read an article saying that the problem is in a jar called `asm`. You have added `asm 3.3.1` In my project, there are 2 asm libraries- 1 for Hibernate,other from Struts. In case I remove one of them, then entire library set which it belongs, get removed.(that says, if I remove struts's asm, all struts2 libs get removed ) :( – Débora Jun 28 '12 at 14:45
  • Hi, i just made a screenshot from a working project, so i suggest you forget what you got, just use my version. you can get struts2 from the struts2 official webpage. and hibernate from its webpage. it is not difficult to find them. – Jaiwo99 Jun 28 '12 at 15:00
  • Thanks. I have already taken all libraries from each site. Also, they let us download the collection of libraries and not one by one.. – Débora Jun 28 '12 at 15:15