Capabilities satisfying the following requirements could not be found:

I tried https://github.com/markus7017/myfiles/blob/master/shelly/org.openhab.binding.shelly-3.1.0-SNAPSHOT.jar?raw=true with a 3.0.x instance and it indeed does not work.

If I build the shelly binding myself with -Dohc.version=3.0.1 it does work with a OH 3.0.1 instance. So looks like that JAR wasn’t build with that option.

1 Like

hmm, need to verify/double check
thanks for supporting this investigation

1 Like

@wborn I did a fresh IDE install and ran
“mvn clean install -Dohc.version=3.0.1”

same result

23:12:33.965 [WARN ] [org.apache.felix.fileinstall         ] - Error while starting bundle: file:/usr/share/openhab/addons/org.openhab.binding.shelly-3.1.0-SNAPSHOT.jar
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.shelly [274]
  Unresolved requirement: Import-Package: org.osgi.framework; version="[1.9.0,2.0.0)"

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

@wborn

  • I tried running “mvn clean install -Dohc.version=3.0.1” vs. “mvn -Dohc.version=3.0.1 clean install” vs. 'mvn clean install -D “ohc.version=3.0.1”`and copied target/…jar to an 3.1M3’s addons folder
  • I tried to replace ${ohc.version} in feature.xml with “3.0.1” - same result
  • If I set ohc.version to 3.0.1-SNAPSHOT in openhab-addons/pom.xml see that the Download of 3.0.1 files starts
Downloading from openhab-snapshot: https://openhab.jfrog.io/openhab/libs-snapshot/org/openhab/core/bom/org.openhab.core.bom.compile/3.0.1-SNAPSHOT/maven-metadata.xml

so speifying ohc.version on command line seems to work in general
3.0.1 means regular release/non-SNAPSHOT so that’s ok

  • I don’t see anymore a download of 3.0.1 files, but I would expect that there are no changes anymore

I’m wondering that pom.xml specifies <karaf.version>4.3.1</karaf.version>. How does that relate to ohc.version. If the new Karaf version is explicitly specified I would gues that this create the dependency to OSGi 7.

Do I need to change any file in addition to specifying -Dohc.version=3.0.1 for mvn?
What else can I check (any log output from build showing the ohc-version)?

From my understanding other developers should face the same problem when doing a fresh install of the IDE. I did nothing special related to my binding.

  • Install Eclipse, Distro+Binding projects
  • Create a new branch
  • copy updated code files to org.openhab.binding.shelly
  • run “mvn clean install -Dohc.version=3.0.1”

By the way: I use Eclipse on Mac

Wouldn’t it make sense to provide the option to setup the IDE with a specific release version, so not just “2.5.x, 3.0” as selectable streams, but “2.5.x, 3.0.1, 3.1-SNAPSHOT”. Usually there is no need for a binding developer to have the lastest floating core release, especially when architectural things change. It should be possible to create a build environment, which matches the user scenartios: 3.0.1 + a new build of a binding or 3.1-SNAPSNOT_Mx if you require latest core features for your binding (in this case it’s clear that there is a dependency on the specific core release).

That’s strange because it does work for me like that without making any additional changes. :thinking:

Changing the ohc.version property overrides the versions of OHC Core BOMs used. Those BOMs manage what org.osgi.framework is used. It only seems to be an issue for add-ons with org.osgi.framework imports. E.g. I could use a 3.1.0-SNAPSHOT Nest binding (which doesn’t use these imports) without any issues with OH 3.0.1.

Maybe just create a branch from 3.0.x if it doesn’t work for you?

If there is a 2.5.x stream, I think a 3.0.x stream would make sense too. But I don’t use these streams myself, I just switch between branches. :slight_smile:

I did some more investigation

  • using a different machine
  • delete & fresh install of the IDE
  • important shelly binding as existing maven project to the IDE
  • set git upstream to my repo
  • run mvn from the main branch with -Dohc.version=3.0.1
  • saw downloading files with /3.0.1
  • build was successful
  • copied the shelly jar to a 3.1M3 (RPi4 with Zulu 11)
    and it works!!

BUT
(same machine)

  • I switchd to the Shelly 3.1-5 branch
  • ran the same mvn command
  • again a bunch of files were downloaded (mustly checksdtyle and findbug) - why? I’m pretty sure they didn’t changed within 10minutes
  • copied to the RPi
  • and it DOESN’T work, same issue unable to resolve the component

