This tutorial explains how to profile EJBs and JSPs
running with J2EE.
In this document:
<OptItDir> is the directory where OptimizeIt has been
installed (ex: c:\OptimizeIt\OptimizeIt311).
<J2EEDir> is the directory where J2EE has been installed
(ex: c:\j2sdkee1.2).
1) Configuring J2EE
-
Edit the setenv.bat batch file:
-
Add the OptimizeIt classes to the CLASSPATH: look for a line starting with
set CPATH= and append at the end of that line:
;<OptItDit>\lib\optit.jar
-
Add the OptimizeIt library directory to the PATH by appending at the end
of the file the following line:
set PATH=%PATH%;<OptItDir>\lib
-
Edit the policy file <J2EEDir>\lib\security\server.policy and
give the needed permissions to OptimizeIt's classes by adding the following
lines at the end of the file:
2) Creating the j2eeOptIt.bat batch file
-
Copy the j2ee.bat file to a new file called j2eeOptIt.bat.
We will perform some modifications on j2eeOptIt.bat, so you will
be able to use j2eeOptIt.bat for profiling with OptimizeIt and
still use j2ee.bat for normal use of j2ee.
-
Edit the j2eeOptIt.bat file and replace the line starting with
%JAVACMD% %SECPOLICY% by the following line:
%JAVACMD% %SECPOLICY% -classpath "%CPATH%" -Xrunoii -Xnoclassgc
-Djava.compiler=NONE intuitive.audit.Audit com.sun.enterprise.server.J2EEServer
%1 %2
3) Starting J2EE and attaching from OptimizeIt
You can now start J2EE in OptimizeIt audit system by launching j2eeOptIt.bat.
Now that J2EE is running with OptimizeIt profiler, you can start OptimizeIt
and attach to the virtual machine:
-
Start OptimizeIt from the Start menu.
-
Close the Edit Settings panel by pressing
the OK button.
-
From the Program menu, select Attach.
-
Change the port number and the hostname if necessary.
-
Press the Attach button.
Note: OptimizeIt does not have a "detach" function. If you press the stop
button in OptimizeIt, J2EE exits.
Copyright (c) 1997, 1998, 1999 Intuitive Systems Inc.
All rights reserved. Specifications subject to change without notice.
OptimizeIt is a trademark of Intuitive Systems, Inc.
Java and all Java-based trademarks and logos are trademarks
or registered trademarks of Sun Microsystems, Inc. All other brand
names and products are trademarks or registered trademarks
of their respective holders.