Sun Java System Access Manager Policy Agent 2.2 Guide for JBoss Application Server 4.0

Setting the Classpath for the JBoss Application Server 4.0 Instance

The JBOSS_CLASSPATH variable must be set to the agent's configuration and locale directories. To set the JBOSS_CLASSPATH variable, modify the appropriate JBoss startup script, depending on your platform:

The changes to the startup script call the setAgentClassPath script, which sets the JBOSS_CLASSPATH variable when you run the script.


Note –

These changes are based on running the scripts as follows:

If you specify other script arguments or specify the arguments in a different order, you must change the CONFIG=$2 or set CONFIG=%2% lines accordingly.


ProcedureTo set the JBOSS_CLASSPATH Variable on Solaris and Linux Platforms:

  1. In the JBOSS_HOME/bin/run.sh script, find the following lines:

    if [ "x$JBOSS_CLASSPATH" = "x" ]; then
     JBOSS_CLASSPATH="$JBOSS_BOOT_CLASSPATH:$JAVAC_JAR"
     else
     JBOSS_CLASSPATH="$JBOSS_CLASSPATH:$JBOSS_BOOT_CLASSPATH:$JAVAC_JAR"
    fi 
  2. After the lines you found in Step 1, add the following new lines:

    CONFIG=$2
    if [ "x$1"="x" ] && [ "x$CONFIG" = "x" ]; then CONFIG=default; fi
    if [ -r "setAgentClasspath$CONFIG.sh" ]; then
             ./opt/jboss-4.0.2/bin/setAgentClasspath$CONFIG.sh 
    fi

    Note: The previous command is for JBoss server 4.0.2. If you are using a different version, specify the appropriate JBoss server directory.

  3. Save your changes.

ProcedureTo set the JBOSS_CLASSPATH Variable on Windows Platforms:

  1. In the JBOSS_HOME\bin\run.bat script, find the following lines:

    if "%JBOSS_CLASSPATH%" == "" (
               set JBOSS_CLASSPATH=%JAVAC_JAR%;%RUNJAR% 
    ) ELSE (
               set JBOSS_CLASSPATH=%JBOSS_CLASSPATH%;%JAVAC_JAR%;%RUNJAR% 
    )
  2. After the lines you found in Step 1, add the following new lines:

    set CONFIG=%2%
    if "x%CONFIG%" == "x" (
          set CONFIG=default 
    )
    if exist setAgentClasspath%CONFIG%.bat (
          call c:\jboss-4.0.2\bin\setAgentClasspath%CONFIG%.bat
    )
  3. Save your changes.