THEN

  • I repeated procediure 1 to delete and re-install the IDE
  • run mvn with -Dohc.version=3.0.1
  • build successful, but jar doesn’t run

I’m pretty sure I could repeat it 10 times and it will fail.

It seems that the initial build process runs well, but afterwards something is downloaded/updated, which adds a dependincy to the new OSGi version.

@wborn Could you do me a favor and repeat the test on your machine, but

  • build on the main branch with 3.0.1, try jar
  • switch to shelly_snapshort3.1-5 branch
  • build again for 3.0.1 core and try again

Are there any cached files I could delete - what’s about the bundle pool?

PS: Thanks for supporting me

I found the problem:

  • after deleting ~/.m2/repository/org/openhab
  • and always building with -Dohc.version=3.0.1

I’m now able to run multiple builds on both machines

Strange, but @wborn thanks for your supporgt :+1:

2 Likes

That’s good news it finally works for you too this way! :slight_smile:
Looks like somehow some wrong content ended up in your local Maven repo.

hi ,
i end up in the same situation.
i set up the IDE according instructions and end up an the error message.
even without adding my binding i do get this error
What needs to be done to get this resolved to be able to start OH3 in debug modus?

try to build your binding with “mvn clean install -Dohc.version=3.0.2”

hmm,

deleted the complete dev and again setup up and now the resolve works.
maybe something changed in the meanwhile.

thx anways

@wborn Again I ran into the issue twice. It seems that once you ran a regular mvn clean install (without -Dohc.version=3.0.2) some files in the repository get overwritten and afterwards you run in the sam issue even when building for 3.0.2. Last time I just deleted the org/openhab folder in the .m2 reporitory and was able to fix the issue

This time I’m no longer able to build for 2.5 after doing the same. This error shows up

[ERROR] Failed to execute goal on project org.openhab.binding.carnet: Could not resolve dependencies for project org.openhab.addons.bundles:org.openhab.binding.carnet:jar:2.5.13-SNAPSHOT: The following artifacts could not be resolved: org.openhab.core.bom:org.openhab.core.bom.compile:pom:2.5.0, org.openhab.core.bom:org.openhab.core.bom.openhab-core:pom:2.5.0, org.openhab.core.bom:org.openhab.core.bom.test:pom:2.5.0: Failure to find org.openhab.core.bom:org.openhab.core.bom.compile:pom:2.5.0 in https://openhab.jfrog.io/openhab/libs-release was cached in the local repository, resolution will not be reattempted until the update interval of openhab-release has elapsed or updates are forced -> [Help 1]

I tried to run “mvn clean install -U”, but problem persists. Was anything in the 2.5 repo removed causing this problem?

The 2.5.x artifacts probably depend on Bintray repos which no longer exist now it has sunset.

@wborn Today I’m running into this error

[ERROR] Failed to execute goal org.apache.karaf.tooling:karaf-maven-plugin:4.2.7:verify (karaf-feature-verification) on project org.openhab.binding.carnet: Feature resolution failed for [openhab-binding-carnet/3.1.0.SNAPSHOT]
[ERROR] Message: Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=openhab-binding-carnet; type=karaf.feature; version=3.1.0.SNAPSHOT; filter:="(&(osgi.identity=openhab-binding-carnet)(type=karaf.feature)(version>=3.1.0.SNAPSHOT))" [caused by: Unable to resolve openhab-binding-carnet/3.1.0.SNAPSHOT: missing requirement [openhab-binding-carnet/3.1.0.SNAPSHOT] osgi.identity; osgi.identity=org.openhab.binding.carnet; type=osgi.bundle; version="[3.1.0.202105110617,3.1.0.202105110617]"; resolution:=mandatory [caused by: Unable to resolve org.openhab.binding.carnet/3.1.0.202105110617: missing requirement [org.openhab.binding.carnet/3.1.0.202105110617] osgi.wiring.package; filter:="(&(osgi.wiring.package=org.osgi.framework)(version>=1.9.0)(!(version>=2.0.0)))"]]
[ERROR] Repositories: {
[ERROR] 	file:/Users/markus/Dev/openhab-3/git/openhab-addons/bundles/org.openhab.binding.carnet/target/feature/feature.xml
[ERROR] 	mvn:org.apache.karaf.features/framework/4.2.7/xml/features
[ERROR] 	mvn:org.apache.karaf.features/standard/4.2.7/xml/features
[ERROR] 	mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/3.0.2/xml/features
[ERROR] 	mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-tp/3.0.2/xml/features
[ERROR] 	mvn:org.ops4j.pax.web/pax-web-features/7.2.11/xml/features
[ERROR] }

