Debugging
There are several possibilities for debugging XWiki:Debugging XWiki from your IDE
Debugging with Eclipse
Once you've gotten the debugger working, you'll wonder how you ever survived without it.Complete tutorial based on M2Eclipse
Debug XWiki with EclipseDebug a XWiki released version
- Follow the steps in under Building In Eclipse including the optional "Import the WAR as a web project".
- Select from the Eclipse menu Run > Debug...
- Create a new configuration for your server
- Hit the Debug button
- Set breakpoints, step through code, have fun!
Remote Debugging
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:-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005
#!/bin/sh
JETTY_HOME=.
JETTY_PORT=8080
JAVA_OPTS="-Xmx300m -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005"
java $JAVA_OPTS -Dfile.encoding=iso-8859-1 -Djetty.port=$JETTY_PORT -Djetty.home=$JETTY_HOME -jar $JETTY_HOME/start.jar-Dcatalina.home=C:\\\Program Files\\\Apache Software Foundation\\\Tomcat 5.5 -Dcatalina.base=C:\\\Program Files\\\Apache Software Foundation\\\Tomcat 5.5 -Djava.endorsed.dirs=C:\\\Program Files\\\Apache Software Foundation\\\Tomcat 5.5\\\common\\\endorsed -Djava.io.tmpdir=C:\\\Program Files\\\Apache Software Foundation\\\Tomcat 5.5\\\temp -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.util.logging.config.file=C:\\\Program Files\\\Apache Software Foundation\\\Tomcat 5.5\\\conf\\\logging.properties -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n
Logging
Turning on logging inside XWiki
See the Logging page in the Admin guide.Logging calls at the database level
Turn on logging in your database to see all SQL queries executed against it.Generating a debug version of XWiki
Our Maven2 build has support for running a Log Aspect against XWiki's core. This Log Aspect logs all method calls with parameters. This is useful, especially in the case when you cannot debug the application (for example when you cannot reproduce the problem on your machine you can send an "aspectified" XWiki JAR and ask the user to run it and send you the logs). Note that you'll need to ask the user to add the AspectJ Runtime JAR to his WEB-INF/lib directory too. To generate the aspectified XWiki JAR, run mvn install -Pdebug in XWiki's Core module directory. See the Profiling page for more details on how to use the Aspect.
Version 4.1 last modified by ThomasMortagne on 19/05/2008 at 11:33
Document data
Attachments:
No attachments for this document
Comments: 0