# OH3.2 Eclipse IDE: Caused by: java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory

**URL:** <https://community.openhab.org/t/oh3-2-eclipse-ide-caused-by-java-lang-noclassdeffounderror-org-slf4j-loggerfactory/137827>\
**Category:** IDE & Build\
**Created:** [August 3, 2022, 12:32am UTC](https://community.openhab.org/t/oh3-2-eclipse-ide-caused-by-java-lang-noclassdeffounderror-org-slf4j-loggerfactory/137827 "2022-08-03T00:32:13Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![lsafelix75](https://community.openhab.org/user_avatar/community.openhab.org/lsafelix75/32/103500_2.png) [@lsafelix75](https://community.openhab.org/u/lsafelix75)\
**Post date:** [August 3, 2022, 12:32am UTC](https://community.openhab.org/t/oh3-2-eclipse-ide-caused-by-java-lang-noclassdeffounderror-org-slf4j-loggerfactory/137827/1 "2022-08-03T00:32:13Z")

</div>

Hi,

I migrated from OH3.1 to OH3.2 on Eclipse IDE. Maven resolution if fine but when I link the add-on via IDE (debug) or import to OH3.2 distro, Im getting the following error. It seems that my custom bundle is unable to load LoggerFactory class. Any idea on how to resolve this? I have included a pom.xml for your reference too. Thanks

```auto
08:23:22.788 [ERROR] [o.thecodecloud.internal.CloudService] - bundle org.openhab.io.thecodecloud:3.2.0.202208030015 (164)[org.openhab.io.thecodecloud.internal.CloudService(273)] : Error during instantiation of the implementation object

java.lang.reflect.InvocationTargetException: null

at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?]

at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:?]

at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:?]

at java.lang.reflect.Constructor.newInstance(Constructor.java:490) ~[?:?]

at org.apache.felix.scr.impl.inject.internal.ComponentConstructorImpl.newInstance(ComponentConstructorImpl.java:316) ~[org.apache.felix.scr-2.1.30.jar:?]

at org.apache.felix.scr.impl.manager.SingleComponentManager.createImplementationObject(SingleComponentManager.java:286) [org.apache.felix.scr-2.1.30.jar:?]

at org.apache.felix.scr.impl.manager.SingleComponentManager.createComponent(SingleComponentManager.java:115) [org.apache.felix.scr-2.1.30.jar:?]

at org.apache.felix.scr.impl.manager.SingleComponentManager.getService(SingleComponentManager.java:1000) [org.apache.felix.scr-2.1.30.jar:?]

at org.apache.felix.scr.impl.manager.SingleComponentManager.getServiceInternal(SingleComponentManager.java:973) [org.apache.felix.scr-2.1.30.jar:?]

at org.apache.felix.scr.impl.manager.SingleComponentManager.getService(SingleComponentManager.java:918) [org.apache.felix.scr-2.1.30.jar:?]

at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse$1.run(ServiceFactoryUse.java:216) [org.eclipse.osgi-3.16.300.jar:?]

at java.security.AccessController.doPrivileged(Native Method) ~[?:?]

at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse.factoryGetService(ServiceFactoryUse.java:213) [org.eclipse.osgi-3.16.300.jar:?]

at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse.getService(ServiceFactoryUse.java:114) [org.eclipse.osgi-3.16.300.jar:?]

at org.eclipse.osgi.internal.serviceregistry.ServiceConsumer$2.getService(ServiceConsumer.java:48) [org.eclipse.osgi-3.16.300.jar:?]

at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:547) [org.eclipse.osgi-3.16.300.jar:?]

at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.getService(ServiceRegistry.java:533) [org.eclipse.osgi-3.16.300.jar:?]

at org.eclipse.osgi.internal.framework.BundleContextImpl.getService(BundleContextImpl.java:656) [org.eclipse.osgi-3.16.300.jar:?]

at org.apache.felix.scr.impl.manager.SingleRefPair.getServiceObject(SingleRefPair.java:88) [org.apache.felix.scr-2.1.30.jar:?]

at org.apache.felix.scr.impl.inject.methods.BindMethod.getServiceObject(BindMethod.java:675) [org.apache.felix.scr-2.1.30.jar:?]

at org.apache.felix.scr.impl.manager.DependencyManager.getServiceObject(DependencyManager.java:2556) [org.apache.felix.scr-2.1.30.jar:?]

at org.apache.felix.scr.impl.manager.DependencyManager.doInvokeBindMethod(DependencyManager.java:2075) [org.apache.felix.scr-2.1.30.jar:?]

at org.apache.felix.scr.impl.manager.DependencyManager.invokeBindMethod(DependencyManager.java:2058) [org.apache.felix.scr-2.1.30.jar:?]

at org.apache.felix.scr.impl.manager.SingleComponentManager.invokeBindMethod(SingleComponentManager.java:443) [org.apache.felix.scr-2.1.30.jar:?]

at org.apache.felix.scr.impl.manager.DependencyManager$MultipleDynamicCustomizer.addedService(DependencyManager.java:333) [org.apache.felix.scr-2.1.30.jar:?]

at org.apache.felix.scr.impl.manager.DependencyManager$MultipleDynamicCustomizer.addedService(DependencyManager.java:301) [org.apache.felix.scr-2.1.30.jar:?]

at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.customizerAdded(ServiceTracker.java:1200) [org.apache.felix.scr-2.1.30.jar:?]

at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.customizerAdded(ServiceTracker.java:1121) [org.apache.felix.scr-2.1.30.jar:?]

at org.apache.felix.scr.impl.manager.ServiceTracker$AbstractTracked.trackAdding(ServiceTracker.java:928) [org.apache.felix.scr-2.1.30.jar:?]

at org.apache.felix.scr.impl.manager.ServiceTracker$AbstractTracked.track(ServiceTracker.java:864) [org.apache.felix.scr-2.1.30.jar:?]

at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:1152) [org.apache.felix.scr-2.1.30.jar:?]

at org.apache.felix.scr.impl.BundleComponentActivator$ListenerInfo.serviceChanged(BundleComponentActivator.java:114) [org.apache.felix.scr-2.1.30.jar:?]

at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:120) [org.eclipse.osgi-3.16.300.jar:?]

at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:957) [org.eclipse.osgi-3.16.300.jar:?]

at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:234) [org.eclipse.osgi-3.16.300.jar:?]

at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:151) [org.eclipse.osgi-3.16.300.jar:?]

at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:936) [org.eclipse.osgi-3.16.300.jar:?]

at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:873) [org.eclipse.osgi-3.16.300.jar:?]

at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:141) [org.eclipse.osgi-3.16.300.jar:?]

at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:261) [org.eclipse.osgi-3.16.300.jar:?]

at org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:496) [org.eclipse.osgi-3.16.300.jar:?]

at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.register(AbstractComponentManager.java:929) [org.apache.felix.scr-2.1.30.jar:?]

at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.register(AbstractComponentManager.java:915) [org.apache.felix.scr-2.1.30.jar:?]

at org.apache.felix.scr.impl.manager.RegistrationManager.changeRegistration(RegistrationManager.java:133) [org.apache.felix.scr-2.1.30.jar:?]

at org.apache.felix.scr.impl.manager.AbstractComponentManager.registerService(AbstractComponentManager.java:984) [org.apache.felix.scr-2.1.30.jar:?]

at org.apache.felix.scr.impl.manager.AbstractComponentManager.activateInternal(AbstractComponentManager.java:752) [org.apache.felix.scr-2.1.30.jar:?]

at org.apache.felix.scr.impl.manager.AbstractComponentManager.enableInternal(AbstractComponentManager.java:674) [org.apache.felix.scr-2.1.30.jar:?]

at org.apache.felix.scr.impl.manager.AbstractComponentManager.enable(AbstractComponentManager.java:437) [org.apache.felix.scr-2.1.30.jar:?]

at org.apache.felix.scr.impl.manager.ConfigurableComponentHolder.enableComponents(ConfigurableComponentHolder.java:667) [org.apache.felix.scr-2.1.30.jar:?]

at org.apache.felix.scr.impl.BundleComponentActivator.initialEnable(BundleComponentActivator.java:305) [org.apache.felix.scr-2.1.30.jar:?]

at org.apache.felix.scr.impl.Activator.loadComponents(Activator.java:554) [org.apache.felix.scr-2.1.30.jar:?]

at org.apache.felix.scr.impl.Activator.access$200(Activator.java:70) [org.apache.felix.scr-2.1.30.jar:?]

at org.apache.felix.scr.impl.Activator$ScrExtension.start(Activator.java:421) [org.apache.felix.scr-2.1.30.jar:?]

at org.apache.felix.scr.impl.AbstractExtender.createExtension(AbstractExtender.java:196) [org.apache.felix.scr-2.1.30.jar:?]

at org.apache.felix.scr.impl.AbstractExtender.modifiedBundle(AbstractExtender.java:169) [org.apache.felix.scr-2.1.30.jar:?]

at org.apache.felix.scr.impl.AbstractExtender.modifiedBundle(AbstractExtender.java:49) [org.apache.felix.scr-2.1.30.jar:?]

at org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:488) [org.eclipse.osgi-3.16.300.jar:?]

at org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:1) [org.eclipse.osgi-3.16.300.jar:?]

at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:232) [org.eclipse.osgi-3.16.300.jar:?]

at org.osgi.util.tracker.BundleTracker$Tracked.bundleChanged(BundleTracker.java:450) [org.eclipse.osgi-3.16.300.jar:?]

at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:945) [org.eclipse.osgi-3.16.300.jar:?]

at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:234) [org.eclipse.osgi-3.16.300.jar:?]

at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:151) [org.eclipse.osgi-3.16.300.jar:?]

at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEventPrivileged(EquinoxEventPublisher.java:232) [org.eclipse.osgi-3.16.300.jar:?]

at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:138) [org.eclipse.osgi-3.16.300.jar:?]

at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:130) [org.eclipse.osgi-3.16.300.jar:?]

at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor.publishModuleEvent(EquinoxContainerAdaptor.java:217) [org.eclipse.osgi-3.16.300.jar:?]

at org.eclipse.osgi.container.Module.publishEvent(Module.java:499) [org.eclipse.osgi-3.16.300.jar:?]

at org.eclipse.osgi.container.Module.start(Module.java:486) [org.eclipse.osgi-3.16.300.jar:?]

at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:445) [org.eclipse.osgi-3.16.300.jar:?]

at aQute.launcher.Launcher.start(Launcher.java:687) [biz.aQute.launcher-6.0.0.jar:?]

at aQute.launcher.Launcher.startBundles(Launcher.java:667) [biz.aQute.launcher-6.0.0.jar:?]

at aQute.launcher.Launcher.activate(Launcher.java:573) [biz.aQute.launcher-6.0.0.jar:?]

at aQute.launcher.Launcher.launch(Launcher.java:403) [biz.aQute.launcher-6.0.0.jar:?]

at aQute.launcher.Launcher.run(Launcher.java:185) [biz.aQute.launcher-6.0.0.jar:?]

at aQute.launcher.Launcher.main(Launcher.java:161) [biz.aQute.launcher-6.0.0.jar:?]

at aQute.launcher.pre.EmbeddedLauncher.executeWithRunPath(EmbeddedLauncher.java:170) [biz.aQute.launcher.pre.jar:?]

at aQute.launcher.pre.EmbeddedLauncher.findAndExecute(EmbeddedLauncher.java:135) [biz.aQute.launcher.pre.jar:?]

at aQute.launcher.pre.EmbeddedLauncher.main(EmbeddedLauncher.java:52) [biz.aQute.launcher.pre.jar:?]

Caused by: java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory

at org.openhab.io.thecodecloud.internal.CloudService.<init>(CloudService.java:74) ~[?:?]

... 79 more

08:23:22.796 [WARN] [e.model.rule.scoping.RulesClassCache] - bundle org.openhab.core.model.rule:3.2.0.202112191916 (144)[org.openhab.core.model.rule.scoping.RulesClassCache(175)] : Could not get service from ref {org.openhab.io.thecodecloud.internal.CloudService, org.openhab.core.events.EventSubscriber, org.openhab.core.model.script.engine.action.ActionService}={service.config.factory=false, service.id=407, service.bundleid=164, service.scope=bundle, service.config.category=io, service.pid=[org.openhab.thecodecloud, org.openhab.thecodecloud], service.config.label=TheCode Cloud, component.name=org.openhab.io.thecodecloud.internal.CloudService, service.config.description.uri=io:thecodecloud, component.id=273}

08:23:22.797 [WARN] [e.model.rule.scoping.RulesClassCache] - bundle org.openhab.core.model.rule:3.2.0.202112191916 (144)[org.openhab.core.model.rule.scoping.RulesClassCache(175)] : DependencyManager : invokeBindMethod : Service not available from service registry for ServiceReference {org.openhab.io.thecodecloud.internal.CloudService, org.openhab.core.events.EventSubscriber, org.openhab.core.model.script.engine.action.ActionService}={service.config.factory=false, service.id=407, service.bundleid=164, service.scope=bundle, service.config.category=io, service.pid=[org.openhab.thecodecloud, org.openhab.thecodecloud], service.config.label=TheCode Cloud, component.name=org.openhab.io.thecodecloud.internal.CloudService, service.config.description.uri=io:thecodecloud, component.id=273} for reference ActionService

08:23:22.799 [ERROR] [o.thecodecloud.internal.CloudService] - bundle org.openhab.io.thecodecloud:3.2.0.202208030015 (164)[org.openhab.io.thecodecloud.internal.CloudService(273)] : Error during instantiation of the implementation object

java.lang.reflect.InvocationTargetException: null

at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?]

at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:?]

at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:?]

at java.lang.reflect.Constructor.newInstance(Constructor.java:490) ~[?:?]

at org.apache.felix.scr.impl.inject.internal.ComponentConstructorImpl.newInstance(ComponentConstructorImpl.java:316) ~[org.apache.felix.scr-2.1.30.jar:?]

at org.apache.felix.scr.impl.manager.SingleComponentManager.createImplementationObject(SingleComponentManager.java:286) [org.apache.felix.scr-2.1.30.jar:?]

at org.apache.felix.scr.impl.manager.SingleComponentManager.createComponent(SingleComponentManager.java:115) [org.apache.felix.scr-2.1.30.jar:?]

at org.apache.felix.scr.impl.manager.SingleComponentManager.getService(SingleComponentManager.java:1000) [org.apache.felix.scr-2.1.30.jar:?]

at org.apache.felix.scr.impl.manager.SingleComponentManager.getServiceInternal(SingleComponentManager.java:973) [org.apache.felix.scr-2.1.30.jar:?]

```

POM.xml

> \<?xml version="1.0" encoding="UTF-8" standalone="no"?\>
> 
> 4.0.0
> 
> org.openhab.addons.bundles org.openhab.addons.reactor.bundles 3.2.0-SNAPSHOT 
> 
> org.openhab.io.mycloud
> 
> openHAB Add-ons :: Bundles :: IO :: My Cloud Connector
> 
> 9.4.20.v20190813 !android.\*, !com.android.\*, !sun.\* org.json json 20180813 compile org.apache.servicemix.bundles org.apache.servicemix.bundles.okhttp 3.8.1\_1 compile org.apache.servicemix.bundles org.apache.servicemix.bundles.okio 1.13.0\_1 compile 
> 
> ```
> <dependency>
> <groupId>org.openhab.osgiify</groupId>
> <artifactId>io.socket.socket.io-client</artifactId>
> <version>1.0.1</version>
> <scope>compile</scope>
> </dependency>
> <dependency>
> <groupId>org.openhab.osgiify</groupId>
> <artifactId>io.socket.engine.io-client</artifactId>
> <version>1.0.1</version>
> <scope>compile</scope>
> </dependency>
> 
> <dependency>
> <groupId>org.eclipse.jetty.websocket</groupId>
> <artifactId>websocket-api</artifactId>
> <version>${jetty-version}</version>
> <scope>compile</scope>
> </dependency>
> 
> <dependency>
> <groupId>org.eclipse.jetty.websocket</groupId>
> <artifactId>websocket-server</artifactId>
> <version>${jetty-version}</version>
> <scope>compile</scope>
> </dependency>
> <dependency>
> <groupId>org.eclipse.jetty.websocket</groupId>
> <artifactId>websocket-servlet</artifactId>
> <version>${jetty-version}</version>
> <scope>compile</scope>
> </dependency>
> 
> <dependency>
> <groupId>javax.websocket</groupId>
> <artifactId>javax.websocket-api</artifactId>
> <version>1.1</version>
> <scope>compile</scope>
> </dependency>
> 
> ```

---

<div class="post-metadata">

**Author:** ![Flole](https://community.openhab.org/letter_avatar_proxy/v4/letter/f/bcef8e/32.png) [@Flole](https://community.openhab.org/u/Flole)\
**Post date:** [July 17, 2024, 6:25pm UTC](https://community.openhab.org/t/oh3-2-eclipse-ide-caused-by-java-lang-noclassdeffounderror-org-slf4j-loggerfactory/137827/2 "2024-07-17T18:25:44Z")

</div>

@J-N-K I saw that you managed to fix a similar issue in another thread when providing a standalone jar file that can be put into the addons folder, could you share how you resolved this? I am hitting the same issue during the development of a new, high performance persistence service that could be a replacement for MapDB. Dropping it into the addon directory causes it to throw

```auto
Caused by: java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory

```

I am failing to understand why though, as I copied the mapdb directory and it should just work…

---

<div class="post-metadata">

**Author:** ![J-N-K](https://community.openhab.org/user_avatar/community.openhab.org/j-n-k/32/19276_2.png) [@J-N-K](https://community.openhab.org/u/J-N-K)\
**Post date:** [July 17, 2024, 6:31pm UTC](https://community.openhab.org/t/oh3-2-eclipse-ide-caused-by-java-lang-noclassdeffounderror-org-slf4j-loggerfactory/137827/3 "2024-07-17T18:31:51Z")

</div>

If you point me to that thread I might remember 🙂

---

<div class="post-metadata">

**Author:** ![Flole](https://community.openhab.org/letter_avatar_proxy/v4/letter/f/bcef8e/32.png) [@Flole](https://community.openhab.org/u/Flole)\
**Post date:** [July 17, 2024, 6:32pm UTC](https://community.openhab.org/t/oh3-2-eclipse-ide-caused-by-java-lang-noclassdeffounderror-org-slf4j-loggerfactory/137827/4 "2024-07-17T18:32:48Z")

</div>

Right here: [[SOLVED] Update to SNAPSHOT #1597 (and later) partially failed (AllPlay(=SOLVED), AmazonDashButton(=SOLVED), wrapper service(=SOLVED), Z-Wave(=SOLVED)) - #43 by J-N-K](https://community.openhab.org/t/solved-update-to-snapshot-1597-and-later-partially-failed-allplay-solved-amazondashbutton-solved-wrapper-service-solved-z-wave-solved/74930/43)

---

<div class="post-metadata">

**Author:** ![J-N-K](https://community.openhab.org/user_avatar/community.openhab.org/j-n-k/32/19276_2.png) [@J-N-K](https://community.openhab.org/u/J-N-K)\
**Post date:** [July 17, 2024, 6:46pm UTC](https://community.openhab.org/t/oh3-2-eclipse-ide-caused-by-java-lang-noclassdeffounderror-org-slf4j-loggerfactory/137827/5 "2024-07-17T18:46:10Z")

</div>

I can’t remember. But as a first step ypu could have a look at the generated `MANIFEST.MF`. Does it include `org.slf4j` in the `Import-Package` part?

---

<div class="post-metadata">

**Author:** ![Flole](https://community.openhab.org/letter_avatar_proxy/v4/letter/f/bcef8e/32.png) [@Flole](https://community.openhab.org/u/Flole)\
**Post date:** [July 17, 2024, 7:01pm UTC](https://community.openhab.org/t/oh3-2-eclipse-ide-caused-by-java-lang-noclassdeffounderror-org-slf4j-loggerfactory/137827/6 "2024-07-17T19:01:31Z")

</div>

There are 2 files:

```auto
./target/dependency/META-INF/MANIFEST.MF
./target/classes/META-INF/MANIFEST.MF

```

Neither one contains `org.slf4j`

---

<div class="post-metadata">

**Author:** ![J-N-K](https://community.openhab.org/user_avatar/community.openhab.org/j-n-k/32/19276_2.png) [@J-N-K](https://community.openhab.org/u/J-N-K)\
**Post date:** [July 17, 2024, 7:08pm UTC](https://community.openhab.org/t/oh3-2-eclipse-ide-caused-by-java-lang-noclassdeffounderror-org-slf4j-loggerfactory/137827/7 "2024-07-17T19:08:07Z")

</div>

That’s the problem. The question is: why.

You can use

```auto
<properties>
  <bnd.importpackage>org.slf4j.*</bnd.importpackage>
</properties>

```

as a temporary workaround. But something is wrong with the way the bundle is created.

---

<div class="post-metadata">

**Author:** ![Flole](https://community.openhab.org/letter_avatar_proxy/v4/letter/f/bcef8e/32.png) [@Flole](https://community.openhab.org/u/Flole)\
**Post date:** [July 17, 2024, 7:12pm UTC](https://community.openhab.org/t/oh3-2-eclipse-ide-caused-by-java-lang-noclassdeffounderror-org-slf4j-loggerfactory/137827/8 "2024-07-17T19:12:35Z")

</div>

That does not help (for whatever reason). It looks like this now:

```auto
  <properties>
    <bnd.importpackage>
      org.openhab.core.library.types,
      org.slf4j.*,
      !jdk.internal.misc
    </bnd.importpackage>
  </properties>

```

I can see that in `history/dependencies.xml` there is

```auto
<bundle>mvn:org.slf4j/slf4j-api/1.7.36</bundle>

```

I did a mvn clean and mvn install on the 4.2.0 branch and then copied the jar into my addons directory on the server which is running 4.2.0-1.

---

<div class="post-metadata">

**Author:** ![J-N-K](https://community.openhab.org/user_avatar/community.openhab.org/j-n-k/32/19276_2.png) [@J-N-K](https://community.openhab.org/u/J-N-K)\
**Post date:** [July 17, 2024, 7:18pm UTC](https://community.openhab.org/t/oh3-2-eclipse-ide-caused-by-java-lang-noclassdeffounderror-org-slf4j-loggerfactory/137827/9 "2024-07-17T19:18:59Z")

</div>

Can you show the code?

---

<div class="post-metadata">

**Author:** ![Flole](https://community.openhab.org/letter_avatar_proxy/v4/letter/f/bcef8e/32.png) [@Flole](https://community.openhab.org/u/Flole)\
**Post date:** [July 17, 2024, 7:30pm UTC](https://community.openhab.org/t/oh3-2-eclipse-ide-caused-by-java-lang-noclassdeffounderror-org-slf4j-loggerfactory/137827/10 "2024-07-17T19:30:14Z")

</div>

Sure, it is basically a copy of mapdb, just the backend was changed to chronicle: [GitHub - Flole998/openhab-addons at chronicle4.2](https://github.com/Flole998/openhab-addons/tree/chronicle4.2)

---

<div class="post-metadata">

**Author:** ![J-N-K](https://community.openhab.org/user_avatar/community.openhab.org/j-n-k/32/19276_2.png) [@J-N-K](https://community.openhab.org/u/J-N-K)\
**Post date:** [July 17, 2024, 9:05pm UTC](https://community.openhab.org/t/oh3-2-eclipse-ide-caused-by-java-lang-noclassdeffounderror-org-slf4j-loggerfactory/137827/11 "2024-07-17T21:05:57Z")

</div>

> [@Flole](#):
>
> ```auto
> <properties>
> <bnd.importpackage>org.openhab.core.library.types,!jdk.internal.misc</bnd.importpackage>
> </properties>
> 
> ```

- You can’t distribute that over more than one line because it is passed directly to BND.
- Why do you need to explictely import `org.openhab.core.library.types`?
- SLF4J is now imported automatically, but with a wrong version range: `[1.7,2)` instead of `[2.0,3)`. You might need to add an exclusion to the imported dependencies.
- Feature resolution fails because it tries to resolve `net.openhft.chronicle.algo`. Either add it to the excluded packages in `bnd.importpackage` (if it is not needed) or add a dependency that provides this package.

---

<div class="post-metadata">

**Author:** ![Flole](https://community.openhab.org/letter_avatar_proxy/v4/letter/f/bcef8e/32.png) [@Flole](https://community.openhab.org/u/Flole)\
**Post date:** [July 17, 2024, 9:10pm UTC](https://community.openhab.org/t/oh3-2-eclipse-ide-caused-by-java-lang-noclassdeffounderror-org-slf4j-loggerfactory/137827/12 "2024-07-17T21:10:09Z")

</div>

> [@J-N-K](#):
>
> You can’t distribute that over more than one line because it is passed directly to BND.

I saw this in other addons IIRC.

> [@J-N-K](#):
>
> - Why do you need to explictely import `org.openhab.core.library.types`?

Copied from mapdb.

> [@J-N-K](#):
>
> SLF4J is now imported automatically, but with a wrong version range: `[1.7,2)` instead of `[2.0,3)`. You might need to add an exclusion to the imported dependencies.

Ah, so “something” is depending on it, so it ends up there but with the wrong version? That seems to be chronicle-core I think (I thought it provides chronicle.algo, I will have to double-check that).

Thanks, lets see if that helps!

---

<div class="post-metadata">

**Author:** ![J-N-K](https://community.openhab.org/user_avatar/community.openhab.org/j-n-k/32/19276_2.png) [@J-N-K](https://community.openhab.org/u/J-N-K)\
**Post date:** [July 17, 2024, 9:27pm UTC](https://community.openhab.org/t/oh3-2-eclipse-ide-caused-by-java-lang-noclassdeffounderror-org-slf4j-loggerfactory/137827/13 "2024-07-17T21:27:36Z")

</div>

> [@Flole](#):
>
> > [@J-N-K](#):
> >
> > You can’t distribute that over more than one line because it is passed directly to BND.
> 
> I saw this in other addons IIRC.

It might work if you add proper BND line-endings. I would recommend to stay with one line.

> [@](#):
>
> > [@J-N-K](#):
> >
> > - Why do you need to explictely import `org.openhab.core.library.types`?
> 
> Copied from mapdb.

IIRC it is needed there because otherwise de-serialization of the values fails. Check if you really need that (leave it in for now, when the whole add-on works, try if it continues to do so when you remove that import).

> [@](#):
>
> > [@J-N-K](#):
> >
> > SLF4J is now imported automatically, but with a wrong version range: `[1.7,2)` instead of `[2.0,3)`. You might need to add an exclusion to the imported dependencies.
> 
> Ah, so “something” is depending on it, so it ends up there but with the wrong version? That seems to be chronicle-core I think (I thought it provides chronicle.algo, I will have to double-check that).

The 3rd party BOM from chronicle specifies SLF4J 1.7. Try to exclude it by adding

```auto
        <exclusions>
          <exclusion>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
          </exclusion>
        </exclusions>

```

to the dependencies. Regarding `chronicle.algo`: It could be an optional dependency (i.e. not needed in some situations). If that is the case, you can exclude it in `bnd.importpackage`. If it is needed, you’ll see a `ClassDefNotFoundException`.

---

<div class="post-metadata">

**Author:** ![Flole](https://community.openhab.org/letter_avatar_proxy/v4/letter/f/bcef8e/32.png) [@Flole](https://community.openhab.org/u/Flole)\
**Post date:** [July 18, 2024, 9:04am UTC](https://community.openhab.org/t/oh3-2-eclipse-ide-caused-by-java-lang-noclassdeffounderror-org-slf4j-loggerfactory/137827/14 "2024-07-18T09:04:29Z")

</div>

I have added more dependencies now, it builds fine but I am stuck at

```auto
Caused by: java.lang.ExceptionInInitializerError: Exception java.lang.IllegalAccessError: class net.openhft.chronicle.core.OS (in unnamed module @0x2b372d03) cannot access class sun.nio.ch.FileChannelImpl (in module java.base) because module java.base does not export sun.nio.ch to unnamed module @0x2b372d03 [in thread "Refresh Thread: Equinox Container: cb47b8a1-f9e2-471c-82d0-9de10a950caf"]
        at net.openhft.chronicle.core.OS.<clinit>(OS.java:75) ~[?:?]
        ... 88 more

```

now. I can see that other bindings make use of `sun.nio.ch`, but for some reason I need to either ignore it (then I see the error from above) or building fails.

---

<div class="post-metadata">

**Author:** ![J-N-K](https://community.openhab.org/user_avatar/community.openhab.org/j-n-k/32/19276_2.png) [@J-N-K](https://community.openhab.org/u/J-N-K)\
**Post date:** [July 18, 2024, 4:23pm UTC](https://community.openhab.org/t/oh3-2-eclipse-ide-caused-by-java-lang-noclassdeffounderror-org-slf4j-loggerfactory/137827/15 "2024-07-18T16:23:21Z")

</div>

I don’t know. I spend an hour now getting that to work but it’s very difficult because of the large number of dependencies which are (partly) not OSGi ready. What exactly is the benefit of chronicle over mapdb? To me it looks like a very large solution.

---

<div class="post-metadata">

**Author:** ![Flole](https://community.openhab.org/letter_avatar_proxy/v4/letter/f/bcef8e/32.png) [@Flole](https://community.openhab.org/u/Flole)\
**Post date:** [July 18, 2024, 11:24pm UTC](https://community.openhab.org/t/oh3-2-eclipse-ide-caused-by-java-lang-noclassdeffounderror-org-slf4j-loggerfactory/137827/16 "2024-07-18T23:24:44Z")

</div>

I think the version I pushed last night has the dependencies correctly resolved, except for the  
`sun.nio` one mentioned above.

The reason to look for MapDB alternatives is, that in my case openHAB spends 30% of it’s CPU time on MapDB stuff (mostly calling commit). Chronicle should have a significantly better performance, and I was expecting it to be lightweight (well, seems like that didn’t play out very well). I thought it would be easier than for example LMDB, which is also very very quick. I’ll try that one next, maybe it’s easier to include. It seems to have a lot less dependencies.

---

<div class="post-metadata">

**Author:** ![Flole](https://community.openhab.org/letter_avatar_proxy/v4/letter/f/bcef8e/32.png) [@Flole](https://community.openhab.org/u/Flole)\
**Post date:** [October 19, 2025, 6:04pm UTC](https://community.openhab.org/t/oh3-2-eclipse-ide-caused-by-java-lang-noclassdeffounderror-org-slf4j-loggerfactory/137827/17 "2025-10-19T18:04:53Z")

</div>

Now with AI its quite easy to achieve something like this: I just let AI go through it, add dependencies, try again. Not only can it edit files a lot faster than the fastest programmer but it also can spend hours in a “test-code-test”-cycle without getting frustrated. Long story short: I have a lmdb persistence service now and the performance gain I am seeing on my system is quite significant, and its not even fully optimized yet.
