简体   繁体   中英

IgniteJdbcThinDrive can not start with open jdk 11

Hi I have an application and I want to execute it but I got error in ignitejdbcthindriver

I can start my app when I use oracle 1.8 but when I change it to openjdk 11.0.5 it fails initialize org.apache.ignite.IgniteJdbcThinDriver.

But I can run my app inside intellij with openjdk 11.0.5 to pass jvm arguments and it success.

Interesting point I got error with myjpa code(org.springframework.orm.jpa.vendor.SpringHibernateJpa) but in my jpa code there is nothing releated to ignite.I use ignite in different classes.

> java -jar D:\demoapp.jar
> --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
> --illegal-access=permit

Ignite site they suggest this configs to add(intellij run with these)

--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 --illegal-access=permit

Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.apache.ignite.IgniteJdbcThinDriver at java.base/java.lang.Class.forName0(Native Method) at java.base/java.lang.Class.forName(Class.java:398) at java.sql/java.sql.DriverManager.isDriverAllowed(DriverManager.java:555) at java.sql/java.sql.DriverManager.isDriverAllowed(DriverManager.java:547) at java.sql/java.sql.DriverManager.getDrivers(DriverManager.java:449) at java.sql/java.sql.DriverManager.getDrivers(DriverManager.java:426) at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:509) at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:677) at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:189)

,jvm argument must be given before jar name for that reason when I change my command and put -jar jarname parameter at the end it works.

> java --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
> --illegal-access=permit -jar D:\demoapp.jar

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM