Skip to main content
Known Participant
January 10, 2024
Question

jmx exporter error in coldfusion conatiner

  • January 10, 2024
  • 2 replies
  • 2751 views

i am trying to use jmx exporter in my coldfusion 2021, i have added to the jvm args like this 

-javaagent:{application.home}/jmx/jmx.jar=9101:{application.home}/jmx/config.yaml
it works fine in an standalone ubuntu server, i can see the metrics exported at port 9101, but when i do the same inside docker container it give me error 

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
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:566) at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:513) at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:525) Caused by: java.lang.NoClassDefFoundError: com/sun/net/httpserver/Authenticator at io.prometheus.jmx.JavaAgent.premain(JavaAgent.java:39) ... 6 more Caused by: java.lang.ClassNotFoundException: com.sun.net.httpserver.Authenticator at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) ... 7 more
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
 
the docker conatiner is from official adobecoldfusion/coldfusion2021
jmx exporter is form prometheus 
 
final goal ios to use kube-prometheus-stack with coldfusion in k8s cluster
 
    This topic has been closed for replies.

    2 replies

    BKBK
    Community Expert
    April 7, 2024

    Are the foloowing available in the docker installation?

    • {CF_HOME}/jmx/jmx.jar
    • {CF_HOME}/jmx/config.yaml
    Known Participant
    April 8, 2024

    JMX is an external tool used for monitoring Java applications. It is not available in the Docker image from Adobe. I have added it separately.
    https://github.com/prometheus/jmx_exporter

    BKBK
    Community Expert
    April 10, 2024

    oh my miss but i did tried with the string you provided 
    tx


    No worries.

    Try it with, then without, the java.policy addition. Remember to restart ColdFusion each time. 

    Known Participant
    January 10, 2024

    * note forgot to mention 
    it works when i manyally add a jdk to install jdk eg [ jdk-11.0.17 ] from external source, extending the base adobe/coldfusion image, but can it be done from base image,without the need to modify the base image or custom custom Dockerfile 

    Charlie Arehart
    Community Expert
    January 10, 2024

    I've not yet had a chance to test this on my own, but can you try adding these to those jvm startup args for cf:

     

    --add-modules jdk.httpserver --add-exports jdk.httpserver/com.sun.net.httpserver=jdk.httpserver

     

    If it works (or not), please let us know. 

    /Charlie (troubleshooter, carehart. org)
    Known Participant
    January 11, 2024

    thank you for the advice ,
    i tried adding the above to jvm args 
    but it just stuck saying 
    """"""

    2024-01-11 12:59:50 Starting ColdFusion 2021 server ...
    2024-01-11 12:59:57 There has been an error starting ColdFusion 2021 server, please check the logs.
    2024-01-11 12:59:59 [] Checking server startup status...
    2024-01-11 13:00:05 [] Checking server startup status...
    2024-01-11 13:00:11 [] Checking server startup status...
    """"""
    and it did not start the coldfusion server , there was no entries in cf logs 
    * i think the bare adobecoldfusion/coldfusion2021 does not include jdk it just has jre to run java application 
    coz when i install jdk-11 and change java home path to jdk-11 it works [ jmx exporter ] for prometheus