You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Remote debugging is very useful for tracing through the source code during the execution of the application. In order to enable remote debugging, you need to provide specific JVM options that tell the servlet container (Tomcat or Jetty) to open a port to which a debugger will attach. Additionally, you need to create a debugging profile in your IDE (Intellij or Eclipse) that specifies the host and port to which to attach the debugger.

JVM Options

Tomcat

On Ubuntu, update your /etc/defaults/tomcat7 file with:

JAVA_OPTS="${JAVA_OPTS} -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n"

Restart Tomcat for the options to take effect.

Jetty (with Maven)

Using `mvn jetty:run`, you can pass in the JVM options at the command line:

> cd fcrepo4
> MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=1024m -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y" mvn jetty:run -pl fcrepo-webapp/

IDE Debugger Profiles

Intellij

  1. Select `Edit Configuration`
  2. Create `Remote` configuration
  3. Change port to match what you passed above in your JVM options
  4. Run the debugger

Eclipse

<needs to be populated by someone who uses Eclipse>

 

  • No labels