{"record":{"id":"3a6bb1fe0cbf4d79","repo":"quarkusio/quarkus","slug":"not-implemented-in-native-mode-3a6bb1","errorCode":null,"errorMessage":"Not Implemented in native mode","messagePattern":"Not Implemented in native mode","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"extensions/jdbc/jdbc-mysql/runtime/src/main/java/io/quarkus/jdbc/mysql/runtime/graal/com/mysql/cj/jdbc/MySQLJDBCSubstitutions.java","lineNumber":41,"sourceCode":"                        \" If you need this resolved, please open a support request.\");\n    }\n\n    @Substitute\n    private void initializePrivateKey() {\n        throw ExceptionFactory\n                .createException(\"OciClient authentication is not available in Quarkus when compiling to native-image:\" +\n                        \" the MySQL JDBC driver team needs to cleanup the dependency requirements to make this possible.\" +\n                        \" If you need this resolved, please open a support request.\");\n    }\n\n}\n\n@TargetClass(className = \"com.mysql.cj.jdbc.ConnectionGroupManager\")\nfinal class ConnectionGroupManager {\n\n    @Substitute\n    public static void registerJmx() throws SQLException {\n        throw new IllegalStateException(\"Not Implemented in native mode\");\n    }\n\n}\n\n@TargetClass(className = \"com.mysql.cj.jdbc.jmx.LoadBalanceConnectionGroupManager\")\nfinal class LoadBalanceConnectionGroupManager {\n\n    @Substitute\n    public synchronized void registerJmx() throws java.sql.SQLException {\n        throw new IllegalStateException(\"Not Implemented in native mode\");\n    }\n\n}\n\n@TargetClass(className = \"com.mysql.cj.jdbc.jmx.ReplicationGroupManager\")\nfinal class ReplicationGroupManager {\n\n    @Substitute","sourceCodeStart":23,"sourceCodeEnd":59,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/jdbc/jdbc-mysql/runtime/src/main/java/io/quarkus/jdbc/mysql/runtime/graal/com/mysql/cj/jdbc/MySQLJDBCSubstitutions.java#L23-L59","documentation":"Quarkus substitutes MySQL's ConnectionGroupManager.registerJmx with a stub that throws IllegalStateException. JMX registration for the load-balancing connection group manager uses classes excluded from the native image, so this JMX integration is not implemented in native mode.","triggerScenarios":"Native-mode usage of MySQL Connector/J load balancing (jdbc:mysql:loadbalance://...) or replication URLs when the driver attempts to register its connection group with the platform MBean server (registerJmx() called during load-balance setup).","commonSituations":"Apps using MySQL load-balanced URLs with JMX monitoring; code or driver versions that enable JMX registration by default; migrating a monitored JVM deployment to native image.","solutions":["Avoid the loadbalance/replication URL in native mode; connect to a single host or use a TCP proxy/load balancer (e.g. ProxySQL, HAProxy, cloud LB) in front of MySQL","Disable JMX for the driver/monitor the group externally instead of via JMX","Deploy in JVM mode if MySQL load-balancing JMX monitoring is required","Use Quarkus datasource multiple URLs / Agroal failover instead of driver-level load balancing"],"exampleFix":"// before\nString url = \"jdbc:mysql:loadbalance://node1:3306,node2:3306/db\";\n// after\nString url = \"jdbc:mysql://mysql-lb.internal:3306/db\"; // TCP load balancer in front","handlingStrategy":"validation","validationCode":"if (url.startsWith(\"jdbc:mysql:loadbalance://\") && jmxMonitoringEnabled) { throw new IllegalArgumentException(\"MySQL loadbalance JMX registration is not implemented in native mode\"); }","typeGuard":"static boolean usesLoadBalanceUrl(String url) { return url != null && url.startsWith(\"jdbc:mysql:loadbalance://\"); }","tryCatchPattern":"try { conn = ds.getConnection(); } catch (IllegalStateException e) { if (e.getMessage().contains(\"Not Implemented in native mode\")) { log.error(\"Use a TCP load balancer instead of driver loadbalance JMX\"); } throw e; }","preventionTips":["Use external load balancers (ProxySQL/HAProxy/cloud LB) instead of jdbc:mysql:loadbalance in native mode","Disable driver JMX registration features for native deployments","Monitor connection pools via Quarkus/Agroal metrics instead of driver JMX","Smoke-test native builds with the exact production JDBC URL"],"tags":["native-image","jdbc","mysql","jmx","load-balancing"],"backgroundTag":"native-image-unsupported-feature","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}