# Bndtools Bundle Resolver

**URL:** <https://community.openems.io/t/bndtools-bundle-resolver/2468>\
**Category:** English Forum\
**Created:** [March 6, 2024, 4:12pm UTC](https://community.openems.io/t/bndtools-bundle-resolver/2468 "2024-03-06T16:12:30Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![SBartel](https://community.openems.io/letter_avatar_proxy/v4/letter/s/2acd7d/32.png) [@SBartel](https://community.openems.io/u/SBartel)\
**Post date:** [March 6, 2024, 4:12pm UTC](https://community.openems.io/t/bndtools-bundle-resolver/2468/1 "2024-03-06T16:12:31Z")

</div>

Hello Everybody

I am in the process of rebuilding my bndrun file from scratch an trying to understand the dependencies.

Does anybody know what the following lines mean exactly?  
They are from the auto resolver in Eclipse → EdgeApp.bndrun → Resolve

```auto
⇒ osgi.identity: (osgi.identity=io.openems.edge.bridge.modbus)
          ⇒ [io.openems.edge.bridge.modbus version=1.0.0.202402191136]
              ⇒ osgi.wiring.package: (&(osgi.wiring.package=io.openems.edge.common.channel)(version>=1.0.0)(!(version>=2.0.0)))

```

Please no recommendations along the lines _try using JavaSE-xx_. I do want to understand what’s happening and which modules are actually missing.

Some background:

`io.openems.edge.bridge.modbus`  
is in run-requirements.

`osgi.wiring.package`  
is neither in run-requirements nor in run-modules, as I don’t know which package it is part of.

`openems.edge.common`  
is in run-requirements

Thanks so much.  
Sebastian

---

<div class="post-metadata">

**Author:** ![c.lehne](https://community.openems.io/user_avatar/community.openems.io/c.lehne/32/2719_2.png) [@c.lehne](https://community.openems.io/u/c.lehne)\
**Post date:** [March 6, 2024, 4:58pm UTC](https://community.openems.io/t/bndtools-bundle-resolver/2468/2 "2024-03-06T16:58:26Z")

</div>

> [@SBartel](#):
>
> ```auto
> ⇒ osgi.identity: (osgi.identity=io.openems.edge.bridge.modbus)
> ⇒ [io.openems.edge.bridge.modbus version=1.0.0.202402191136]
> ⇒ osgi.wiring.package: (&(osgi.wiring.package=io.openems.edge.common.channel)(version>=1.0.0)(!(version>=2.0.0)))
> 
> ```

It is difficult to interpret sometimes. From what I see, you have a dependency problem with `io.openems.edge.bridge.modbus`. It looks like it can’t find `io.openems.edge.common.channel`. As there is no bundle `io.openems.edge.common.channel` you are missing the bundle `io.openems.edge.common` or the correct version number of the bundle or there is no package or an inconsistent package `io.openems.edge.common.channel` in it.

You can ignore the package `osgi.wiring.package`. I assume this is the package name of the package which dumps the error.

**Update:** Each bundle has a `generated` folder in it. You may look there, if you find the jar file (in your case `io.openems.edge.common/generated/io.openems.edge.common.jar`.  
If the file exists, please have a look into the jar file. You can simply unzip it. Within the folder structure of the unzipped file there should be a package `io.openems.edge.common.channel`. Hope this helps.

---

<div class="post-metadata">

**Author:** ![SBartel](https://community.openems.io/letter_avatar_proxy/v4/letter/s/2acd7d/32.png) [@SBartel](https://community.openems.io/u/SBartel)\
**Post date:** [March 7, 2024, 6:33am UTC](https://community.openems.io/t/bndtools-bundle-resolver/2468/3 "2024-03-07T06:33:15Z")

</div>

That helps a lot already.  
You are saying `bridge-modbus` is missing `common.channel` or the correct version of it.  
And `wiring.package` is not the problem, but just issuing the error.

I will check the jar files and versions as you said and report back.

---

<div class="post-metadata">

**Author:** ![SBartel](https://community.openems.io/letter_avatar_proxy/v4/letter/s/2acd7d/32.png) [@SBartel](https://community.openems.io/u/SBartel)\
**Post date:** [March 7, 2024, 7:41am UTC](https://community.openems.io/t/bndtools-bundle-resolver/2468/4 "2024-03-07T07:41:58Z")

</div>

`edge.common.channel` is contained in `io.openems.edge.common.jar`.  
version is 1.0.0. (according to manifest.mf).

This can also bee seen in Eclipse, although here, the version is indicated per package, not per bundle:

![grafik](https://community.openems.io/uploads/default/original/2X/5/5857eef43cb5afd46a72182779ae1cff369d3b2c.png)

Including `edge.common` in run-requirements makes no difference.  
So I removed all bundles depending on `edge.common`

Now the Resolver tells me this, which may be the root of the problem: **osgi.cmpn**

```auto
 [<<INITIAL>>]
      ⇒ osgi.identity: (osgi.identity=io.openems.edge.common)
    [osgi.cmpn version=7.0.0.201802012110]
      ⇒ osgi.unresolvable: (&(must.not.resolve=*)(!(must.not.resolve=*)))

```

---

<div class="post-metadata">

**Author:** ![c.lehne](https://community.openems.io/user_avatar/community.openems.io/c.lehne/32/2719_2.png) [@c.lehne](https://community.openems.io/u/c.lehne)\
**Post date:** [March 7, 2024, 10:01am UTC](https://community.openems.io/t/bndtools-bundle-resolver/2468/5 "2024-03-07T10:01:14Z")

</div>

Good to see that your sources are there. And now you should

1. check if the compliled jar package is there. It should look like that:  
 ![image](https://community.openems.io/uploads/default/original/2X/0/0f7cdfa88bfac9394e78d06fde3207e251589ab4.png)

Please delete the file within your file explorer. Rebuild the project and check if the file is rebuild and if the timestamp was updated.

1. check if the library is used by the modbus bridge  
 ![image](https://community.openems.io/uploads/default/original/2X/d/db51a02625896f05dfcf0bedff39cd06998d3f98.jpeg)

If everything is there (above arrow points to the library, second arrow points to the channel package) and you do not have compiler errors in Eclipse, then the problem is within your EdgeApp.bndrun. I would suggest using the one from the official repository.

Also I see, that you are using Java 11. You should switch to Java 17 and rebuild everything. Note that [Java 17](https://openems.github.io/openems.io/openems/latest/gettingstarted.html#_setup_eclipse_ide_for_openems_edge_and_backend) is the officially supporterd version.

---

<div class="post-metadata">

**Author:** ![SBartel](https://community.openems.io/letter_avatar_proxy/v4/letter/s/2acd7d/32.png) [@SBartel](https://community.openems.io/u/SBartel)\
**Post date:** [March 7, 2024, 10:30am UTC](https://community.openems.io/t/bndtools-bundle-resolver/2468/6 "2024-03-07T10:30:40Z")

</div>

Thanks for getting back to me.

I am beginning to understand. Especially what you are saying about the rebuilding of ‘generated’ helps a lot.

Also I have been switching between Java 11 and 17 but that probably has led to inconsistent bundle/compiler versions.

I will follow your steps and report back.

---

<div class="post-metadata">

**Author:** ![SBartel](https://community.openems.io/letter_avatar_proxy/v4/letter/s/2acd7d/32.png) [@SBartel](https://community.openems.io/u/SBartel)\
**Post date:** [March 7, 2024, 11:57am UTC](https://community.openems.io/t/bndtools-bundle-resolver/2468/7 "2024-03-07T11:57:56Z")

</div>

I rebuilt `edge.common.jar` and also `bridge.modbus.jar` successfully.  
But the usage as indicated by your red arrows was not shown.

Then I decided to clean the entire project and ended up with a bunch of red exclamation marks on all bundle icons. I thinks this is a build-path/dependency problem.

Now I cannot rebuild the project, the OSGI framework selection box is empty and the resolver is showing many more unresolved dependencies.

I hate bndtools and osgi very much now. Or maybe I’m hating eclipse - I don’t even know.

How can I even build a single bundle? is it F5/update?  
20 years of experience as a programmer (not java) and I cannot even find out how to rebuild a single bundle in eclipse. What a terrible IDE.

Thanks a lot nevertheless 🙂

---

<div class="post-metadata">

**Author:** ![ldywicki](https://community.openems.io/user_avatar/community.openems.io/ldywicki/32/460_2.png) [@ldywicki](https://community.openems.io/u/ldywicki)\
**Post date:** [March 7, 2024, 4:18pm UTC](https://community.openems.io/t/bndtools-bundle-resolver/2468/8 "2024-03-07T16:18:23Z")

</div>

> [@SBartel](#):
>
> I hate bndtools and osgi very much now. Or maybe I’m hating eclipse - I don’t even know.

This is well… a very common statement. I can leave you with some thoughts on it. First - an [approach which works without IDE tooling](https://www.youtube.com/watch?v=WBxCHxi1pM8&list=PLEGbpQEn6rvyikXIhZXmuztwgUz7V8Ufs&index=12) and [discussion about migrating away from Tycho](https://www.youtube.com/watch?v=92szjGgt0SY&list=PLEGbpQEn6rvyikXIhZXmuztwgUz7V8Ufs&index=13) (Eclipse PDE) within openHAB/Eclipse SmartHome projects. Fair - I took a part in both of these, so its a bit of self promotion (sorry!) but I understand your point very well. The worst thing might happen to developer is when tool doesn’t work and you are left in doubt how to fix it.

Bndtools is a lot better than Tycho but it still might face troubles under certain conditions. I don’t know them exactly but bndtools itself attempts to create its own workspace within Eclipse where it is able to compute everything and make sure that application will launch. Second recording I linked includes bndtools author and maintainer who understood issue OSGi brought to Eclipse SmartHome and openHAB as well.

Probably it does not solve your issue at all, but be sure that you are not alone with your feelings. 🙂

---

<div class="post-metadata">

**Author:** ![Sn0w3y](https://community.openems.io/user_avatar/community.openems.io/sn0w3y/32/636_2.png) [@Sn0w3y](https://community.openems.io/u/Sn0w3y)\
**Post date:** [March 7, 2024, 8:16pm UTC](https://community.openems.io/t/bndtools-bundle-resolver/2468/9 "2024-03-07T20:16:19Z")

</div>

What helped me sometimes is adding the .classpath file manually to the Path of every modue:

```auto
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
	<classpathentry kind="con" path="aQute.bnd.classpath.container"/>
	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17"/>
	<classpathentry kind="src" output="bin" path="src"/>
	<classpathentry kind="src" output="bin_test" path="test">
		<attributes>
			<attribute name="test" value="true"/>
		</attributes>
	</classpathentry>
	<classpathentry kind="output" path="bin"/>
</classpath>

```

This is not the best way but if worked for me sometimes…

Greetings

---

<div class="post-metadata">

**Author:** ![stefan.feilmeier](https://community.openems.io/user_avatar/community.openems.io/stefan.feilmeier/32/2585_2.png) [@stefan.feilmeier](https://community.openems.io/u/stefan.feilmeier)\
**Post date:** [March 11, 2024, 1:17pm UTC](https://community.openems.io/t/bndtools-bundle-resolver/2468/10 "2024-03-11T13:17:38Z")

</div>

Till now I have always been able to solve these kind of Eclipse IDE + bndtools problems with these steps:

> [@Build in Eclipse fails with many errors](https://community.openems.io/t/build-in-eclipse-fails-with-many-errors/263/2):
>
> Hi, yes… this can happen from time to time. Most likely Eclipse did not recognize latest file changes. Here are some tips to get rid of build errors in Eclipse: Select all bundles in “Bndtools Explorer” (Ctrl + A) and press F5 to refresh them. This helps, if Eclipse did not recognize no files in existing bundles. Open File → Import in the menu and select Bndtools → Existing Bnd Workspace to reimport all bundles This helps, if there were new bundles added in the meantime. Those are not …

If you add your own new bundle and are unsure about the Classpath files, etc., I recommend to run the `tools/prepare-commit.sh` script (e.g. in a Windows Subsystem for Linux environment).
