Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cant start the agent - NoClassDefFoundError #22

Open
spleshakov opened this issue Aug 30, 2021 · 3 comments
Open

Cant start the agent - NoClassDefFoundError #22

spleshakov opened this issue Aug 30, 2021 · 3 comments

Comments

@spleshakov
Copy link

Using either version of the agent 2.2.3 or 2.2.1, I get the following error which running startAgent.sh

spleshakov-MacBook-Pro:ServerAgent-2.2.3 spleshakov$ java -version
java version "11.0.2" 2019-01-15 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.2+9-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.2+9-LTS, mixed mode)

spleshakov-MacBook-Pro:ServerAgent-2.2.3 spleshakov$ sh ./startAgent.sh 
ERROR: java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
*** Problem's technical details go below ***
Home directory was detected as: /Users/spleshakov/Downloads/ServerAgent-2.2.3
Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
	at org.apache.jorphan.logging.LoggingManager.getLoggerForClass(LoggingManager.java:122)
	at kg.apc.perfmon.AgentTool.<clinit>(AgentTool.java:17)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
	at java.base/java.lang.Class.newInstance(Class.java:584)
	at kg.apc.cmdtools.PluginsCMD.getToolInstance(PluginsCMD.java:113)
	at kg.apc.cmdtools.PluginsCMD.processParams(PluginsCMD.java:51)
	at kg.apc.cmdtools.PluginsCMD.processParams(PluginsCMD.java:23)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at kg.apc.cmd.UniversalRunner.main(UniversalRunner.java:174)
Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory
	at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:471)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
	... 15 more
@NathanVss
Copy link

I'm facing the same issue on my mac mini Big Sur :(

@Kavabungoz
Copy link

Same problem on Windows 10

@ilcors-dev
Copy link

ilcors-dev commented Mar 9, 2023

Not knowing if anyone is still interested in the matter, today I had the same problem. Here's how I fixed it.

The error message you are seeing indicates that the required class org.slf4j.LoggerFactory is not found in the classpath.

To resolve this issue, you need to add the required SLF4J JAR files to the classpath of the server agent.

Here are the steps you can follow:

  • Download the latest version of the SLF4J framework from the official website (http://www.slf4j.org/download.html).
  • Extract the downloaded archive and locate the slf4j-api-x.x.x.jar and slf4j-simple-x.x.x.jar files.
  • Copy the two JAR files to the lib folder of the PerfMon Metrics Collector plugin directory.
  • Restart the server agent.

After performing these steps, the server agent should be able to load the org.slf4j.LoggerFactory class and the PerfMon Metrics Collector plugin should be able to collect the required system-level metrics.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants