I am trying to configure the AppDynamics Java agent for Elasticsearch 7.9.3 (Docker) version. The agent is registered in the AppDynamics but the agent status is showing down.
In AppDynamics logs I can see the below error.
03 Oct 2021 14:47:24,169 WARN JavaAgent - Exception caught: java.lang.NoClassDefFoundError: com/singularity/ee/agent/appagent/services/transactionmonitor/common/activity/CustomActivityUtil
03 Oct 2021 14:47:24,171 WARN JavaAgent - Exception caught: java.lang.NoClassDefFoundError: com/singularity/ee/agent/appagent/services/agentdiagnostics/safety/ErrorClassKey
03 Oct 2021 14:47:24,665 WARN JavaAgent - Exception caught: java.lang.NoClassDefFoundError: com/singularity/ee/agent/appagent/services/transactionmonitor/e2elatency/E2ELatencyUtil
I am unable to find a solution for this, looking for any suggestions.
Try updating your java.policy / default.policy files with the following grants
grant {
permission java.io.FilePermission "/opt/appdynamics/java-agent/-", "read,write,execute,delete";
permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
permission java.util.PropertyPermission "appdynamics.enable.field.injection", "read";
permission java.util.PropertyPermission "appdynamics.agent.enablesop", "read";
permission java.lang.RuntimePermission "getClassLoader";
permission java.lang.management.ManagementPermission "monitor";
};
Edit to generalise advice based on comment from OP:
More generally, logged errors can be translated into further additional permission config, e.g. For:
WARN BCIFixer - Error matching class [org.apache.logging.log4j.core.appender.rolling.action.DeleteAction] [access denied ("java.lang.RuntimePermission" "accessDeclaredMembers")]
Add:
permission java.lang.RuntimePermission "accessDeclaredMembers";