eclipse-emfcloud / emfcloud-modelserver

Modelserver component
Other
40 stars 21 forks source link

SLF4 API not found when launching as Eclipse Application #275

Open reuteran opened 6 months ago

reuteran commented 6 months ago

I am trying to launch a model server in my eclipse application. I've included the model server bundles in my target platform and made sure they all resolve. It seems that the javalin jar in org.eclipse.emfcloud.modelserver.lib cannot find the slf4 APIs. There are no package imports for them in org.eclipse.emfcloud.modelserver.lib and from what I can tell they also aren't in any of the other jars in that bundle. In the example given you are using maven to resolve the APIs, but I am using PDE.

Caused by: java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
    at io.javalin.core.util.JavalinLogger.<clinit>(JavalinLogger.kt:9)
    at io.javalin.core.util.Util.logJavalinBanner(Util.kt:114)
    at io.javalin.Javalin.start(Javalin.java:161)
    at io.javalin.Javalin.start(Javalin.java:149)
    at org.eclipse.emfcloud.modelserver.emf.launch.ModelServerEntryPoint.boot(ModelServerEntryPoint.java:43)
    at org.eclipse.emfcloud.modelserver.emf.launch.DefaultModelServerStartup.start(DefaultModelServerStartup.java:32)
    at org.eclipse.emfcloud.modelserver.emf.launch.ModelServerLauncher.doRun(ModelServerLauncher.java:95)
    at org.eclipse.emfcloud.modelserver.emf.launch.ModelServerLauncher.run(ModelServerLauncher.java:63)
    at modelserver.Activator.start(Activator.java:15)
    at org.eclipse.osgi.internal.framework.BundleContextImpl$2.run(BundleContextImpl.java:813)
    at org.eclipse.osgi.internal.framework.BundleContextImpl$2.run(BundleContextImpl.java:1)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:569)
    at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:805)
    ... 246 more
Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory cannot be found by org.eclipse.emfcloud.modelserver.lib_0.7.0.202308161629
    at org.eclipse.osgi.internal.loader.BundleLoader.generateException(BundleLoader.java:529)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass0(BundleLoader.java:524)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:416)
    at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:168)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
    ... 259 more

Am I missing a step here? Shouldn't the APIs be imported by the lib bundle?