• Post Reply Bookmark Topic Watch Topic
  • New Topic

No data is beilng persisted in JPA/Hibernate/mySql  RSS feed

 
Joe yaris
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to persist form data in database in JPA. It seems, it's getting data from front end to servlet but failing to go through
service class and therefore no data is beilng persisted in database. Database is in mysql and JPA provider is hibernate.
Table has an AUTO_INCREMENT id as primary key. No error is being produced on server log. Any suggestion is much appreciated. Here is my code:

servlet:


Entity class:




Service class for JPA persistence:



persistence.xml:
 
Joe yaris
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My bad, the error is as follows:

 
Joe yaris
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The error says, java.lang.ClassNotFoundException: javax.persistence.Persistence. But, added the hibernate-jpa-api.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!