Working with Java Web Servers

If you are debugging Java web servers such as JBOSS and Apache Tomcat (both Server configuration and Windows Service configuration) in Enterprise Architect, apply these configuration requirements and procedures.

Note: The debug and record features of the Visual Execution Analyzer are not supported for the Java server platform 'Weblogic' from Oracle.

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

Any VM to be debugged, created or hosted by the server must have the Sparx Systems Agent command line option specified or in the VM startup option (that is:
-agentlib:SSJavaProfiler32 or -agentlib:SSJavaProfiler64)

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 it, 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.

Run the Debugger

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

Step

Action

See also

1

Run the server and check that the server process has loaded the Sparx Systems Agent:

DLL SSJavaProfiler32.DLL or SSJavaProfiler64

Use 'Process Explorer' or similar tools to prove that the server process has loaded the agent.

2

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