Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JDBC driver doesn't work on JDK 21-ea #10720

Closed
wendigo opened this issue May 17, 2023 · 4 comments
Closed

JDBC driver doesn't work on JDK 21-ea #10720

wendigo opened this issue May 17, 2023 · 4 comments

Comments

@wendigo
Copy link
Contributor

wendigo commented May 17, 2023

java.lang.ExceptionInInitializerError
	at org.apache.ignite.internal.util.IgniteUtils.<clinit>(IgniteUtils.java:893)
	at org.apache.ignite.lang.IgniteProductVersion.fromString(IgniteProductVersion.java:312)
	at org.apache.ignite.internal.IgniteVersionUtils.<clinit>(IgniteVersionUtils.java:94)
	at org.apache.ignite.IgniteJdbcThinDriver.<clinit>(IgniteJdbcThinDriver.java:140)
	at java.base/java.lang.Class.forName0(Native Method)
	at java.base/java.lang.Class.forName(Class.java:392)
	at java.base/java.lang.Class.forName(Class.java:383)
	at org.testcontainers.containers.JdbcDatabaseContainer.getJdbcDriverInstance(JdbcDatabaseContainer.java:199)
	at org.testcontainers.containers.JdbcDatabaseContainer.createConnection(JdbcDatabaseContainer.java:237)
	at org.testcontainers.containers.JdbcDatabaseContainer.createConnection(JdbcDatabaseContainer.java:218)
	at org.testcontainers.containers.JdbcDatabaseContainer.waitUntilContainerStarted(JdbcDatabaseContainer.java:158)
	at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:490)
	at org.testcontainers.containers.GenericContainer.lambda$doStart$0(GenericContainer.java:344)
	at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:81)
	at org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:334)
	at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:322)
	at io.trino.plugin.ignite.TestingIgniteServer.<init>(TestingIgniteServer.java:46)
	at io.trino.testing.SharedResource.getInstanceLease(SharedResource.java:46)
	at io.trino.plugin.ignite.TestingIgniteServer.getInstance(TestingIgniteServer.java:39)
	at io.trino.plugin.ignite.TestIgniteConnectorTest.createQueryRunner(TestIgniteConnectorTest.java:52)
	at io.trino.testing.AbstractTestQueryFramework.init(AbstractTestQueryFramework.java:104)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:578)
	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:104)
	at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:515)
	at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:217)
	at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:144)
	at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:169)
	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108)
	at org.testng.TestRunner.privateRun(TestRunner.java:756)
	at org.testng.TestRunner.run(TestRunner.java:610)
	at org.testng.SuiteRunner.runTest(SuiteRunner.java:387)
	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:382)
	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:340)
	at org.testng.SuiteRunner.run(SuiteRunner.java:289)
	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
	at org.testng.TestNG.runSuitesSequentially(TestNG.java:1293)
	at org.testng.TestNG.runSuitesLocally(TestNG.java:1218)
	at org.testng.TestNG.runSuites(TestNG.java:1133)
	at org.testng.TestNG.run(TestNG.java:1104)
	at com.intellij.rt.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:66)
	at com.intellij.rt.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:105)
Caused by: java.lang.RuntimeException: Unable to set up byte buffer creation using reflections :java.nio.DirectByteBuffer.<init>(long,int)
	at org.apache.ignite.internal.util.GridUnsafe.createNewDirectBufferCtor(GridUnsafe.java:1706)
	at org.apache.ignite.internal.util.GridUnsafe.createAndTestNewDirectBufferCtor(GridUnsafe.java:1671)
	at org.apache.ignite.internal.util.GridUnsafe.<clinit>(GridUnsafe.java:171)
	... 43 more
	Suppressed: java.lang.RuntimeException: jdk.internal.misc.JavaNioAccess class is unavailable.
Please add the following parameters to JVM startup settings and restart the application: {parameters: --add-exports=java.base/jdk.internal.misc=ALL-UNNAMED
--add-exports=java.base/sun.nio.ch=ALL-UNNAMED
--add-exports=java.management/com.sun.jmx.mbeanserver=ALL-UNNAMED
--add-exports=jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED
--add-exports=java.base/sun.reflect.generics.reflectiveObjects=ALL-UNNAMED
--add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED
--illegal-access=permit
}
See https://apacheignite.readme.io/docs/getting-started#section-running-ignite-with-java-9-10-11 for more information.
		at org.apache.ignite.internal.util.GridUnsafe.javaNioAccessObject(GridUnsafe.java:1627)
		at org.apache.ignite.internal.util.GridUnsafe.<clinit>(GridUnsafe.java:175)
		... 43 more
	Caused by: java.lang.ClassNotFoundException: jdk.internal.misc.SharedSecrets
		at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
		at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
		at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
		at java.base/java.lang.Class.forName0(Native Method)
		at java.base/java.lang.Class.forName(Class.java:392)
		at java.base/java.lang.Class.forName(Class.java:383)
		at org.apache.ignite.internal.util.GridUnsafe.javaNioAccessObject(GridUnsafe.java:1620)
		... 44 more
Caused by: java.lang.NoSuchMethodException: java.nio.DirectByteBuffer.<init>(long,int)
	at java.base/java.lang.Class.getConstructor0(Class.java:3689)
	at java.base/java.lang.Class.getDeclaredConstructor(Class.java:2858)
	at org.apache.ignite.internal.util.GridUnsafe.createNewDirectBufferCtor(GridUnsafe.java:1699)
	... 45 more

JVM flags used:

--add-exports=java.base/jdk.internal.misc=ALL-UNNAMED
--add-exports=java.base/sun.nio.ch=ALL-UNNAMED
--add-exports=java.management/com.sun.jmx.mbeanserver=ALL-UNNAMED
--add-exports=jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED
--add-exports=java.base/sun.reflect.generics.reflectiveObjects=ALL-UNNAMED
--add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED
--illegal-access=permit
--add-opens=java.base/java.nio=ALL-UNNAMED
--add-opens=java.base/jdk.internal.misc=ALL-UNNAMED
--add-opens=java.base/jdk.unsupported=ALL-UNNAMED

ignite-core: 2.15.0

For reference: https://github.com/trinodb/trino/actions/runs/4996810421/jobs/8951203565?pr=17520

lukas-krecan added a commit to lukas-krecan/ShedLock that referenced this issue Sep 23, 2023
@ivandasch
Copy link
Contributor

ivandasch commented Oct 3, 2023

It was fixed in #10969 and #10764 , could you please recheck?

@wendigo
Copy link
Contributor Author

wendigo commented Oct 3, 2023

@ivandasch yeah, I've fixed that ;-)

@mmoayyed
Copy link

mmoayyed commented Oct 3, 2023

Hello. What version contains this fix, or is this part of the v3 snapshots atm?

@wendigo
Copy link
Contributor Author

wendigo commented Oct 3, 2023

It's not yet released as far as I understand

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants