0

os:centos7

springboot:3.1.1

application.yml: spring: datasource: driver-class-name: com.mysql.cj.jdbc.Driver url: jdbc:mysql://192.168.2.109:3306/dow2?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false&serverTimezone=Asia/Shanghai username: root password: 123456 type: com.zaxxer.hikari.HikariDataSource hikari: minimum-idle: 2 maximum-pool-size: 8 idle-timeout: 30000 max-lifetime: 1800000 connection-timeout: 30000 pool-name: HikariPool auto-commit: true data-source-properties: cachePrepStmts: true prepStmtCacheSize: 250 prepStmtCacheSqlLimit: 2048 useServerPrepStmts: true useLocalSessionState: true rewriteBatchedStatements: true cacheResultSetMetadata: true cacheServerConfiguration: true elideSetAutoCommits: true maintainTimeStats: false

graalvm:Java(TM) SE Runtime Environment GraalVM EE 22.3.2 (build 17.0.7+8-LTS-jvmci-22.3-b15)

maven build: mvn --batch-mode -T4 -DskipTests=true -Dmaven.plugin.validation=VERBOSE -Pnative clean native:compile

running the nativeBuild it throws: Caused by: com.mysql.cj.exceptions.WrongArgumentException: Failed loading the class 'com.mysql.cj.PerConnectionLRUFactory'. at java.base@17.0.7/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) at java.base@17.0.7/java.lang.reflect.Constructor.newInstance(Constructor.java:480) at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:62) at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:105) at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:150) at com.mysql.cj.util.Util.getInstance(Util.java:193) at com.mysql.cj.jdbc.ConnectionImpl.createPreparedStatementCaches(ConnectionImpl.java:1023) at com.mysql.cj.jdbc.ConnectionImpl.(ConnectionImpl.java:418) ... 81 common frames omitted Caused by: java.lang.ClassNotFoundException: com.mysql.cj.PerConnectionLRUFactory at java.base@17.0.7/java.lang.Class.forName(DynamicHub.java:1132) at com.mysql.cj.util.Util.getInstance(Util.java:186) ... 83 common frames omitted enter image description here

I have no idea what to do with it.

  • Seems to be a known issue that MySql connector doesn't have proper native configuration yet: https://github.com/oracle/graal/issues/1748 also this post seems related https://stackoverflow.com/questions/72723781/mysql-connector-does-not-work-with-graalvm-and-docker – Jens Schauder Jul 14 '23 at 14:21

0 Answers0