views:

655

answers:

2

I'd like to generate sequence diagrams of a running java ee application using jtracert. How do I do this?

+1  A: 

There's a "Quick Start" chapter on the project main page: http://code.google.com/p/jtracert/

In a few words: 1. Install SDEdit (it's absolutely free) http://sdedit.sourceforge.net/ 2. Open SDEdit 3. Choose Item Start/stop RT server in menu Extras 4. Enter any port you like and press ok 5. Add the following parameters to your application startup: -DanalyzerOutput=sdEditRtClient -DsdEditHost=127.0.0.1 -DsdEditPort=60001 -javaagent:jTracert.jar

The place where you should specify these parameters depends on your application server.

A few examples are stated below. Please note that you should replace jTracert.jar with real jar name, like jTracert-0.0.3.jar!

WebLogic 9+

Windows

File: %DOMAIN_HOME%\bin\startWeblogic.cmd. Add the following line:

set JAVA_OPTIONS=-DanalyzerOutput=sdEditRtClient -DsdEditHost=127.0.0.1 -DsdEditPort=60001 -javaagent:jTracert.jar %JAVA_OPTIONS%

Linux

File: $DOMAIN_HOME\bin\startWeblogic.sh. Add the following line:

JAVA_OPTIONS="-DanalyzerOutput=sdEditRtClient -DsdEditHost=127.0.0.1 -DsdEditPort=60001 -javaagent:jTracert.jar $JAVA_OPTIONS"

GlassFish V2

Windows & Linux

File: %DOMAIN_HOME%\config\domain.xml

Search for jvm-options element and add the elements -DanalyzerOutput=sdEditRtClient -DsdEditHost=127.0.0.1 -DsdEditPort=60001 -javaagent:jTracert.jar Start the domain as usual.

A: 

See http://www.reversejava.com for a dynamic reverse engineering application which generates UML Sequence diagram and view of Participating Class diagram from any Java Application at runtime All you have to do is just run your application and sit back. Reverse Java runs in background tracing all the activities happening inside your application and creates UML diagram for you.

Rajesh Jadhav