cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

NoClassDefFoundError:JsonProcessingException

Odair.Rocha
New Poster

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)

4 REPLIES 4

Naoto.Yamamoto
AppDynamics Team

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


Thanks,
Naoto Yamamoto




Found something helpful? Click the Accept as Solution button to help others find answers faster.
Liked something? Click the Thumbs Up button.


@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.

 

 

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


Thanks,
Naoto Yamamoto




Found something helpful? Click the Accept as Solution button to help others find answers faster.
Liked something? Click the Thumbs Up button.

We also experience this bug. 

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

Join Us On December 10
Learn how Splunk and AppDynamics are redefining observability


Register Now!

Observe and Explore
Dive into our Community Blog for the Latest Insights and Updates!


Read the blog here