Wednesday, October 30, 2013

Caused by: java.lang.IllegalStateException: Attempting to execute an operation on a closed EntityManagerFactory.

According to this site (site), this is caused by a Glassfish bug and redeploying will fix this.  The following steps solved the issue:

  1. Undeploy the project
  2. Restart the Glassfish server
  3. Clean and build project
  4. Deploy project to Glassfish server

These steps work using the following configurations:
  • Netbeans 7.4 and Glassfish 4.0
  • Netbeans 8.0 and Glassfish 4.0