jmxtrans / jmxtrans-agent

Java Agent based JMX metrics exporter.
MIT License
179 stars 110 forks source link

JDK9 - Fails with java.sql is not being available at boot class path #113

Open evmin opened 7 years ago

evmin commented 7 years ago

JMXtrans Java Agent fails with JDK9:

Exception in thread "main" java.lang.reflect.InvocationTargetException
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:564)
        at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:500)
        at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:512)
Caused by: java.lang.NoClassDefFoundError: java/sql/Timestamp
        at org.jmxtrans.agent.util.logging.Logger.log(Logger.java:105)
        at org.jmxtrans.agent.util.logging.Logger.log(Logger.java:98)
        at org.jmxtrans.agent.util.logging.Logger.info(Logger.java:124)
        at org.jmxtrans.agent.JmxTransAgent.initializeAgent(JmxTransAgent.java:116)
        at org.jmxtrans.agent.JmxTransAgent.premain(JmxTransAgent.java:85)
        ... 6 more
Caused by: java.lang.ClassNotFoundException: java.sql.Timestamp
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:582)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:185)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:496)
        ... 11 more
FATAL ERROR in native method: processing of -javaagent failed
cyrille-leclerc commented 7 years ago

java.sql.Timestamp is convenient to format dates. We can replace easily.

samrocketman commented 5 months ago

java.time.Instant?