Index

This document explains how to setup beSee in your installed WebLogic Server. The beSee configuration proposed here is very basic and is mainly for illustration purpose.

  1. Download
  2. Installation
    1. Directory structure
    2. WebLogic integration
    3. beSee configuration
  3. Next steps
  4. Troubleshooting

Download

Download the beSee version you want from sourceforge server farm:

Installation

Directory structure

We assume you downloaded beSee and unpacked the downloaded file in $BESEE_HOME directory. For Windows users, this directory should be referenced as %BESEE_HOME%

This directory should contain at least the following:

$BESEE_HOME
	 runtime
		jakarta-regexp-1.2.jar
		log4j-1.2.6.jar
	conf
		log4j.properties
		log4j.sample.properties
		besee.properties
		besee.sample.properties
		...
	lib
		jadvise.jar
		javassist.jar
			

WebLogic integration

Modify your weblogic startup script to add the following:

  1. set $BESEE_HOME environment variable to the $BESEE_HOME directory location
  2. modify your classpath (or preclasspath - which is recommanded) to add:
     
    $BESEE_HOME/lib/javassist.jar
    $BESEE_HOME/lib/jadvise.jar
    $BESEE_HOME/besee-1-0.jar (adapt with the beSee version you installed)
    						
  3. Add the following option to the java options:
    -Dweblogic.classloader.preprocessor=com.gnilux.besee.preprocessor.ChainingPreProcessor
    -Dbesee.conf=$BESEE_HOME/conf/besee.sample.properties
    						

beSee configuration

The beSee configuration file is the one you specified with the -Dbesee.conf option.

Open $BESEE_HOME/conf/besee.sample.properties and edit the following:

  1. besee.runtime points to the complete path of the $BESEE_HOME/runtime directory - you cannot use the $BESEE_HOME syntax here
  2. besee.log points to the complete path with name of the $BESEE_HOME/conf/log4j.sample.properties file - you cannot use the $BESEE_HOME syntax here
  3. besee.keep points to the directoty where you want to backup instrumented class. You should leave it blank. Otherwise the directory must exists.
The resulting besee.sample.properties may look like this:
# the following can work on windows too
# it assumes /cvs_02 is on the same drive (C:, D: ...)
# as your BEA WebLogic Server installation
besee.runtime=/cvs_02/besee_sf/besee/runtime
besee.log=/cvs_02/besee_sf/besee/conf/log4j.sample.properties

besee.keep=
...
			

Open $BESEE_HOME/conf/log4j.sample.properties which is referenced by the besee.log configuration directive and customize as needed

Please refer to the Log4J official site for detailled documentation.

Try to start your WebLogic server using the modified script.

You should see some lines in the server stdout, and after some points, the log4j targets you configured should say some words too.

Starting WebLogic Server...
<Loading configuration C:\bea\user_projects\mydomain\.\config.xml>
<Security initializing using realm myrealm.>
<Starting WebLogic Admin Server "myserver" for domain "mydomain">
<beSee> <DEBUG> configuring runtime LibLoader with \cvs_02\besee_sf\besee\runtime
<beSee> <DEBUG> runtime: C:\cvs_02\besee_sf\besee\runtime\log4j-1.2.6.jar
<beSee> <DEBUG> runtime: C:\cvs_02\besee_sf\besee\runtime\jakarta-regexp-1.2.jar
<beSee> <DEBUG> log4j bootstrapped with /cvs_02/besee_sf/besee/conf/log4j.properties
<beSee> <DEBUG> chaining D:com.gnilux.besee.preprocessor.AllMethodsPreProcessor
<beSee> <DEBUG> chaining E:com.gnilux.besee.preprocessor.AllMethodsPreProcessor
<beSee> <DEBUG> sequence is [2]: D > E
Pre-processor com.gnilux.besee.preprocessor.ChainingPreProcessor loaded and initialized
...

Next steps

From the previous section you learned how to install beSee and check that your server is still running. Now you need to create a besee.properties and probably a log4j.properties file to suit your needs. Note that the log4j.properties file is never reloaded, to avoid having instrumented class using old log4j configuration not referenced any more.

You can refer to samples besee.xxx.properties file in the $BESEE_HOME/conf/ directory of the distribution.

For a more real world configuration, please refer to User Guide :: Reference

Troubleshooting

If you encounter startup problems after this stage, you shoudl first double-check the configuration as this document explains it.

beSee comes with a default "do nothing except stdout log" class preprocessor. Just add the besee- version .jar in the WebLogic classpath and start WebLogic with the following java options:

-Dweblogic.classloader.preprocessor=com.gnilux.besee.preprocessor.BasicPreProcessor
			
When your WebLogic starts, it should write some additionnal information on the preprocessor loading and on the classes going thru it (check also the log during an application deployment).
Starting WebLogic Server...
<Loading configuration C:\bea\user_projects\mydomain\.\config.xml>
<Security initializing using realm myrealm.>
<Starting WebLogic Admin Server "myserver" for domain "mydomain">
<beSee> <DEBUG> BasicPreProcessor.initialize()
Pre-processor com.gnilux.besee.preprocessor.BasicPreProcessor loaded and initialized
<beSee> <DEBUG> BasicPreProcessor.preProcess(weblogic.rmi.internal.dgc.DGCServerImpl_WLSkel,...)
<beSee> <DEBUG> BasicPreProcessor.preProcess(weblogic.jndi.internal.RootNamingNode_WLSkel,...)
....