I'm building a desktop application with an Apache Derby database. When I run the application from Netbeans, it works fine, but when I run the application's executable jar file, I get a "java.lang.ExceptionInInitializerError" "Caused by: java.lang.IllegalStateException: Attempting to execute an operation on a closed EntityManager."
The jar file was created by right-clicking the project in Netbeans, and clicking "Clean and Build".
I've looked at the the following resources, but the information wasn't applicable:
This is my first time using Derby, so it's probably something simple that I'm missing.
Stack trace:
java.lang.ExceptionInInitializerError
at myProject.Main.start(Main.java:70)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(Unknown Source)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$11(Unknown Source)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$9(Unknown Source)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(Unknown Source)
at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(Unknown Source)
at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IllegalStateException: Attempting to execute an operation on a closed EntityManager.
at org.eclipse.persistence.internal.jpa.EntityManagerImpl.verifyOpenWithSetRollbackOnly(EntityManagerImpl.java:1923)
at org.eclipse.persistence.internal.jpa.QueryImpl.getSingleResult(QueryImpl.java:508)
at org.eclipse.persistence.internal.jpa.EJBQueryImpl.getSingleResult(EJBQueryImpl.java:400)
at graphics.view.Read.<clinit>(Read.java:50)
... 10 more