APM Insight Java Agent - Oracle WebLogic - AdminServer not onboarded after adding agent arguments in Admin Console

APM Insight Java Agent - Oracle WebLogic - AdminServer not onboarded after adding agent arguments in Admin Console

Scope: Onboard the APM Insight Java agent on a WebLogic domain — AdminServer through setDomainEnv, and managed servers through the Admin console. Standard steps (download, apminsight.conf) are in the WebLogic installation guide.

Why two methods

ServerUsually started byReads agent argument from
AdminServerstartWebLogic (or its own Windows service)setDomainEnv / JAVA_OPTIONS — not the console
Managed serversNode Manager — Admin console Control → Start or WLST start()Console: Server Start → Arguments

The console cannot restart the AdminServer it runs on, and its Server Start arguments are not read by startWebLogic. So the AdminServer needs the argument in setDomainEnv.

Step 1 — AdminServer (setDomainEnv)

Open <DOMAIN_HOME>\bin\setDomainEnv.cmd (Linux: setDomainEnv.sh). Take a backup, then add the block below just before the line containing SET THE CLASSPATH:

@REM ===== APM Insight agent - AdminServer only =====
if "%SERVER_NAME%"=="AdminServer" set JAVA_OPTIONS=%JAVA_OPTIONS% -DUseSunHttpHandler=true -javaagent:<agent_dir>\apminsight-javaagent.jar -Dapminsight.application.name=AdminServer -Dapminsight.agent.server.port=<admin_port>
@REM =================================================

Linux

# ===== APM Insight agent - AdminServer only =====
if [ "$SERVER_NAME" = "AdminServer" ]; then
JAVA_OPTIONS="$JAVA_OPTIONS -DUseSunHttpHandler=true -javaagent:<agent_dir>/apminsight-javaagent.jar -Dapminsight.application.name=AdminServer -Dapminsight.agent.server.port=<admin_port>"
export JAVA_OPTIONS
fi
# =================================================
  • Keep it on one line — a bracketed if ( ... ) block can break if JAVA_OPTIONS contains brackets.
  • Replace AdminServer if your AdminServer has a different name (the value of -Dweblogic.Name).
  • The SERVER_NAME check is important — every server sources setDomainEnv, so without it the managed servers would also get the AdminServer's agent settings.

Restart the AdminServer: stop it (stopWebLogic.cmd or console Control → Shutdown), then start it with startWebLogic.cmd.

AdminServer runs as a Windows service? If the service was created with installSvc.cmd, it stores the full Java command line in the registry (HKLM\SYSTEM\CurrentControlSet\Services\<service>\Parameters → CmdLine) and does not read setDomainEnv.cmd again at start. After the change, either re-create the service (uninstallSvc.cmd → installSvc.cmd) or add the agent argument to CmdLine, then restart the service. Check with sc qc "<service_name>" — beasvc.exe / wlsvc.exe in the path means it is this type.

Step 2 — Managed servers (console)

  • Admin console → Environment → Servers → select the managed server → Configuration → Server Start.
  • In Arguments, add (one unique name and port per server):
-DUseSunHttpHandler=true -javaagent:<agent_dir>/apminsight-javaagent.jar -Dapminsight.application.name=<server_name> -Dapminsight.agent.server.port=<server_port>
  • Save (activate the changes if the console uses Lock & Edit).
  • Restart the server from the console (Control → Shutdown, then Start) — Node Manager must be running.
  • Console restart not possible? Use WLST — it also goes through Node Manager, so the console argument applies:
cd <ORACLE_HOME>\oracle_common\common\bin
wlst.cmd

connect('<admin_user>','<password>','http://<admin_host>:<admin_port>')
shutdown('<server_name>', force='true')
start('<server_name>')
exit()
Do not restart managed servers with startManagedWebLogic.cmd when the argument is only in the console — the script does not read console arguments, and the server comes up without the agent.

Step 3 — Verify

  • Each server's process command line has -javaagent:
# Windows (PowerShell)
Get-CimInstance Win32_Process -Filter "name='java.exe'" | Select-Object CommandLine

# Linux
ps -ef | grep weblogic.Name
  • In the agent directory, a folder <server_name>_<port> is created per server, and APM_Java_Instances has one entry per server.
  • In Applications Manager, check the last 24 hours.

If it still fails, collect

  • Agent folder as ZIP
  • Process command line of each server
  • The edited setDomainEnv and a Server Start screenshot of each managed server
  • How each server was restarted (console / WLST / script / Windows service)
  • WebLogic server logs

References