In This Topic
This topic describes how to debug XperienCentral plugins using Eclipse. It is assumed that XperienCentral is up and running and that the plugin has been deployed.
To debug a plugin in Eclipse, follow these steps:
- Create a new launch application in the Run > Debug Configurations panel by selecting "Remote Java Application" and clicking the upper left-hand button:
- Give it a meaningful name ans select the project associated with the plugin.
- Ensure that the rest of the settings (Host, localhost, Port), are correct:
During the start-up of XperienCentral Community Edition, Tomcat will also display this port in the console (dt_socket): - Ensure that the source files you want to debug are referenced in the "Source" tab of the created launch configuration. For example:
- When you click [Debug], Eclipse will make a connect to your Tomcat installation.
- Switch to the "Debub" perspective (Window > Open Perspective > Debug). You can now add breakpoints to your Java classes using the right mouse button. For example:
Using the buttons in the "Debug" perspective, you can now debug your plugin:
Hot Code Replacement for to Remotely Debug Plugin
To allow Java code to be `hot replaced` while remote debugging from the Eclipse IDE, you need to add the following Java option to the start-up script of the Catalina server. This way you would not need to redeploy a WCB due to small changes in the Java code during debugging.
Inside the start-up script of Tomcat (e.g.
C:\GX\XperienCentral\apache-tomcat\bin\startup.bat
) replace the following line:set JAVA_OPTS=%JAVA_OPTS% -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n
withset JAVA_OPTS=%JAVA_OPTS% -Xdebug -agentlib:jdwp=transport=dt_socket,address=localhost:8000,server=y,suspend=n
Restart Tomcat.