Unresolved requirement: Import-Package: org.openhab.core.config.discovery.upnp

I’ve started randomly getting the error below when compiling the androidtv binding. My system is running OH 4.1-SNAPSHOT 3600 currently. The binding seems to start about 5 seconds later when this happens and runs like normal. My feature.xml includes openhab-transport-upnp which I believe should automatically add org.openhab.core.config.discovery.upnp. Thoughts?

2023-08-26 18:35:24.770 [WARN ] [org.apache.felix.fileinstall        ] - Error while starting bundle: file:/openhab/addons/org.openhab.binding.androidtv-3.2.0-4.1.0-SNAPSHOT-b674ccf.jar
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.androidtv [243]
  Unresolved requirement: Import-Package: org.openhab.core.config.discovery.upnp

        at org.eclipse.osgi.container.Module.start(Module.java:463) ~[org.eclipse.osgi-3.18.0.jar:?]
        at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:445) ~[org.eclipse.osgi-3.18.0.jar:?]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1260) ~[?:?]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1233) ~[?:?]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:520) ~[?:?]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365) ~[?:?]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:316) ~[?:?]

It does not use your feature file if you only add a JAR file to the /addons dir. That only works with KAR files.

Gotcha. What do I need to do to resolve this? Im assuming marketplace builds will have the same issue coming in as jars.

If you want features to be installed based on the feature file you add the .kar file instead of the .jar file and also add the kar tag:

https://community.openhab.org/tags/c/marketplace/bundles/73/kar

That makes sense. How do I compile as a kar?

Thank you!!!

1 Like

Dumb question, I created the kar file but when I drop it into addons it doesn’t do anything. Do I need to restart OH or somehow install the kar differently?

I’ve been attempting to build the kar but I’ve been running into a ton of dependency issues. First it needed a bunch more of the fasterxml bits, now it’s complaining about jetty dependencies. I don’t have this with the jar. What am I missing here?

Do you also have this if you remove your compatibility hacks?

Yes. I pulled those out first when testing. First I end up adding about 8 more jackson fasterxml packages, then it asks for about a dozen jetty packages.