WebLogic JVM wide instrumentation

This document explains the detail of setting up instrumentation provided by beSee-1-x to a complete WebLogic instance. As you can read in beSee 1-x documentation, the initial solution could only instrument deployed application, making it difficult for example to track down SQL calls since JDBC drivers are not a deployed application.

The beSee 2 architecture unleash those features to your whole BEA WebLogic.

  1. Supported environments
  2. Usage
  3. Sample

Supported environments

The solution is available with the following environment:

  • java 1.3 or java 1.4
  • WebLogic 7 (not tested on 6.1)
  • Javassist instrumentation needed (required by beSee-1-x)

Usage

You will need the following libraries (please refer to the download area on SourceForge ):

  • beSee 1-x (provides instrumentation for WebLogic)
  • javassist.jar (required by besee 1-x)
  • beSee 2-x (provides JVM wide instrumentation)
  • beSee 2-x beSee extension (allow plugin of beSee 1-x in 2-x)

Set up a directory structure and a configuration as described in beSee 1-x documentation available here .

Refer to the user guide of beSee 2-x JVM wide hook here to understand the impact of the following:

  • add the following to your WebLogic classpath (adapt to the version you are using):
    • besee-ext-besee-2-x.jar
    • besee-1-0.jar
  • define the class preprocessor as -Dbesee.classloader.preprocessor=com.gnilux.besee.BeseeAdapter
  • define the beSee 1-x configuration as described in beSee 1-x documentation thru -Dbesee.conf=...

Given those explanation, your WebLogic startup script might look like:

echo off
SETLOCAL

@rem *** define main location where jar resides
set WL_ROOT=C:\bea
set BESEE_HOME=C:\cvs_02\besee_sf\besee2
set BESEE_VERSION=-2-0-snapshot.jar

@rem *** use Xbootclasspath instead of HotSwap (see beSee 2-x doc)
set BESEE_OPTIONS=-Dbesee.classloader.clbootclasspath=%BESEE_HOME%\build\boot

@rem *** beSee 2-x and jar required for instrumentation must be in bootclasspath
set BESEE_CP=%BESEE_HOME%\build\dist\besee%BESEE_VERSION%;%BESEE_HOME%\lib\javassist.jar

@rem *** adapt to your needs
set WLS_USER=system
set WLS_PW=weblogic

@rem *** define java version and weblogic home
set WL_HOME=%WL_ROOT%\weblogic700
set JAVA_HOME=%WL_ROOT%\jdk131_03

@rem *** change dir to your weblogic installation
cd "%WL_ROOT%\user_projects\mydomain"

@rem *** set SERVER_NAME to the name of the server you wish to start up.
set SERVER_NAME=myserver

@rem *** set any other options
@rem set STARTMODE=false
@rem set JAVA_OPTIONS=-Dweblogic.security.SSL.trustedCAKeyStore=%WL_HOME%\server\lib\cacerts
@rem set JAVA_VM=
@rem set MEM_ARGS=-Xms32m -Xmx200m


set CLASSPATH=%JAVA_HOME%\lib\tools.jar;%WL_HOME%\server\lib\weblogic_sp.jar;%WL_HOME%\server\lib\weblogic.jar

@rem *** set PATH needed for JPDA libraries (needed if you are using HotSwap)
set PATH=.;%WL_HOME%\server\bin;%JAVA_HOME%\bin;%JAVA_HOME%\jre\bin

@rem *** BESEE 1-x with BESEE 2-x
@rem *** add beSee jars to weblogic classpath
set BESEE_1_CP="%BESEE_HOME%\build\dist\besee-ext-besee%BESEE_VERSION%"
set BESEE_1_CP="%BESEE_1_CP%;%BESEE_HOME%\extension\besee\lib\besee-1-0.jar"
set BESEE_1_CP="%BESEE_1_CP%;%BESEE_HOME%\extension\besee\lib\weblogic-pp.jar"

@rem *** the following MUST be written in a single line
"%JAVA_HOME%\bin\java"
	%BESEE_OPTIONS%
	-cp %JAVA_HOME%\lib\tools.jar;%BESEE_CP%
	com.gnilux.besee.hook.ProcessStarter
		-Xbootclasspath/p:"%BESEE_CP%"
		-Dbesee.classloader.preprocessor=com.gnilux.besee.BeseeAdapter
		-Dbesee.conf=%BESEE_HOME%\..\besee\conf\besee.sample.properties
		%JAVA_VM% %MEM_ARGS% %JAVA_OPTIONS%
		-cp "%BESEE_1_CP%;%CLASSPATH%"
		-Dweblogic.Name=%SERVER_NAME%
		-Dbea.home="%WL_ROOT%"
		-Dweblogic.management.username=%WLS_USER%
		-Dweblogic.management.password=%WLS_PW%
		-Dweblogic.ProductionModeEnabled=%STARTMODE%
		-Djava.security.policy="%WL_HOME%\server\lib\weblogic.policy"
		weblogic.Server

ENDLOCAL
	

Sample

Consult the sample output from a servlet->CMP+DAO sequence call on WebLogic/Oracle here