Download PDF
Download page Oracle WebLogic Startup Settings.
Oracle WebLogic Startup Settings
To enable the AppDynamics Java Agent add the javaagent
command-line option to the WebLogic startup file. If you start and stop clustered WebLogic servers using Node Manager, configure server startup in the WebLogic Server Administration Console.
Instrument Oracle WebLogic for Windows
- Open the
startWebLogic.cmd
file, located at<weblogic_version_install_dir>\user_projects\domains\<domain_name>\bin
. Add following
javaagent
argument to the application server start script.set JAVA_OPTIONS=%JAVA_OPTIONS% -javaagent:"<drive>:\<agent_home>\javaagent.jar"
CODEThe
javaagent
argument must reference the full path of the agent installation directory, including the drive letter.The command must precedes the WebLogic start commands, for example:
@REM Enable the AppDynamics Java Agent set JAVA_OPTIONS=%JAVA_OPTIONS% -javaagent:"E:\AppDynamics\AppServerAgent\javaagent.jar" @REM AppDynamics Java Agent END @REM START WEBLOGIC echo starting weblogic with Java version: %JAVA_HOME%\bin\java %JAVA_VM% -version
- Restart the application server for the changes to take effect.
Instrument Oracle WebLogic for an Application Running as a Windows Service
Some applications have a pre-compiled startup method that installs WebLogic as a Windows service.
To add the agent to the service:
- Open the script file that starts the application service, such as
install_XXXX_Server_Start_Win_Service.cmd
. Add the
javaagent
command before the line starting with "set CMDLINE=%JAVA_VM%..
." such as:set CLASSPATH=%MYSERVER_CLASSPATH%;%PRE_CLASSPATH%;%WEBLOGIC_CLASSPATH%;%POST_CLASSPATH%;%WLP_POST_CLASSPATH% set JAVA_VM=%JAVA_VM% %JAVA_DEBUG% %JAVA_PROFILE% set WLS_DISPLAY_MODE=Production @REM Enable the AppDynamics Java Agent set JAVA_OPTIONS=%JAVA_OPTIONS% -javaagent:"<drive>:\<agent_home>\javaagent.jar" @REM AppDynamics Agent END set CMDLINE=%JAVA_VM% %MEM_ARGS% -classpath %CLASSPATH% %JAVA_OPTIONS% weblogic.Server"
CODEOpen a command prompt and run the following script to remove the existing Windows Service for your application:
install_XXXXX_Server_Start_Win_Service.cmd XXXXX_xxxxx_Production_Server R
Install the updated Windows Service for your application:
install_XXXXX_Server_Start_Win_Service.cmd XXXXX_xxxx_Production_Server I
- From the WebLogic web console, stop your application.
- Start your application (which also starts WebLogic) from the Windows Services application, where the Windows service name = XXXXX_xxxx_Production_Server.
- Ensure that your application is working properly.
See Creating a Server-Specific Script in the Oracle documentation.
Instrument Oracle WebLogic for Linux
- Edit
startWebLogic.sh
located at<weblogic_<version#>_install_dir>/user_projects/domains/<domain_name>/bin/startWebLogic.sh
. Add the following to the beginning of your application server start script:
export JAVA_OPTIONS="$JAVA_OPTIONS -javaagent:/agent_home/javaagent.jar"
CODEThe
javaagent
argument must reference the full path of the agent installation directory.The
export
command precedes the WebLogic start commands, for example:#Enable the AppDynamics Java Agent export JAVA_OPTIONS="$JAVA_OPTIONS -javaagent:/opt/AppDynamics/AppServerAgent/javaagent.jar" # START WEBLOGIC echo "starting weblogic with Java version:" ${JAVA_HOME}/bin/java ${JAVA_VM} -version
- Restart the application server for the changes to take effect.
Instrument Clustered WebLogic Servers
For clustered WebLogic servers, you start and stop using Node Manager, and configure server startup in the WebLogic Server Administration Console.
- Open the WebLogic Server Administration Console. See Overview of the Administration Console.
- Navigate to Environment > Servers and click your server in the Server List.
- Click the Server Start tab.
Add the
javaagent
argument and set the value to the path to the Java Agent:-javaagent:/<agent_home>/javaagent.jar
Restart the application server.
Java 2 Security Configuration
If you have enabled Java 2 security on your WebLogic server, you must add this code block to the weblogic.policy
file:
grant codeBase "file:/<agent_home>/-" { permission java.security.AllPermission; };