Starting app.bndrun with bindings having dependencies

Hello,

I’ve setup Eclipse using this guide:

In step 7, I am trying to use “org.openhab.binding.modbus” (instead of astro in the guide above).

But I cannot make it work, a dependency is missing and I cannot see the binding in paperui. Note that deploying the jar file from the target directory (after a mvn clean install) into a real installation works as expected, so that looks like an Eclipse issue.

What am I missing?

Thanks in advance!

  • Platform information:
    • Hardware: x86_64
    • OS: Ubuntu 18.04
    • Java Runtime Environment: OpenJDK 64-Bit Server VM (build 25.222-b10, mixed mode)
    • openHAB version: 2.5.0-SNAPSHOT

Hi @bubuche,

the issue is mentioned in the very beginning of your referenced documentation:

We are currently reworking how to setup a perfect development environment. A new step by step guide will appear here soon.

There is currently no easy AFAIK to get it run within Eclipse - but the following way should lead to success:

  • Start the openHAB2 separately with debug option (i.e. with start_debug.sh),
  • Launch Eclipse and attach it to the running OH2 with Debug Configuration -> Remote Java Application by specifying localhost and remote port 5005.
1 Like

*** Begin out of topic
The hint isn’t very helpful. Since months there are a lot of problems with the stupid new development environment ‘bnd’ and the dependencies.
Someone has decided to kill the previously very well working development environment and switch to a new, not sufficiently tested and for us for Eclipse developers useless environment.

It’s not just a problem that ‘bnd’ doesn’t seem to get further developed for Eclipse, there is also very little documentation or troubleshooting support for binding programming under openhab. In addition, even here in the forum there is either no experience or knowledge, respectly the specialists don’t find time to share their knowledge with us seeking help.

In my opinion we are unfortunately in the process of killing a really well established open source application. And all because the Eclipse development environment for openhab is not stable enough to run or the announced step by step guide is still not available.
*** End out of topic

I myself have been trying for many weeks to get my self-developed binding to work under the new environment and have similar problems as bubuche79.

Deploying the jar file from the target directory (after a mvn clean install) into a real installation works as expected. But as soon as I start the described steps within Eclipse and the bnd environment, I get incomprehensible hints about missing dependencies, which in my opinion are not related to my binding.

Nevertheless, if someone can help, I have added my current error message. I would be grateful for a concrete hint solution.

Resolution failed. Capabilities satisfying the following requirements could not be found:
[<>]
⇒ osgi.identity: (osgi.identity=org.openhab.binding.openwms)
[org.openhab.transform.jinja version=2.5.0.201908091753]
⇒ osgi.wiring.package: (&(osgi.wiring.package=com.hubspot.jinjava)(&(version>=2.5.0)(!(version>=3.0.0))))
[org.apache.aries.jpa.container version=2.7.0]
⇒ osgi.service: (objectClass=javax.persistence.spi.PersistenceProvider)
[org.openhab.binding.smartmeter version=2.5.0.201908091746]
⇒ osgi.wiring.package: (&(osgi.wiring.package=io.reactivex)(&(version>=2.2.0)(!(version>=3.0.0))))
[org.openhab.binding.harmonyhub version=2.5.0.201908091735]
⇒ osgi.wiring.package: (&(osgi.wiring.package=com.digitaldan.harmony)(&(version>=1.1.0)(!(version>=2.0.0))))
[org.openhab.core.test version=2.5.0.201908052318]
⇒ osgi.wiring.package: (&(osgi.wiring.package=org.junit))
[org.openhab.transform.bin2json version=2.5.0.201908091752]
⇒ osgi.wiring.package: (&(osgi.wiring.package=com.igormaznitsa.jbbp)(&(version>=1.4.0)(!(version>=2.0.0))))
[net.minidev.accessors-smart version=1.2.0]
⇒ osgi.wiring.package: (&(osgi.wiring.package=org.objectweb.asm)(&(version>=5.0.0)(!(version>=6.0.0))))
[org.openhab.core.io.transport.serial.javacomm version=2.5.0.201908052337]
⇒ osgi.wiring.package: (&(osgi.wiring.package=javax.comm))

Unfortunately I tend to agree with @rainer300. There is a long thread below that might be of interest -:

I had a LOT of problems (still do) - especially with the ZigBee binding where I had to change dependency versions. I found that I had to do the following to make the system resolve dependencies when I changed them in the pom -:

  • Changed to master and saw that demo.app was resolving the 1.1.6 libraries
  • Changed back to the branch with the 1.2.1 libraries, and demo.app is resolving 1.2.0 libraries - pom correctly shows 1.2.1
  • The IDE is correctly using the 1.2.1 source
  • When running the demo.app, it’s still using 1.2.0 (which at least is consistent with what it is resolving this time!).
  • Tried cleaning the workspace, updating maven in the IDE (which then requires an IDE restart before demo.app will resolve dependencies) but I can’t now get the demo.app to pick up the 1.2.1 libraries.
  • I’ve now found that I have to run mvn clean install in the zigbee binding folder, then restart the IDE, and only then will it resolve the 1.2.1 version of the dependencies! The IDE restart was required here - without the restart it continued to show 1.2.0 .

I would suggest to post your problem on the above linked thread. Unfortunately I can’t say it’s likely to get resolved quickly, but at least it’s the currently place where these issues are being consolidated.

Good luck.

Couldn’t agree more - we’re spending a lot of valuable time with it. :disappointed_relieved: Within this year it took me several fresh setups of Eclipse to come to a workaround as compromise with which it is possible to live.

I’m new to binding development, and the errors thrown by the system range from incomprehensible to unhelpful. I have yet to find an explanation of what the “resolve” step for the app.bndrun does, or how to fix the problems that show up with items I’ve never touched and wasn’t aware I was even trying to load.

It’s been quite frustrating, and has gone on for months. The “we’ll have a new guide soon!” message is getting old.

I admit, the guide that’s there seems to work if you start from a perfect, clean install. Once.

As I suggested above, please provide any technical feedback to the github issue I posted.

Hi, I really like openhab and I was developing a plugin in 2.4 for personal use (at least for now) and I am not able to make it work. I tried for weeks, but what it is even worse is that the new IDE setup does not work for very well stablished plugins. I cannot make it work for homekit or network (for which I have small personal changes). This has being going on for months and I agree that if this is not solved soon the project will die.
Please come up with a working IDE!!!
The goal of the project is OPENHAB itself, not a breakthrough development process. Don’t loose prespective. A perfect IDE should not be the goal (I hope).

I’ve been doing as suggested, and updating that github PR. The odd part is that my problems seem to transient, and are so often apparently caused by something that should be innocuous, like rebooting. And the messages generated don’t give me enough information to diagnose it, so I’m having to bother people to figure it out.

I’m now entirely stuck, and as far as I can tell, it’s all build system and dependency problems. The Github issue has gotten little traffic, and while there have been responses, none of them are addressing the inability to resolve dependencies.

Until I can do that, I can’t build at all. I’ve spent a couple of weeks now fighting with this thing, and am stumped.