quarkusio/quarkus · error · IllegalStateException
Not Implemented in native mode
Error message
Not Implemented in native mode
What it means
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.
Source
Thrown at extensions/jdbc/jdbc-mysql/runtime/src/main/java/io/quarkus/jdbc/mysql/runtime/graal/com/mysql/cj/jdbc/MySQLJDBCSubstitutions.java:41
" If you need this resolved, please open a support request.");
}
@Substitute
private void initializePrivateKey() {
throw ExceptionFactory
.createException("OciClient authentication is not available in Quarkus when compiling to native-image:" +
" the MySQL JDBC driver team needs to cleanup the dependency requirements to make this possible." +
" If you need this resolved, please open a support request.");
}
}
@TargetClass(className = "com.mysql.cj.jdbc.ConnectionGroupManager")
final class ConnectionGroupManager {
@Substitute
public static void registerJmx() throws SQLException {
throw new IllegalStateException("Not Implemented in native mode");
}
}
@TargetClass(className = "com.mysql.cj.jdbc.jmx.LoadBalanceConnectionGroupManager")
final class LoadBalanceConnectionGroupManager {
@Substitute
public synchronized void registerJmx() throws java.sql.SQLException {
throw new IllegalStateException("Not Implemented in native mode");
}
}
@TargetClass(className = "com.mysql.cj.jdbc.jmx.ReplicationGroupManager")
final class ReplicationGroupManager {
@SubstituteView on GitHub (pinned to e1c734241f)
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
Example fix
// before String url = "jdbc:mysql:loadbalance://node1:3306,node2:3306/db"; // after String url = "jdbc:mysql://mysql-lb.internal:3306/db"; // TCP load balancer in front
Defensive patterns
Strategy: validation
Validate before calling
if (url.startsWith("jdbc:mysql:loadbalance://") && jmxMonitoringEnabled) { throw new IllegalArgumentException("MySQL loadbalance JMX registration is not implemented in native mode"); } Type guard
static boolean usesLoadBalanceUrl(String url) { return url != null && url.startsWith("jdbc:mysql:loadbalance://"); } Try / catch
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; } Prevention
- 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
When it happens
Trigger: 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).
Common situations: 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.
Related errors
- Not Implemented in native mode
- JMX is not available in native images.
- Option 'pipe' is not available for MariaDB in native mode
- Option 'localSocket' is not available for MariaDB in native
- Quarkus does not support Active Directory based authenticati
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/3a6bb1fe0cbf4d79.
Report an issue: GitHub.