OracleDB APMIA extension fails to connect to Oracle when configured via the Java System Properties
search cancel

OracleDB APMIA extension fails to connect to Oracle when configured via the Java System Properties

book

Article ID: 372533

calendar_today

Updated On:

Products

DX APM SaaS

Issue/Introduction

The documented process to configure Infrastructure Agent extensions is to edit the bundle.properties file within the relevant sub-directory of apmia/extensions.  Placing configuration within the extension distribution .tar.gz file is logical as it keeps configuration close to the extension.

However as the distribution is not extracted until the Infrastructure agent has been run, the install procedure inconvenient and the upgrade process complex as edits to the bundle.properties file are easily overlooked.

The Java agent documents in the 'Command-line Property Overrides' section of Java Agent Properties (broadcom.com) that Java System Properties may be used to set any agent configuration property without the need to edit IntroscopeAgent.profile or bundle.properties within an extension.  This style of configuration also works for Infrastructure agents (though not explicitly documented).  For the Infrastructure agent, the Java System Properties are set via the apmia/conf/wrapper.conf file - see Connect to Enterprise Manager on IPV6 for Web Server Monitoring (broadcom.com) (again not explicitly documenting use of this for extension properties but does document that Java System Properties may be set this way, so the agent configuration code will see them, and the log shows they have been seen and relevant configuration properties have been set correctly at run time).  

However when this technique is used to configure the OracleDB extension, the connection to Oracle fails with many repeats of the following in agent log:
[DEBUG] [IntroscopeAgent.DBMonitor] Connecting to database...
[ERROR] [IntroscopeAgent.DBMonitor] 
java.lang.NullPointerException: Cannot invoke "java.lang.CharSequence.toString()" because "<parameter2>" is null
 at java.base/java.lang.String.replace(Unknown Source)
 at com.ca.agent.extensions.dbmon.DBMonMetricsContext.initializeConnection(DBMonMetricsContext.java:276)
 at com.ca.agent.extensions.dbmon.commands.traces.DBMonExecuteTraceQueryCommand.execute(DBMonExecuteTraceQueryCommand.java:78)
 at com.ca.agent.extensions.dbmon.DBMonChain.run(DBMonChain.java:73)
 at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
 at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
 at java.base/java.lang.Thread.run(Unknown Source)
[ERROR] [IntroscopeAgent.DBMonitor] 
java.lang.NullPointerException: Cannot invoke "java.lang.CharSequence.toString()" because "<parameter2>" is null
 at java.base/java.lang.String.replace(Unknown Source)
 at com.ca.agent.extensions.dbmon.DBMonMetricsContext.initializeConnection(DBMonMetricsContext.java:276)
 at com.ca.agent.extensions.dbmon.commands.DBMonExecuteAttributeQueryCommand.execute(DBMonExecuteAttributeQueryCommand.java:72)
 at com.ca.agent.extensions.dbmon.DBMonChain.run(DBMonChain.java:73)
 at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
 at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
 at java.base/java.lang.Thread.run(Unknown Source)

Resolution

Not all Agent settings can be configured as Java System Properties. Most that can are documented in the above link.

Additional Information

Try overriding an agent property for APMIA OracleDB agent extension via defining a system environment variable with "APMENV_" prefix followed by uppercasing the agent property name and replacing all "." in the agent property name with "_".

For instance, try defining the system environment variable "APMENV_INTROSCOPE_AGENT_DBMONITOR_ORACLEPROFILES_DB1_HOSTNAME" to override the agent property "introscope.agent.dbmonitor.oracle.profiles.db1.hostName".

This will not work if the system environment variables with "APMENV_" prefix don't have all "." in the agent property name replaced with "_".