[PATCH 2 of 2] Give hints for remote debugging artifact server

Wald Commits scm-commit at wald.intevation.org
Thu Nov 10 15:49:27 CET 2022


# HG changeset patch
# User Tom Gottfried <tom at intevation.de>
# Date 1668091336 -3600
#      Thu Nov 10 15:42:16 2022 +0100
# Branch 3.2.x
# Node ID 9bbb29142ddb3edfb6582f99a7f3ffc89150e85e
# Parent  a83029cc7e6afd3e7198006259600cea890248ac
Give hints for remote debugging artifact server

diff -r a83029cc7e6a -r 9bbb29142ddb artifacts/bin/run.sh
--- a/artifacts/bin/run.sh	Thu Nov 10 15:39:07 2022 +0100
+++ b/artifacts/bin/run.sh	Thu Nov 10 15:42:16 2022 +0100
@@ -12,7 +12,7 @@
 
 export CLASSPATH
 
-exec java -Xmx1024m \
+exec java $JAVA_OPTS -Xmx1024m \
      -server \
      -Djava.awt.headless=true \
      -Dflys.datacage.recommendations.development=false \
diff -r a83029cc7e6a -r 9bbb29142ddb docker/README
--- a/docker/README	Thu Nov 10 15:39:07 2022 +0100
+++ b/docker/README	Thu Nov 10 15:42:16 2022 +0100
@@ -15,6 +15,14 @@
 See docker/flys_user_file for credentials.
 
 
+Remote debugging:
+
+To enable remote debugging of the artifact server, uncomment the respective
+lines in docker-compose.yml, recreate the service and e.g. attach with JDB:
+$ docker-compose up -d
+$ jdb -attach <your-docker-host>:8787 -sourcepath<your-checkout>/artifacts/src/main/java
+
+
 TODO:
 _ Avoid having to change configuration manually
 _ Something better than setting framework and http-client to a branch
diff -r a83029cc7e6a -r 9bbb29142ddb docker/docker-compose.yml
--- a/docker/docker-compose.yml	Thu Nov 10 15:39:07 2022 +0100
+++ b/docker/docker-compose.yml	Thu Nov 10 15:42:16 2022 +0100
@@ -21,6 +21,11 @@
     volumes:
       - ../artifacts/doc/conf:/opt/d4e/bin/conf
       - artifacts-data:/opt/d4e/bin/artifacts-data
+    # Uncomment to enable remote debugging from anywhere (caution: security risk!)
+    # environment:
+    #   - JAVA_OPTS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=0.0.0.0:8787
+    # ports:
+    #   - 8787:8787
   mapserv:
     container_name: "d4eriver-mapserv"
     build:


More information about the Dive4Elements-commits mailing list