Welcome to the jGuard's wiki » jGuard Documentation » Libraries and bootclasspath

Libraries and bootclasspath

Last modified by RaffaelloPelagalli on 2006/03/02 22:00

Libraries and bootclasspath

Required librairies

You should place the required libraries (dom4j-1.5.1.jar,jGuard_jvm_x.xx.jar,your_jdbc_driver.jar), under the ${java.home}/lib directory.

Append your bootclasspath

jGuard requires that you append the paths to the required libraries at the end of the java bootclasspath. It can be done with these arguments:

-Xbootclasspath/a:path_to_the_first_jar;path_to_the_second_jar....

Note this option is non standard (and theorically can disappear in future java versions); but it is implemented in all the notorious JVM implementations. Therefore, the risk seems limited that this option will disappear, for backward compatibility vendor reasons. To append to the bootclasspath, there are specific ways for each application server. You should consult the related documentation of your application server. For example, on the TOMCAT application server, according to the tomcat FAQ, you should do this: Set JAVA_OPTS BEFORE calling startup.bat or before calling catalina.bat. (or you can edit those files, but it isn't advised) Example (windows):

SET JAVA_OPTS='-Xbootclasspath/a:C:/java/j2sdk1.4.2_04/jre/lib/jGuard_jvm_0.64.jar;
C:/java/j2sdk1.4.2_04/jre/lib/pg73jdbc3.jar;C:/java/j2sdk1.4.2_04/jre/lib/dom4j-1.5.jar;'

Example (UNIX):

export JAVA_OPTS='-Xbootclasspath/a:/java.home.location/lib/jGuard_jvm_x.xx.jar;
/java.home.location/lib/dom4j-1.5.jar;/java.home.location/lib/your_jdbc_driver.jar'

=> jdbc driver is only required if you use a database related loginModule or a database related PermissionManager. TIPS: under Windows xp (or others NT platforms), i've set JAVA_OPTS with system settings/variables: on your explorer, right-click on the workstation icon > properties > advanced >environment settings : add a system variable called 'JAVA_OPTS' with the required value:

"-Xbootclasspath/a:C:/java/j2sdk1.4.2_04/jre/lib/jGuard_jvm_0.64.jar;
C:/java/j2sdk1.4.2_04/jre/lib/pg73jdbc3.jar;C:/java/j2sdk1.4.2_04/jre/lib/dom4j-1.5.1.jar;"

Note this example setting only runs with the tomcat application server (tested on tomcat 4.1.24), with a Postgresql database (the postgresql driver is present in the JAVA_OPTS variable). Each application server has a specific configuration to append the bootclasspath.

  • On the JRUN 4 application server, the default JVM configuration file jvm.config is located under the jrun_root/bin/ directory. So, in this file, edit the java.args property and add the following code:
java.args=-Xbootclasspath/a:C:/java/j2sdk1.4.2_04/jre/lib/jGuard_jvm_0.64.jar;
C:/java/j2sdk1.4.2_04/jre/lib/pg73jdbc3.jar;C:/java/j2sdk1.4.2_04/jre/lib/dom4j-1.5.1/jar;

  • On the Websphere 5 application server, you can append the bootclasspath with the websphere admin console. You can reach the relating screen by clicking on Servers > application servers > server_name > process definition > JVM > configuration tab
Tags:
Created by diabolo512 on 2006/02/09 14:44

jGuard team copyright 2004-2009
3.1.1