Working with Java Web Servers

This topic describes the configuration requirements and procedure for debugging Java web servers such as JBOSS and Apache Tomcat (both Server configuration and Windows Service configuration) in Enterprise Architect.

How To:

To attach to the process hosting the Java Virtual Machine from Enterprise Architect, follow the steps below:

Step

Action

See also

1

Ensure binaries for the web server code to be debugged have been built with debug information

 

2

Launch the server with the Virtual Machine startup option described in Server Configuration, below

 

3

Import source code into the Enterprise Architect Model, or synchronize existing code

 

4

Set breakpoints

Breakpoint and Marker Management

5

Launch the client

 

6

Attach to the process from Enterprise Architect

 

Topics:

Topic

Detail

See also

Server Configuration

The configuration necessary for the web servers to interact with Enterprise Architect must address the following two essential points:

  • Any VM to be debugged, created or hosted by the server must have the Sparx Systems Agent SSJavaProfiler75 command line option specified in the VM startup option (that is:
    -agentlib:SSJavaProfiler75)
  • The CLASSPATH, however it is passed to the VM, must specify the root path to the package source files

The Enterprise Architect debugger uses the java.class.path property in the VM being debugged, to locate the source file corresponding to a breakpoint occurring in a Class during execution; for example, a Class to be debugged is called:

a.b.C

This is located in physical directory:

C:\source\a\b

So, for debugging to be successful, the CLASSPATH must contain the root path:

c:\source

 

 

Analyzer Script Configuration

Using the Debug tab of the Build Script dialog, create a script for the code you have imported and:

  • Select the Attach to process radio button and, in the field below, type attach
  • In the Use Debugger field, click on the drop-down arrow and select Java

All other fields are unimportant; the Directory field is normally used in the absence of any Class path property

General Setup for Java

How To:

To debug, follow the steps below:

Step

Action

See also

1

Ensure that the server is running, and that the server process has loaded the Sparx Systems Agent

DLL SSJavaProfiler75.DLL

(Use Process Explorer or similar tools to prove this)

 

2

In Enterprise Architect, open the source code and set some breakpoints

Breakpoint and Marker Management

3

Click on the Debug button in Enterprise Architect

The Attach To Process dialog displays

Start and Stop Debugger

4

Select the server process hosting the application

 

5

Click on the OK button

A confirmation message displays in the Debug Output window, stating that the process has been attached

 

The breakpoints could show a question mark. In this case the Class might not have been loaded yet by the VM. If the question mark remains even after you are sure the Class containing the breakpoint has been loaded, then either:

  • The binaries being executed by the server are not based on the source code
  • The debugger cannot reconcile the breakpoint to a source file (check class paths), or
  • The JVM has not loaded the Sparx Systems agent

Learn More: