Jinq icon indicating copy to clipboard operation
Jinq copied to clipboard

Move from javax.persistence to jakarta.persistence.

Open my2iu opened this issue 4 years ago • 5 comments

my2iu avatar Jul 01 '20 20:07 my2iu

I attempted to change the packages from javax.persistence to jakarta.persistence, test fails in Jinq for JPA test, the error message is:

Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 0.004 sec <<< FAILURE!
org.jinq.jpa.JinqJPAWhereTest  Time elapsed: 0.003 sec  <<< ERROR!
jakarta.persistence.PersistenceException: No Persistence provider for EntityManager named JPATest
	at jakarta.persistence.Persistence.createEntityManagerFactory(Persistence.java:86)
	at jakarta.persistence.Persistence.createEntityManagerFactory(Persistence.java:55)
	at org.jinq.jpa.JinqJPATestBase.setUpBeforeClass(JinqJPATestBase.java:35)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
	at org.junit.internal.runners.statements.RunBefores.invokeMethod(RunBefores.java:33)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
	at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)

The same error takes place in all Java JPA modules

OssNass avatar Nov 26 '21 23:11 OssNass

Does your project need this change? I wasn’t sure when Hibernate and EclipseLink were going to transition, so I wasn’t sure when it would make sense to change Jinq too.

my2iu avatar Nov 26 '21 23:11 my2iu

I am actually just trying something new here, for now Hibernate still uses Javax JPA (stable version 5.6.1.Final).

I believe Hibernate 6 will make the move from Javax to Jakarta.

Eclipse Link 3 has moved to Jakarta.

You really need to validate the transition

OssNass avatar Nov 26 '21 23:11 OssNass

Unless you link in a version of EclipseLink that also uses the Jakarta versions of the APIs, then all the tests will probably fail.

my2iu avatar Nov 26 '21 23:11 my2iu

Okay, I see.

OssNass avatar Nov 26 '21 23:11 OssNass

2.0.00 has now been released with support for jakarta.persistence

my2iu avatar Aug 30 '22 00:08 my2iu