Remote Debugging Google App Engine Application on Eclipse

Table of contents
Reading Time: 2 minutes

Sometimes it is handy to debug our application source code even when it is executing outside our IDE. This blog will explain how can we remotely debug a web application project developed in Google App Engine on eclipse IDE.

The linux command to start web application on Google App engine development application server is

[sourcecode language=”bash”] <exploded WAR directory path>

The command runs the application on embedded Jetty server. The problem then reduces to do remote debugging of application with eclipse. We only have to open a debug port on jetty to connect to.

Edit the file to this

[sourcecode language=”bash”]
# Launches the development AppServer
[ -z "${DEBUG}" ] || set -x # trace if $DEBUG env. var. is non-zero
SDK_BIN=`dirname $0 | sed -e "s#^\([^/]\)#${PWD}/\1#"` # sed makes absolute
java -ea -cp "$SDK_LIB/appengine-tools-api.jar"
–jvm_flag=-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=1044 $*

This will open a listening port on 1044 which eclipse can connect to using remote debugging. Let us look at how can we configure eclipse IDE to remotely debug our application. In your Eclipse IDE

1. Goto Run->Open Debug Configuration
2. Right click on Remote Java Application option in the left hand menu tree and say new
3. Create a remote java application debug configuration like this

4. Add the sources to the configuration. These should be all your java projects.These are required so that while remotely debugging you can walk through your code

Now, we have configured google app engine development server as well as Eclipse IDE for debugging. Start your application on development server by running the following command at command prompt:
[sourcecode language=”bash”]
./appengine-java-sdk/bin/ <exploded war path>
and in eclipse open debug configuration and click on debug button. The debug view would now open at the first breakpoint.

1 thought on “Remote Debugging Google App Engine Application on Eclipse2 min read

Comments are closed.