My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
HowToAnalyzeJ2EEApplication  
A short tutorial for using jTracert for analyzing J2EE applications
Featured, Phase-Deploy
Updated Feb 4, 2010 by Dmitry.Bedrin

Introduction

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

The only difference for J2EE application is the place, where you should specify jTracert JVM parameters (-javaagent: ...). This place depends on your application server.

A few examples are stated below.

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=7007 %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=7007 $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=7007 Start the domain as usual.

Other Application Servers

Just use your application server reference in order to find out where your should specify these parameters (JVM parameters actually).

Comment by sunil_th...@yahoo.com, Jun 7, 2009

Hi.

I am using GlassFish? V2. I added the jvm option element as described by u. But when I am starting the server I am getting the error "Error opening zip file or JAR manifest missing : jTracert.jar". So could u please tell me the cause for the same and how can I remove this error.

Comment by project member Dmitry.Bedrin, Jun 7, 2009

Check the troubleshooting page - this issue it described there:

http://code.google.com/p/jtracert/wiki/Troubleshooting#Error_opening_zip_file:_jTracert.jar

Comment by sunil_th...@yahoo.com, Jun 10, 2009

Hi.

I have installed jTracert at C:\Program Files\jTracert and my glassfish server location is C:\Program Files\glassfish-v2ur2.

So what path should i provide in domain.xml???

when i m providing "-DanalyzerOutput?=sdEditRtClient -DsdEditHost?=127.0.0.1 -DsdEditPort?=60001 -javaagent:C:\Program Files\jTracert\jTracert.jar=7007" in jvm-options i m getting same error.

So please help me. please provide me the exact path that i should write.

Comment by sunil_th...@yahoo.com, Jun 10, 2009

Or few times i get the message "jTracert agent started agent version: 0.1.2

WARNING! You have selected deprecated analyzer output format! It will be removed in further versions of jTracert!

Waiting for a connection from jTracert GUI on port 7007 Timeout waiting for domain domain1 to go to starting state."

Comment by project member Dmitry.Bedrin, Jun 10, 2009

First of all, you should execute the jTracert GUI.

Fill in the required fields in connection dialog, and copy the "-javaagent ..." string from the dialog.

After that, just paste this line to your domain.xml

Hope it helps.

Comment by sunil_th...@yahoo.com, Jun 10, 2009

on doing so i m getting the error " java.net.BindException?: Address already in use: JVM_Bind

at java.net.PlainSocketImpl?.socketBind(Native Method) at java.net.PlainSocketImpl?.bind(PlainSocketImpl?.java:359) at java.net.ServerSocket?.bind(ServerSocket?.java:319) at java.net.ServerSocket?.<init>(ServerSocket?.java:185) at java.net.ServerSocket?.<init>(ServerSocket?.java:97) at com.google.code.jtracert.traceBuilder.impl.serializable.SerializableTcpServer?.run(SerializableTcpServer?.java:75) at java.lang.Thread.run(Thread.java:619)"

Comment by project member Dmitry.Bedrin, Jun 10, 2009

Looks like you already have a Java process running with jTracert agent.

Kill other java processes or just try another port number (say 7008). Restart should also help.

Comment by sunil_th...@yahoo.com, Jun 10, 2009

i did but all in vain. it shows same error.

also i found that i could run using this command "java -DanalyzerOutput?=sdEditRtClient -DsdEditHost?=127.0.0.1 -DsdEditPort?=60001 -javaagent:jTracert.jar -jar yourApplicationJar.jar".

but it too shows error "Failed to load Main-Class manifest attribute from App1.jar" As i am using netbeans my jar file is created in dist folder. so what path should i specify in place of yourApplicaiotnJar

Comment by sunil_th...@yahoo.com, Jun 10, 2009

Hi Dmitry.

Finally i managed to run server by including path in jvm option. Now I want to ask what should I do so as the entity beans are included in GUI and diagram is generated from it.

Comment by project member Dmitry.Bedrin, Jun 10, 2009

Glad that it's working. This wiki page is a little bit deprecated.

Talking about entity beans - jTracert should analyze any executed code including entity beans.

As far as I understand, you can see some diagrams, but the diagrams generated from entity beans are missing. Right?

Please check once more the class filter you're using. Perhaps you're setting the incorrect filter.

Comment by sunil_th...@yahoo.com, Jun 10, 2009

Well I haven't got any diagram :(

I have created an Enterprise Application consisting EJB Module and Web Module. All my entities are in entity package and my project name is portfolio.

So what should I provide in filter????

Comment by project member Dmitry.Bedrin, Jun 10, 2009

It's just a regular expression for class names.

For example, if your application contains classes in package com.mycompany, you should set this filter to: com\.mycompany.

Comment by j...@ntrs.com, Jul 7, 2009

Hello, Did the following for a Weblogic J2EE app, but the connection wizard goes away and no errors are detected ?

1. Set server command options C:\bea-8.1sp3\user_projects\domains\unitdomain8v3\startWebLogic.cmd -XDebug -javaagent:C:\Program%20Files\jTracert\jTracert.jar=7007

2. Select project folder containing .java files C:\projects\ja8\fdp\projects\common\src\com\ntrs\ewb

3. Set class filter .

Comment by project member Dmitry.Bedrin, Jul 8, 2009

Hello!

You shouldn't pass jTracert command line options to startWebLogic.cmd Instead you should edit startWebLogic.cmd file and a line like in this article to this file.

If you're using managed server for deploying your application, you can use WebLogic? console to specify these parameters.

Comment by briansa...@gmail.com, Mar 10, 2010

Hi,

I have an j2ee application deployed in weblogic. i have set up everything but i cannot generate sequences after weblogic has started up. It just shows me the classed that are loaded at startup. how do i see classes as i use my app? Thanks

Comment by dharmb...@gmail.com, Mar 20, 2010

HI, I dont have any .jar files, mine are just a set of java files that call some other java files where teh functions are defined. In that case I can point jtracert to the directory where all the java files are kept. Will it be able to diagram from it ?

Sorry, I dont have any Java language knowledge. I am a network engineer who have some java files to do his network related tasks ( telnet to router and then execute cisco CLI cmd to configure the device)

Regards Dharmesh

Comment by manoja...@gmail.com, Dec 30, 2011

when i open jtracert, jtracert connection wizard comes, after filling the details when i click on connect, wizard dissapears and nothing happens.

Please suggest.


Sign in to add a comment
Powered by Google Project Hosting