Splunk AppDynamics

NoClassDefFoundError:JsonProcessingException

CommunityUser
Splunk Employee
Splunk Employee

Hi,

Hi, I have a Java application with log4j2, my log file is configured to save in JSON, so when I start my application to appdynamics, a runtime error occurs, so my application is not monitored.

My application starts but is not being monitored.

 

That's my log4j2.xml:

<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="WARN">
<Appenders>
<File name="log" fileName="./src/log/log.json">
<JsonLayout complete="true" compact="false" />
<JsonLayout compact="true" eventEol="true" />
<Policies>
<SizeBasedTriggeringPolicy size="20 MB" />
</Policies>
</File>
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n" />
</Console>
</Appenders>
<Loggers>
<Root level="info">
<AppenderRef ref="Console" level="info" />
<AppenderRef ref="log" level="error" />
</Root>
</Loggers>
</Configuration>

If I delete this section "<JsonLayout complete="true" compact="false" />
<JsonLayout compact="true" eventEol="true" />", the application works and is monitored.

Error Log:

2019-01-08 17:21:23,721 WARN JNDI lookup class is not available because this JRE does not support JNDI. JNDI string lookups will not be available, continuing configuration. java.lang.ClassCastException: Cannot cast org.apache.logging.log4j.core.lookup.JndiLookup to org.apache.logging.log4j.core.lookup.StrLookup

        at java.lang.Class.cast(Class.java:3369)

        at org.apache.logging.log4j.util.LoaderUtil.newCheckedInstanceOf(LoaderUtil.java:163)

        at org.apache.logging.log4j.core.util.Loader.newCheckedInstanceOf(Loader.java:311)...

2019-01-08 17:21:23,725 WARN JMX runtime input lookup class is not available because this JRE does not support JMX. JMX lookups will not be available, continuing configuration. java.lang.ClassCastException: Cannot cast org.apache.logging.log4j.core.lookup.JmxRuntimeInputArgumentsLookup to org.apache.logging.log4j.core.lookup.StrLookup

        at java.lang.Class.cast(Class.java:3369)...

java.lang.NoClassDefFoundError: com/fasterxml/jackson/core/JsonProcessingException

        at java.lang.Class.getDeclaredMethods0(Native Method)

Labels (1)

Naoto_Yamamoto
Path Finder

Hi Odair,

Thanks for posting the question on the Community.

We identified a similar issue on your agent version:4.5.x, so could you try below steps to use 4.4.x agent version instead?

  1. Please back up current agent directory
  2. Try 4.4.x agent version in new agent directory and restart JVM node process with new agent path.

If you cannot use 4.4.x agent version for some reason, please try to add below arguments in JVM option:

-Dappdynamics.agent.log4j2.disabled=true -Dlog4j.ignoreTCL=true

Let me know if this helped you.

Many thanks,

Naoto

CommunityUser
Splunk Employee
Splunk Employee

@Naoto.Yamamoto wrote:

Hi Odair,

Thanks for posting the question on the Community.

We identified a similar issue on your agent version:4.5.x, so could you try below steps to use 4.4.x agent version instead?

  1. Please back up current agent directory
  2. Try 4.4.x agent version in new agent directory and restart JVM node process with new agent path.

If you cannot use 4.4.x agent version for some reason, please try to add below arguments in JVM option:

-Dappdynamics.agent.log4j2.disabled=true -Dlog4j.ignoreTCL=true

Let me know if this helped you.

Many thanks,

Naoto



@Naoto.Yamamoto wrote:

Hi Odair,

Thanks for posting the question on the Community.

We identified a similar issue on your agent version:4.5.x, so could you try below steps to use 4.4.x agent version instead?

  1. Please back up current agent directory
  2. Try 4.4.x agent version in new agent directory and restart JVM node process with new agent path.

If you cannot use 4.4.x agent version for some reason, please try to add below arguments in JVM option:

-Dappdynamics.agent.log4j2.disabled=true -Dlog4j.ignoreTCL=true

Let me know if this helped you.

Many thanks,

Naoto



@Naoto.Yamamoto wrote:

Hi Odair,

Thanks for posting the question on the Community.

We identified a similar issue on your agent version:4.5.x, so could you try below steps to use 4.4.x agent version instead?

  1. Please back up current agent directory
  2. Try 4.4.x agent version in new agent directory and restart JVM node process with new agent path.

If you cannot use 4.4.x agent version for some reason, please try to add below arguments in JVM option:

-Dappdynamics.agent.log4j2.disabled=true -Dlog4j.ignoreTCL=true

Let me know if this helped you.

Many thanks,

Naoto





I can't change the agent version 😕

I tried to add the parameters but without success.

This is my application start command.

/usr/bin/java -javaagent:/opt/appdynamics/appdynamics-serveragent/javaagent.jar -Dappdynamics.agent.applionName=myApi -Dappdynamics.agent.tierName=myApi -Dappdynamics.agent.log4j2.disabled=true -Dlog4j.configurationFile=/opt/apl/myPaste/conf/log4j2.xml -Dapp.version=0.0.1-181 -Dlog4j.ignoreTCL=true -Dconfig.properties=/opt/apl/myPaste/conf/application.properties -jar /opt/apl/myPaste/bin/myApi.jar

 

The error remains the same.

 

0 Karma

Naoto_Yamamoto
Path Finder

Hi Odair,

It seems you are monitoring standalone Java application, so you can safely and easily test 4.4.x version. Download link for 4.4.3 version is here.

If you have restriction to use 4.5.x version, then I am sorry to say that this is unresolved bug for 4.5.x agent now. I will keep the progress information updated here in that case.

Let me know if this helped you.

Many thanks,

Naoto

CommunityUser
Splunk Employee
Splunk Employee

We also experience this bug. 

Version 4.4.3 doesn't fix this issue. When can we expect a solution for this bug?

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...

Step into “Hunt the Insider: An Splunk ES Premier Mystery” to catch a cybercriminal ...

After a whole week of being on call, you fell asleep on your keyboard, and you hit a sequence of buttons that ...

SplunkTrust Application Period is Officially OPEN!

It's that time, folks! The application/nomination period for the 2026-2027 SplunkTrust is officially open. If ...