Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

[JPA] I got a exception javax.persistence.RollbackException

 
Runrioter Wung
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,everyone!
I am learning JPA,But when I am coding the first app,I fail...
I use the Hibernate implement of JPA..


When I run it,I got the following exception:
 
Saif Asif
Ranch Hand
Posts: 440
Eclipse IDE Hibernate Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its giving you a NullPointerException , maybe you are getting null entity on your entity manager . Also, what is on line 30 of EmployeeServiceTest.java?
 
Runrioter Wung
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Saif Asif wrote:Its giving you a NullPointerException , maybe you are getting null entity on your entity manager . Also, what is on line 30 of EmployeeServiceTest.java?

Here the line 30 is

And I promise that it isn't a null entity.
 
Runrioter Wung
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have got the answer.
 
Saif Asif
Ranch Hand
Posts: 440
Eclipse IDE Hibernate Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
oh thats great ! What exactly was the issue ?
 
Runrioter Wung
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Saif Asif wrote:oh thats great ! What exactly was the issue ?

The jars included was in different versions. Incompatible.
 
Saif Asif
Ranch Hand
Posts: 440
Eclipse IDE Hibernate Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I see. Well glad you solved your issue
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic