Unable to use smack in OSGi environment

openHAB (a smart home platform) uses the Smack library in several bindings. After upgrading to version 4.4.0 or later, we ran into issues loading the library in Karaf.

  1. smack-core depends on sun.security.pkcs11. This is a Sun‑specific package that is not supported by all JREs, which limits the range of compatible runtimes. It is generally best practice not to use sun.* packages directly. In addition, OSGi environments like Karaf do not export these packages, which prevents Smack from being used there. Typically, Bouncy Castle is used as an alternative for PKCS#11 functionality.
  2. smack-core depends on hsluv 0.2, whose manifest is missing OSGi headers. We have already opened an issue in their repository (hsluv/hsluv#93) but also wanted to make you aware. If possible, it might make sense to drop or replace this dependency.

Thanks for your post. I’ll have a look into the situation.

And thanks for trying to bump Smack in OpenHAB from a fellow OpenHAB user. :slight_smile: