OpenSubsystems

Business Components for Java Applications

Documentation

Debugging
Remote Application

Last modified

$Author: bastafidli $
$Date: 2006/08/27 07:52:09 $
$Revision: 1.5 $
$RCSfile: debuggingapplication.html,v $

Preparation

OpenSubsystems based applications can be deployed either using various J2EE application servers or even without one, running directly on top of JVM. Eclipse integrated development environment allows to conveniently debug application from within IDE even if it runs inside of J2EE application server. First the application needs to be built using the Build or Update targets as described in the build process and building web application documents. Once the build is finished, deploy the created WAR or EAR file into your j2ee server.

Remote application setup

Go to Run menu and select Debug... menu item. In the Configurations dialog select Remote Java Application and click the New button. In the newly open page type name of the remote application you are going to debug, for example OSSRemoteApplication. The same configuration can be used for any j2ee server as long as the debugging port (explained below) matches the settings.

Click on the Browse button next to Project edit box. In the Project Selection dialog select the OpenSubsystems project and close the dialog with OK button. Next enter Connection Properties, which means Host and Port. As host you can specify localhost or IP address of the machine where the j2ee server where the application is deployed is runnign Port has to be the same as defined in java options for particular j2ee server. In the configuration file for your j2ee server looks for settings, which look similar to these

-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n

The number following the address specifies the port, here it is for example 8787. Next check Allow termination of remote VM checkbox. Finally click on the Apply button.

Setup remote application

Debugging

Set breakpoints in the source code. Go to Run menu and select Debug... menu item. In the Configurations dialog for under Remote Java Application node select particular name (for example OSSRemoteApplication). Next click the Debug button. Now start working with your application. Once a breakpoint is hit, Eclipse will flash on the taskbar and the execution will be stopped at your breakpoint.

If in the settings above is the suspend set to y, the JVM running the j2ee server will stop immediately after it is started. This allows you to debug events, which may occur during server startup.

Previous: Validating Web User Interface