*Deprecated* This material is for historical purposes only See https://wiki.duraspace.org/display/VIVODOC/All+Documentation for current documentation
*Deprecated* See https://wiki.duraspace.org/display/VIVODOC/All+Documentation for current documentation
VIVO development can be made easier by running VIVO with a debugger. The ability to set breakpoints, see the values of variables, and follow the program flow can frequently save the a lot of time.
These instructions tell how to connect the Eclipse debugger to Tomcat, running as an remote application. This is only one possible configuration. We welcome input from developers who have used other configurations. When is one configuration better than another?
These instructions assume that you are working with a released version of VIVO. If you prefer to get VIVO directly from the Subversion repositories, your process will be slightly different.
These instructions were written using Eclipse 3.7 (Indigo) and Tomcat 7.0, running on Mac OS X 10.6 (Snow Leopard).
Get the latest release of VIVO from SourceForge at
VIVO Application Source
Unpack the release, configure and install VIVO according to the instructions in install.html
.
This is one way to do it, which will work with a released copy of VIVO. If you prefer to get VIVO directly from the Subversion repositories, your process will be slightly different.
Tomcat will start in debug mode if a few simple environment variables are set. The easiest way to do this is to start Tomcat with a script. For example, you can create a script called debugTomcat
that looks like this:
#!/bin/sh
export JPDA_TRANSPORT=dt_socket
export JPDA_ADDRESS=8000
export JPDA_SUSPEND=y
/Library/Tomcat/bin/catalina.sh jpda start
dt_socket
for JPDA_TRANSPORT says that Tomcat will use a socket connection to Eclipse.You need to set the parameters for connecting Eclipse to Tomcat. This is mostly a matter of accepting the defaults for an external application. Assign a name to the configuration and make sure that the correct project name is selected. Then click “Apply”.
You can add or remove breakpoints at any time, but if you are debugging code that runs when VIVO starts, you will want to set the breakpoints before starting Tomcat.
To set a breakpoint, open the source file, move your mouse to the left margin of the line where you want the break, and right-click. The context menu that appears should include the option to “Toggle Breakpoint”.
Use the script that you created to start Tomcat. Note that Tomcat will wait for the connection to Eclipse, so you will not see any new entries in the log, or any signs of activity until the connection is made.
Select the debug configuration that you created and start choose “Debug” .
You can stop Tomcat as you usually would, or you can choose to terminate it from within Eclipse. You can also choose to disconnect Eclipse from Tomcat which will allow Tomcat to continue running normally.