[commandbox 4.5.0+00198] starting lucee with a custom javaagent: param via commandbox/docker...

Hey all,

It has been quite some time since needing to ask for help here, but I just wanted to say I’m glad this group is still here and active! Thank you all!

Im on a pretty wacky path here, but I figured if ANYBODY is going to have any guidance for me this is surely the place to ask… trying to keep this short version of long story so please forgive me, if you think you can help or need more info please let me know…

background: I have been experimenting with the commandbox docker images for my kubernetes lab and was able to bake a custom image with commandbox, deploy a service with five lucee5 instances to my 8 node arm32 (armbian) based cluster… this lab hw can do some cool things, but to finally just run some good old cfml on it, felt, well… kinda cool kid actually.

Now, what I really want to do here is monitor the jvm and lucee performance via my existing prometheus setup in the cluster, (similar to what is being done with kafka, another jvm based product here : Monitoring Kafka with Prometheus – Robust Perception | Prometheus Monitoring Experts)

so, i’m reading thru what i can find, and I am trying to attach this GitHub - prometheus/jmx_exporter: A process for exposing JMX Beans via HTTP for Prometheus consumption as a -javaagent: using commandbox’s JVMarg , because if i can get that to would work I could probably just configure a prometheus target to hit it and for step one here at least, my hope would be to see the JVM metrics for a lucee instance like this here : https://grafana.com/dashboards/3066

Problem is when I add the JVMArgs like so:

box server start JVMArgs="-javaagent:extra/jmx_prometheus_javaagent-0.11.0.jar=7071:extra/jmx-agent-config.yml" cfengine=${CFENGINE} serverHomeDirectory=${SERVER_HOME_DIRECTORY} host= openbrowser=false port=${PORT} sslPort=${SSL_PORT} saveSettings=false

I get the following log output, and then it hangs…

✓ | Starting Server

Starting RunWAR 3.8.1-SNAPSHOT
Starting background app [lucee 5.2.9+31] from: /root/.CommandBox/lib/runwar-3.8.1-SNAPSHOT.jar
Starting in background -

INFO: Waiting for server to become available…
INFO: Server engine up and running.
INFO: Configuration processed and server started in 405 seconds.
[INFO ] runwar.server: Starting RunWAR 3.8.1-SNAPSHOT
[INFO ] runwar.server: Starting background app [lucee 5.2.9+31] from: /root/.CommandBox/lib/runwar-3.8.1-SNAPSHOT.jar
[INFO ] runwar.context: Starting in background -
[INFO ] runwar.context: Server is up -

neither port 8080 or 7071 ever wake up… (without the JVMArgs option, lucee runs fine…) is JVMArgs or RunwarArgs the appropriate place for this ?

I did poked around the runwar repo a little but I didn’t find any glaring reason it shouldn’t pass through the -javaagent: arg properly, maybe it’s order? I just can’t seem to find the thing i’m looking for to get this to work… so i guess my question is it even possible to pass this -javaagent: through commandbox for server start ? is there another and/or better way to this that any one could think of? are there other commandbox log files in the container which could help debug this, or any other flags I should pass to make it more verbose?

Any considerations appreciated with many thanks,



Try starting your server with the --debug flag. You should see some output which will give you better visibility in to the startup errors. You can absolutely pass the -javaagent value in through the JVMArgs argument to the server start. The second colon in that argument, though seems like it might pose a syntactal problem. Are you sure that’s the correct string to pass the config in?

Also, how are you baking your custom images? You should be able to override the startup command used ( CMD in your Dockerfile ) to start up a Lucee 4.5 server exactly the way you want to.


Is there a reason you’re not using your server.json to define the jvm args. Seems like less work than customizing the start script. I’d do a --debug start and verify the exact JVM args that are used. Also, can you try testing this on a local server outside of Docker just to help troubleshoot. Add --console on to stream the servlets log directly to the console when testing locally.

Also, for future questions, we have a dedicated mailing list for CommandBox. You posted this on the ColdBox MVC list :slight_smile:



Developer Advocate
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

Um, what? My apologies for the errant email. I must have inadvertently hit the reply prompt on my smart watch and sent that. :frowning: