Forum Discussion
I also found this exception in .metadata/.log which looks related:
!ENTRY org.eclipse.cdt.core 4 0 2025-03-21 17:55:48.923
!MESSAGE Error: org/slf4j/LoggerFactory
!STACK 0
java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
at org.eclipse.jetty.util.log.Log.getLogger(Log.java:31)
at org.eclipse.jetty.util.ajax.JSON.<clinit>(JSON.java:90)
at de.marw.cmake.cdt.language.settings.providers.CompileCommandsJsonParser.tryParseJson(CompileCommandsJsonParser.java:258)
at de.marw.cmake.cdt.language.settings.providers.CompileCommandsJsonParser.shutdown(CompileCommandsJsonParser.java:612)
at org.eclipse.cdt.internal.core.ConsoleOutputSniffer.closeConsoleOutputStream(ConsoleOutputSniffer.java:162)
at org.eclipse.cdt.internal.core.ConsoleOutputSniffer$ConsoleOutputStream.close(ConsoleOutputSniffer.java:70)
at org.eclipse.cdt.internal.core.ProcessClosure$ReaderThread.close(ProcessClosure.java:101)
at org.eclipse.cdt.internal.core.ProcessClosure.isAlive(ProcessClosure.java:194)
at org.eclipse.cdt.core.CommandLauncher.waitAndRead(CommandLauncher.java:248)
at org.eclipse.cdt.core.CommandLauncherManager$CommandLauncherWrapper.waitAndRead(CommandLauncherManager.java:161)
at org.eclipse.cdt.internal.core.BuildRunnerHelper.build(BuildRunnerHelper.java:284)
at org.eclipse.cdt.managedbuilder.core.ExternalBuildRunner.invokeExternalBuild(ExternalBuildRunner.java:140)
at org.eclipse.cdt.managedbuilder.core.ExternalBuildRunner.invokeBuild(ExternalBuildRunner.java:73)
at de.marw.cdt.cmake.core.internal.CMakeBuildRunner.invokeBuild(CMakeBuildRunner.java:129)
at org.eclipse.cdt.managedbuilder.internal.core.CommonBuilder.build(CommonBuilder.java:783)
at org.eclipse.cdt.managedbuilder.internal.core.CommonBuilder.build(CommonBuilder.java:533)
at org.eclipse.cdt.managedbuilder.internal.core.CommonBuilder.build(CommonBuilder.java:471)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:1077)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:47)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:296)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:352)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:441)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:47)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:444)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:555)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:503)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:585)
at org.eclipse.core.internal.resources.Workspace.buildInternal(Workspace.java:594)
at org.eclipse.core.internal.resources.Workspace.build(Workspace.java:490)
at org.eclipse.ui.actions.BuildAction$1.runInWorkspace(BuildAction.java:288)
at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:43)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory cannot be found by de.marw.cmake.cdt_1.2.1.202501301848
at org.eclipse.osgi.internal.loader.BundleLoader.generateException(BundleLoader.java:562)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass0(BundleLoader.java:557)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:434)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:174)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
... 32 more
I think I have tracked down the problem. The de.marw.cmake.cdt_1.2.1.202501301848.jar plugin from RiscFree v25.1.1 has an embedded version of jetty-util-10.0.15.jar. It uses this embedded library when loading org.eclipse.jetty.util.log.Log. However, org.eclipse.jetty.util.log.Log has a dependency on org.slf4j.LoggerFactory which it can't access because de.marw.cmake.cdt_1.2.1.202501301848.jar does not import org.slf4. The OSGi instructions in the embedded jetty-util-10.0.15.jar are ignored.
The de.marw.cmake.cdt_1.2.1.202311041909.jar from RiscFree v23.4.1 just OSGi imports org.eclipse.jetty.util.log (i.e. it does not embed the jetty-util jar) which means it uses the jetty-util-10.0.15.jar that is shipped as an OSGi plugin. The jetty-util-10.0.15.jar plugin itself OSGi imports org.slf4j so it all works.
There are a couple of fixes for this:
- Make de.marw.cmake.cdt_1.2.1.202501301848.jar import the jetty-util dependency through OSGi rather than embedding the JAR file (and stop embedding the jar file). This seems like the most logical thing to do as RiscFree v25.1.1 still ships org.eclipse.jetty.util_10.0.21.jar as an OSGi plugin (which should be compatible).
- Make de.marw.cmake.cdt_1.2.1.202501301848.jar import all the dependencies that are needed by the embedded jetty-util jar. This really only makes sense if its necessary to embed the jetty-util jar in the plugin.
I have tested that 1 works by taking the de.marw.cmake.cdt_1.2.1.202311041909.jar from RiscFree v23.4.1 and installing it over the version in RiscFree v25.1.1. This fixes the problem.