-1

Exception in thread "main" java.lang.NullPointerException: Cannot invoke "javax.persistence.EntityTransaction.isActive()" because "com.jspiders.hibernate.dao.StudentDAO.entityTransaction" is null at com.jspiders.hibernate.dao.StudentDAO.closeConnection(StudentDAO.java:29) at com.jspiders.hibernate.dao.StudentDAO.main(StudentDAO.java:52)

Cannot invoke "javax.persistence.EntityTransaction.isActive()"

  • Does this answer your question? [What is a NullPointerException, and how do I fix it?](https://stackoverflow.com/questions/218384/what-is-a-nullpointerexception-and-how-do-i-fix-it) – Jens Mar 05 '23 at 11:10

1 Answers1

0

Check your persistence.xml file in that gives the proper name for <persistence-unit =" ">.