I’m trying to make Java JPA and Hibernate work in my project and i can’t figure it out. I have spent two days on this and I can’t figure it out, so if anyone could help here is github project repo link -> https://github.com/Elnur1337/RSProjekat
All I get is this error:
Jun 18, 2024 4:43:13 PM javax.persistence.spi.PersistenceProviderResolverHolder$DefaultPersistenceProviderResolver log
WARNING: javax.persistence.spi::No valid providers found.
Exception in thread "main" java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at java.base/sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:1085)
Caused by: java.lang.ExceptionInInitializerError
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at [email protected]/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:464)
at [email protected]/com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:364)
... 5 more
Caused by: javax.persistence.PersistenceException: No Persistence provider for EntityManager named rstest
at [email protected]/javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:85)
at [email protected]/javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:54)
at RSProjekat/main.Main.<clinit>(Main.java:17)
... 11 more
I tried using different versions of hibernate and javax.persistance APIs (.jar files). I tried different persistence links in persistence.xml.