while running “mvn clean install -Dohc.version=3.0.2”. Nothing changed since yesterday evening except the binding code itself, just rebuild.

Was 3.0.2 removed from the build system?! In This case: How to build a binding, which runs on OH3.0.2 (stable release)?

I’m not aware of any changes to this so I’d think it should still work like that.

Problem solved after reinstalling the IDE,thx

@wborn fyi (and others)

once more I’m not able to build (yesterday evening it works fine, this morning again missing dependencies).

[ERROR] Failed to execute goal org.apache.karaf.tooling:karaf-maven-plugin:4.3.1:verify (karaf-feature-verification) on project org.openhab.binding.carnet: Feature resolution failed for [openhab-binding-carnet/3.1.0.SNAPSHOT]
[ERROR] Message: Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=openhab-binding-carnet; type=karaf.feature; version=3.1.0.SNAPSHOT; filter:="(&(osgi.identity=openhab-binding-carnet)(type=karaf.feature)(version>=3.1.0.SNAPSHOT))" [caused by: Unable to resolve openhab-binding-carnet/3.1.0.SNAPSHOT: missing requirement [openhab-binding-carnet/3.1.0.SNAPSHOT] osgi.identity; osgi.identity=org.openhab.binding.carnet; type=osgi.bundle; version="[3.1.0.202105130609,3.1.0.202105130609]"; resolution:=mandatory [caused by: Unable to resolve org.openhab.binding.carnet/3.1.0.202105130609: missing requirement [org.openhab.binding.carnet/3.1.0.202105130609] osgi.wiring.package; filter:="(&(osgi.wiring.package=javax.measure)(version>=2.1.0)(!(version>=3.0.0)))"]]
[ERROR] Repositories: {
[ERROR] 	file:/Users/markus/Dev/openhab-3/git/openhab-addons/bundles/org.openhab.binding.carnet/target/feature/feature.xml
[ERROR] 	mvn:org.apache.karaf.features/framework/4.3.1/xml/features

What I did

  • Clean project in Eclipse
  • Maven->Update Project in Eclipse
  • Resolve dependencies in Eclipse->Save
  • mvn clean install -Dohc.version=3.0.2
    = no success

This fixed my issue (maybe after the other steps)

  • Remove binding from dependencies->Resolve->Update
  • Add binding->Resolve->Save
1 Like

The above fixed an issue for me as the build was passing but openHAB was complaining about missing javax.measure when the jar was placed into the addons folder of openHAB 3.1m4

Unresolved requirement: Import-Package: javax.measure; version="[2.1.0,3.0.0)"

After doing the above the jar now works perfect. I don’t build for V2.5 anymore but I used to on this machine 8 months ago, so guessing I had some stuff left over that was causing issues.

1 Like

@wborn Today I get the following warnings when starting my binding in Eclipse

Mai 19, 2021 9:37:15 VORM. org.apache.cxf.bus.osgi.CXFExtensionBundleListener addExtensions
INFORMATION: Adding the extensions from bundle org.apache.cxf.cxf-rt-frontend-jaxrs (112) [org.apache.cxf.jaxrs.JAXRSBindingFactory]
Mai 19, 2021 9:37:15 VORM. org.apache.cxf.bus.osgi.CXFExtensionBundleListener addExtensions
INFORMATION: Adding the extensions from bundle org.apache.cxf.cxf-rt-rs-sse (114) [org.apache.cxf.transport.sse.SseProvidersExtension]
Mai 19, 2021 9:37:15 VORM. org.apache.cxf.bus.osgi.CXFExtensionBundleListener addExtensions
INFORMATION: Adding the extensions from bundle org.apache.cxf.cxf-rt-transports-http (116) [org.apache.cxf.transport.http.HTTPTransportFactory, org.apache.cxf.transport.http.HTTPWSDLExtensionLoader, org.apache.cxf.transport.http.policy.HTTPClientAssertionBuilder, org.apache.cxf.transport.http.policy.HTTPServerAssertionBuilder, org.apache.cxf.transport.http.policy.NoOpPolicyInterceptorProvider]
Mai 19, 2021 9:37:15 VORM. org.apache.cxf.bus.blueprint.NamespaceHandlerRegisterer register
INFORMATION: Aries Blueprint packages not available. So namespaces will not be registered
Mai 19, 2021 9:37:15 VORM. org.apache.cxf.bus.blueprint.NamespaceHandlerRegisterer register
INFORMATION: Aries Blueprint packages not available. So namespaces will not be registered
Mai 19, 2021 9:37:15 VORM. org.apache.cxf.bus.blueprint.NamespaceHandlerRegisterer register
INFORMATION: Aries Blueprint packages not available. So namespaces will not be registered
Mai 19, 2021 9:37:15 VORM. org.apache.cxf.bus.blueprint.NamespaceHandlerRegisterer register
INFORMATION: Aries Blueprint packages not available. So namespaces will not be registered
Mai 19, 2021 9:37:15 VORM. org.apache.aries.spifly.BaseActivator log
INFORMATION: Registered provider org.apache.aries.jax.rs.whiteboard.internal.client.ClientBuilderImpl of service javax.ws.rs.client.ClientBuilder in bundle org.apache.aries.jax.rs.whiteboard
Mai 19, 2021 9:37:15 VORM. org.apache.aries.spifly.BaseActivator log
INFORMATION: Registered provider org.apache.cxf.jaxrs.impl.RuntimeDelegateImpl of service javax.ws.rs.ext.RuntimeDelegate in bundle org.apache.aries.jax.rs.whiteboard
Mai 19, 2021 9:37:15 VORM. org.apache.aries.spifly.BaseActivator log
INFORMATION: Registered provider org.apache.cxf.jaxrs.sse.client.SseEventSourceBuilderImpl of service javax.ws.rs.sse.SseEventSource.Builder in bundle org.apache.aries.jax.rs.whiteboard
Mai 19, 2021 9:37:16 VORM. org.apache.aries.spifly.BaseActivator log
INFORMATION: Registered provider org.eclipse.jetty.http.Http1FieldPreEncoder of service org.eclipse.jetty.http.HttpFieldPreEncoder in bundle org.eclipse.jetty.http
Mai 19, 2021 9:37:16 VORM. org.apache.aries.spifly.BaseActivator log
INFORMATION: Registered provider org.eclipse.jetty.websocket.common.extensions.identity.IdentityExtension of service org.eclipse.jetty.websocket.api.extensions.Extension in bundle org.eclipse.jetty.websocket.common
Mai 19, 2021 9:37:16 VORM. org.apache.aries.spifly.BaseActivator log
INFORMATION: Registered provider org.eclipse.jetty.websocket.common.extensions.fragment.FragmentExtension of service org.eclipse.jetty.websocket.api.extensions.Extension in bundle org.eclipse.jetty.websocket.common
Mai 19, 2021 9:37:16 VORM. org.apache.aries.spifly.BaseActivator log
INFORMATION: Registered provider org.eclipse.jetty.websocket.common.extensions.compress.PerMessageDeflateExtension of service org.eclipse.jetty.websocket.api.extensions.Extension in bundle org.eclipse.jetty.websocket.common
Mai 19, 2021 9:37:16 VORM. org.apache.aries.spifly.BaseActivator log
INFORMATION: Registered provider org.eclipse.jetty.websocket.common.extensions.compress.DeflateFrameExtension of service org.eclipse.jetty.websocket.api.extensions.Extension in bundle org.eclipse.jetty.websocket.common
Mai 19, 2021 9:37:16 VORM. org.apache.aries.spifly.BaseActivator log
INFORMATION: Registered provider org.eclipse.jetty.websocket.common.extensions.compress.XWebkitDeflateFrameExtension of service org.eclipse.jetty.websocket.api.extensions.Extension in bundle org.eclipse.jetty.websocket.common

I did

  • Project cleam
  • updated dependencies in Eclipse
  • mvn clean install with -U

What does " Aries Blueprint packages not available" mean?

Looks like some harmless info logging. But it would be better to create new topics if it has nothing to do with your original topic. :wink: