chapmandu
01/24/2024, 1:30 AM{
"name": "myapp",
"jvm": {
"args": [
"-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=localhost:9999",
"-javaagent:/app/lib/luceedebug.jar=jdwpHost=localhost,jdwpPort=9999,debugHost=0.0.0.0,debugPort=10000,jarPath=/app/lib/luceedebug.jar"
]
}
}
AFTER: docker-compose.yml
services:
myapp:
image: myapp_commandbox-alpine
build:
context: .
dockerfile: ./docker/commandbox/myapp/Dockerfile
environment:
ENVIRONMENT: "development"
# commandbox settings
BOX_SERVER_JVM_ARGS: "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=localhost:9999 -javaagent:/app/lib/luceedebug.jar=jdwpHost=localhost,jdwpPort=9999,debugHost=0.0.0.0,debugPort=10000,jarPath=/app/lib/luceedebug.jar"
I can see the BOX_SERVER_JVM_ARGS are loaded by commandbox...
| √ | Overriding server.json values from env vars
| |----------------------------------------------------------
| | Overridding [JVM.ARGS] with OS environment variable [BOX_SERVER_JVM_A
| | RGS
But I'm expecting to see the output below, but there is no reference to luceedebug at all:
Listening for transport dt_socket at address: 9999
[luceedebug] fs is case sensitive: true
[luceedebug] agent premain complete
...
CommandBox 5.8.0+00695bdw429s
01/24/2024, 3:36 AMchapmandu
01/24/2024, 4:09 AMchapmandu
01/24/2024, 4:18 AM--verbose
flag when starting the docker container?bdw429s
01/24/2024, 4:25 AMbdw429s
01/24/2024, 4:25 AMbdw429s
01/24/2024, 4:25 AMchapmandu
01/24/2024, 4:30 AMchapmandu
01/24/2024, 4:30 AM| Server start command:
| /opt/java/openjdk/bin/java
| -Djava.util.logging.config.file=/usr/lib/build/resources/text.log
| ging.properties
| -Xmx1024m
| -Xms256m
| -cp /usr/lib/CommandBox/lib/runwar-4.8.3.jar runwar.Start
| --background=false
| --host 0.0.0.0
| --stop-port 45267
| --processname myapp [lucee 5.3.10+97]
| --log-dir /app/.deploy/serverhome//logs
| --server-name myapp
| --tray-enable false
| --dock-enable true
| --directoryindex true
| --timeout 240
| --proxy-peeraddress false
| --cookie-secure false
| --cookie-httponly false
| --pid-file /app/.deploy/serverhome//.pid.txt
| --resource-manager-file-system-watcher=false
| --log-pattern=[%p] %d{yyyy-MM-dd'T'HH:mm:ssXXX} %c - %m%n
| --tray-icon /usr/lib/CommandBox/cfml/system/config/server-icons/t
| rayicon-lucee.png
| --gzip-enable true
| --logaccess-enable true
| --logaccess-basename access
| --logaccess-dir /app/.deploy/serverhome//logs
| --cfengine-name lucee
| -war /app/
| --web-xml-path /app/.deploy/serverhome//WEB-INF/web.xml
| --http-enable true
| --ssl-enable true
| --ajp-enable false
| --http2-enable true
| --open-browser false
| --open-url <https://0.0.0.0:443>
| --port 8080
| --ssl-port 443
| --urlrewrite-enable true
| --client-cert-trust-headers false
| --urlrewrite-file /app/urlrewrite.xml
| --predicate-file /app/.deploy/serverhome//.predicateFile.txt
| Dry run specified, exiting without starting server.
|------------------------------
| √ | Overriding server.json values from env vars
| |----------------------------------------------------------
| | Overridding [JVM.ARGS] with OS environment variable [BOX_SERVER_JVM_A
| | RGS
| | Overridding [RUNWAR.ARGS] with OS environment variable [BOX_SERVER_RU
| | NWAR_ARGS
| | Overridding [APP.SERVERHOMEDIRECTORY] with OS environment variable [B
| | OX_SERVER_APP_SERVERHOMEDIRECTORY
| | Overridding [APP.CFENGINE] with OS environment variable [BOX_SERVER_A
| | PP_CFENGINE
| | Overridding [CFCONFIGFILE] with OS environment variable [BOX_SERVER_C
| | FCONFIGFILE
chapmandu
01/24/2024, 4:31 AMchapmandu
01/24/2024, 4:41 AMCommandBox> env show BOX_SERVER_JVM_ARGS
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=localhost:9999 -javaagent:/app/lib/luceedebug.jars=jdwpHost=localhost,jdwpPort=9999,debugHost=0.0.0.0,debugPort=10000,jarPath=/app/lib/luceedebug.jars
chapmandu
01/24/2024, 4:48 AM2756b51161fc:/app# ps aux | grep java
1 root 1:23 /opt/java/openjdk/bin/java -Djava.util.logging.config.file=/usr/lib/build/resources/text.logging.properties -Xmx1024m -Xms256m -cp /usr/lib/CommandBox/lib/runwar-4.8.3.jar runwar.Start --background=false --host 0.0.0.0 --stop-port 45267 --processname myapp [lucee 5.3.10+97] --log-dir /app/.deploy/serverhome//logs --server-name myapp --tray-enable false --dock-enable true --directoryindex true --timeout 240 --proxy-peeraddress false --cookie-secure false --cookie-httponly false --pid-file /app/.deploy/serverhome//.pid.txt --resource-manager-file-system-watcher=false --log-pattern=[%p] %d{yyyy-MM-dd'T'HH:mm:ssXXX} %c - %m%n --tray-icon /usr/lib/CommandBox/cfml/system/config/server-icons/trayicon-lucee.png --gzip-enable true --logaccess-enable true --logaccess-basename access --logaccess-dir /app/.deploy/serverhome//logs --cfengine-name lucee -war /app/ --web-xml-path /app/.deploy/serverhome//WEB-INF/web.xml --http-enable true --ssl-enable true --ajp-enable false --http2-enable true --open-browser false --open-url <https://0.0.0.0:443> --port 8080 --ssl-port 443 --urlrewrite-enable true --client-cert-trust-headers false --urlrewrite-file /app/urlrewrite.xml --predicate-file /app/.deploy/serverhome//.predicateFile.txt
bdw429s
01/24/2024, 5:00 AMchapmandu
01/24/2024, 5:27 AMbdw429s
01/24/2024, 5:36 AMset BOX_SERVER_JVM_ARGS="-foo"
start --debug
in CommandBox and the server totally uses that arg 🤷bdw429s
01/24/2024, 5:36 AMServer start command:
| C:\Users\brad\.CommandBox\serverJREs\openjdk11_jre_x64_windows_hotspot_jdk-11.0.22+7\bin\java.exe
| -foo
chapmandu
01/24/2024, 5:37 AMbdw429s
01/24/2024, 5:40 AMbdw429s
01/24/2024, 5:40 AMserver info property=JVMargs
bdw429s
01/24/2024, 5:41 AMserver info property=JVMargsArray
chapmandu
01/24/2024, 5:42 AMbox server info property=JVMargsArray
[
"-Djava.util.logging.config.file=/usr/lib/build/resources/text.logging.properties"
]
chapmandu
01/24/2024, 9:40 PM-foo
but it also is not showing in the console. The difference could be that I am setting the env var in the docker compose file. Commandbox has access to the variable after the container has started..
env show BOX_SERVER_JVM_ARGS
-agentlib:jdwp=transport ... /luceedebug.jars
But it doesn't seem to load the luceedebug.jar when the BOX_SERVER_JVM_ARGS is set in the docker-compose filechapmandu
01/28/2024, 9:56 PMbdw429s
01/29/2024, 6:56 PM./docker/commandbox/myapp/Dockerfile
. @jclausen may have some ideas as well. At the end of the day, CommandBox is just CFML code. Feel free to put in debugging in the part where it looks for that env var that prints out the console. It's the loadOverrides()
function in the ServerService
jclausen
01/29/2024, 6:59 PMJAVA_TOOL_OPTIONS
environment variable, but I’m not sure if that will blow up using the luceedebug jar.chapmandu
01/30/2024, 8:14 PM