Changes for page Debugging
Last modified by Simon Urli on 2023/10/10 11:46
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -9,8 +9,28 @@ 9 9 10 10 1.1 Remote Debugging 11 11 12 -To perform remote debugging youstartXWiki in debug modeand thenuseyourIDE to attachotherunning JVM.You canthenput breakpointsin thecode.12 +To perform remote debugging, start you wiki in debug mode. To do this modify the way you start your container and ensure that the following JVM parameters are passed: 13 13 14 +{code} 15 +-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 16 +{code} 17 + 18 +For example, for Jetty you could use the following start script: 19 + 20 +{code} 21 +#!/bin/sh 22 + 23 +JETTY_HOME=. 24 +JETTY_PORT=8080 25 +JAVA_OPTS="-Xmx300m -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005" 26 + 27 +java $JAVA_OPTS -Dfile.encoding=iso-8859-1 -Djetty.port=$JETTY_PORT -Djetty.home=$JETTY_HOME -jar $JETTY_HOME/start.jar 28 +{code} 29 + 30 +Then, in your favorite IDE, open the XWiki project and run a remote debugging session, attached to the socket on port 5005. For example, using IntelliJ IDEA, go to ~~Run|Edit Configurations...~~ and create a new ~~Remote~~ configuration (default parameters should be fine). Then execute it and IDEA will connect to the executing JVM. 31 + 32 +You can then place breakpoints in your source code. 33 + 14 14 1.1 Logging 15 15 16 16 Several possibilites: