<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Java Agent fails: NoClassDefFoundError org.apache.logging.log4j.message.ReusableMessageFactory in Splunk AppDynamics</title>
    <link>https://community.splunk.com/t5/Splunk-AppDynamics/Java-Agent-fails-NoClassDefFoundError-org-apache-logging-log4j/m-p/726050#M5043</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;In K8S, on a pod running a Spring Boot 3.x application (with OpenJDK 17) auto-instrumented by cluster-agent, the Java Agent fails on startup:&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#808080"&gt;[AD Agent init] Wed Sep 27 22:27:38 PDT 2023[INFO]: JavaAgent - Java Agent Directory [/opt/appdynamics-java/ver22.9.0.34210]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#808080"&gt;[AD Agent init] Wed Sep 27 22:27:38 PDT 2023[INFO]: JavaAgent - Java Agent AppAgent directory [/opt/appdynamics-java/ver22.9.0.34210]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#808080"&gt;Agent logging directory set to [/opt/appdynamics-java/ver22.9.0.34210/logs]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#808080"&gt;[AD Agent init] Wed Sep 27 22:27:38 PDT 2023[INFO]: JavaAgent - Agent logging directory set to [/opt/appdynamics-java/ver22.9.0.34210/logs]&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#808080"&gt;Could not start Java Agent, disabling the agent with exception java.lang.NoClassDefFoundError: Could not initialize class org.apache.logging.log4j.message.ReusableMessageFactory, Please check log files&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;In the pod, the jar file (log4j-api) containing the ReusableMessageFactory is there (part of the appdynamics java-agent):&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;sh-4.4$ pwd&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;/opt/appdynamics-java/ver22.9.0.34210/lib/tp&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;sh-4.4$ ls log4j*&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;log4j-api-2.17.1.1.9.cached.packages.txt log4j-core-2.17.1.1.9.cached.packages.txt log4j-jcl-2.17.1.cached.packages.txt&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&lt;STRONG&gt;log4j-api-2.17.1.1.9.jar&lt;/STRONG&gt; log4j-core-2.17.1.1.9.jar log4j-jcl-2.17.1.jar&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;log4j-api-2.17.1.1.9.jar.asc log4j-core-2.17.1.1.9.jar.asc log4j-jcl-2.17.1.jar.asc&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;From the POD manifest:&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#999999"&gt;- name: JAVA_TOOL_OPTIONS&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#999999"&gt;value: ' -Dappdynamics.agent.accountAccessKey=$(APPDYNAMICS_AGENT_ACCOUNT_ACCESS_KEY)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#999999"&gt;-Dappdynamics.agent.reuse.nodeName=true -Dappdynamics.socket.collection.bci.enable=true&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#999999"&gt;-Dappdynamics.agent.startup.log.level=debug -Dappdynamics.agent.reuse.nodeName.prefix=eric-tmo-des-ms-entitlements&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#999999"&gt;-javaagent:/opt/appdynamics-java/javaagent.jar'&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;I tried with the latest java-agent (23.9) but same result. I don't seem to have the problem with SpringBoot 2.7 (which does include log4j-api as opposed to 3.x).&amp;nbsp;It seems the classloader can't find the class from the java-agent distribution.)&amp;nbsp;&lt;/P&gt;&lt;P&gt;Has anyone encountered this ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
    <pubDate>Fri, 29 Sep 2023 06:34:38 GMT</pubDate>
    <dc:creator>Frederic_Hansli</dc:creator>
    <dc:date>2023-09-29T06:34:38Z</dc:date>
    <item>
      <title>Java Agent fails: NoClassDefFoundError org.apache.logging.log4j.message.ReusableMessageFactory</title>
      <link>https://community.splunk.com/t5/Splunk-AppDynamics/Java-Agent-fails-NoClassDefFoundError-org-apache-logging-log4j/m-p/726050#M5043</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;In K8S, on a pod running a Spring Boot 3.x application (with OpenJDK 17) auto-instrumented by cluster-agent, the Java Agent fails on startup:&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#808080"&gt;[AD Agent init] Wed Sep 27 22:27:38 PDT 2023[INFO]: JavaAgent - Java Agent Directory [/opt/appdynamics-java/ver22.9.0.34210]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#808080"&gt;[AD Agent init] Wed Sep 27 22:27:38 PDT 2023[INFO]: JavaAgent - Java Agent AppAgent directory [/opt/appdynamics-java/ver22.9.0.34210]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#808080"&gt;Agent logging directory set to [/opt/appdynamics-java/ver22.9.0.34210/logs]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#808080"&gt;[AD Agent init] Wed Sep 27 22:27:38 PDT 2023[INFO]: JavaAgent - Agent logging directory set to [/opt/appdynamics-java/ver22.9.0.34210/logs]&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#808080"&gt;Could not start Java Agent, disabling the agent with exception java.lang.NoClassDefFoundError: Could not initialize class org.apache.logging.log4j.message.ReusableMessageFactory, Please check log files&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;In the pod, the jar file (log4j-api) containing the ReusableMessageFactory is there (part of the appdynamics java-agent):&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;sh-4.4$ pwd&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;/opt/appdynamics-java/ver22.9.0.34210/lib/tp&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;sh-4.4$ ls log4j*&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;log4j-api-2.17.1.1.9.cached.packages.txt log4j-core-2.17.1.1.9.cached.packages.txt log4j-jcl-2.17.1.cached.packages.txt&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&lt;STRONG&gt;log4j-api-2.17.1.1.9.jar&lt;/STRONG&gt; log4j-core-2.17.1.1.9.jar log4j-jcl-2.17.1.jar&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;log4j-api-2.17.1.1.9.jar.asc log4j-core-2.17.1.1.9.jar.asc log4j-jcl-2.17.1.jar.asc&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;From the POD manifest:&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#999999"&gt;- name: JAVA_TOOL_OPTIONS&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#999999"&gt;value: ' -Dappdynamics.agent.accountAccessKey=$(APPDYNAMICS_AGENT_ACCOUNT_ACCESS_KEY)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#999999"&gt;-Dappdynamics.agent.reuse.nodeName=true -Dappdynamics.socket.collection.bci.enable=true&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#999999"&gt;-Dappdynamics.agent.startup.log.level=debug -Dappdynamics.agent.reuse.nodeName.prefix=eric-tmo-des-ms-entitlements&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#999999"&gt;-javaagent:/opt/appdynamics-java/javaagent.jar'&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;I tried with the latest java-agent (23.9) but same result. I don't seem to have the problem with SpringBoot 2.7 (which does include log4j-api as opposed to 3.x).&amp;nbsp;It seems the classloader can't find the class from the java-agent distribution.)&amp;nbsp;&lt;/P&gt;&lt;P&gt;Has anyone encountered this ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Sep 2023 06:34:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-AppDynamics/Java-Agent-fails-NoClassDefFoundError-org-apache-logging-log4j/m-p/726050#M5043</guid>
      <dc:creator>Frederic_Hansli</dc:creator>
      <dc:date>2023-09-29T06:34:38Z</dc:date>
    </item>
    <item>
      <title>Re: Java Agent fails: NoClassDefFoundError org.apache.logging.log4j.message.ReusableMessageFactory</title>
      <link>https://community.splunk.com/t5/Splunk-AppDynamics/Java-Agent-fails-NoClassDefFoundError-org-apache-logging-log4j/m-p/726051#M5044</link>
      <description>&lt;P&gt;For reasons I don't understand, the problem is fixed when I increase the JVM option --XXMaxJavaStackTraceDepth above 10. Any value below 10 causes the NoClassDefFoundError error.&lt;/P&gt;&lt;P&gt;If anyone has an explaination, much appreciated (does it have anything to do with &lt;A href="https://docs.appdynamics.com/appd/23.x/23.9/en/application-monitoring/administer-app-server-agents/app-agent-node-properties-reference/app-agent-node-properties-m#:~:text=maximum-activity-trace-stack,Structures)%20are%20set%20to%2010." target="_self" rel="nofollow noopener noreferrer"&gt;maximum-activity-trace-stack default value of 10&lt;/A&gt;&amp;nbsp;?&lt;/P&gt;</description>
      <pubDate>Sat, 30 Sep 2023 21:46:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-AppDynamics/Java-Agent-fails-NoClassDefFoundError-org-apache-logging-log4j/m-p/726051#M5044</guid>
      <dc:creator>Frederic_Hansli</dc:creator>
      <dc:date>2023-09-30T21:46:31Z</dc:date>
    </item>
  </channel>
</rss>

