Why is bundle `OPS4J Pax Web - Servlet API 3.1 compatibility` installed, but not used?

I reinstall OpenHAB 5.0.1 by stopping it, then

# apt-get purge  openhab
# apt-get install openhab=5.0.1-1
# systemctl daemon-reload
# systemctl start openhab

After purge I make sure that /var/lib/openhab does not exist anymore.

And now in the openhab-cli console:

openhab> bundle:list -t 0  |grep Res
  1 │ Resolved │   1 │ 4.4.7                 │ Apache Karaf :: Features :: Extension, Hosts: 0
229 │ Resolved │  30 │ 8.0.30                │ OPS4J Pax Web - Servlet API 3.1 compatibility, Hosts: 54
openhab> bundle:start 229
Error executing command: Error executing command on bundles:
        Error starting bundle 229: Invalid operation on a fragment. osgi.identity; type="osgi.fragment"; version:Version="8.0.30"; osgi.identity="org.ops4j.pax.web.pax-web-compatibility-servlet31" [id=229]
openhab> bundle:list -t 0 -s |grep pse.xtend                                                                 
139 │ Active   │  80 │ 2.37.0.v20241119-0857 │ org.eclipse.xtend.lib
140 │ Active   │  80 │ 2.37.0.v20241119-0857 │ org.eclipse.xtend.lib.macro
openhab> bundle:stop 139 140
openhab> bundle:list -t 0  |grep Res                                                                            
  1 │ Resolved │   1 │ 4.4.7                 │ Apache Karaf :: Features :: Extension, Hosts: 0
139 │ Resolved │  80 │ 2.37.0.v20241119-0857 │ Xtend Runtime Library
140 │ Resolved │  80 │ 2.37.0.v20241119-0857 │ Xtend Macro Interfaces
229 │ Resolved │  30 │ 8.0.30                │ OPS4J Pax Web - Servlet API 3.1 compatibility, Hosts: 54
openhab> bundle:start 1
Error executing command: Error executing command on bundles:
        Error starting bundle 1: Invalid operation on a fragment. osgi.identity; type="osgi.fragment"; version:Version="4.4.7"; osgi.identity="org.apache.karaf.features.extension" [id=1]

Restarting OpenHAB does not change the above observation.

  • If the bundles OPS4J Pax Web - Servlet API 3.1 compatibility, Hosts: 54 and Apache Karaf :: Features :: Extension, Hosts: 0 are not used, why are they installed?
  • How can I see which bundles use eclipse.Xtend from the Karaf console?

Its a low level technical detail - bundle fragments under certain conditions are used to ship resources to host bundles. They can’t be activated, because their lifecycle is linked to host, hence resolved is highest they can get.

If you wish to see usages of given bundle there is indirect way - use package:imports|grep org.eclipse.xtend. This command should show who imports that package.

When I use package:imports, whatever I try, I see that Xtend is not used from anywhere. And indeed, in OpenHAB unfortunately /rules and JSR223 automation cannot be written in Xtend. So why are the Xtend bundles distributed?

openhab> bundle:list -s|grep -i xtend
139 │ Active │  80 │ 2.37.0.v20241119-0857 │ org.eclipse.xtend.lib 
140 │ Active │  80 │ 2.37.0.v20241119-0857 │ org.eclipse.xtend.lib.macro

How can I find out, if OPS4J Pax Web - Servlet API 3.1 compatibility, Hosts: 54 is used by OpenHAB?

openhab> bundle:list  -s -t 0|grep Res
  1 │ Resolved │   1 │ 4.4.7                 │ org.apache.karaf.features.extension
229 │ Resolved │  30 │ 8.0.30                │ org.ops4j.pax.web.pax-web-compatibility-servlet31
openhab> bundle:list   -t 0|grep Res
  1 │ Resolved │   1 │ 4.4.7                 │ Apache Karaf :: Features :: Extension, Hosts: 0
229 │ Resolved │  30 │ 8.0.30                │ OPS4J Pax Web - Servlet API 3.1 compatibility, Hosts: 54

In the source code of openhab-core I cannot find pax-web-co.

Rules DSL is Xtend/based on Xtend, so it’s very much “used”.

Is rules dsl installed by default?

Yes, it’s a part of core, and isn’t “installed” as such.

It can be that the Rules/DSL is xbase-based and xbase is very similar to xtend, but is not xtend.

The only place in the source code, which I can find, that uses org.eclipse.xtend is - openhab-core/bundles/org.openhab.core.model.thing/src/org/openhab/core/model/thing/internal/GenericThingProvider.xtend at main · openhab/openhab-core · GitHub - org.openhab.core.model.thing.internal.GenericThingProvider.QueueContent, which has @org.eclipse.xtend.lib.annotations.Data.

Why are the OSGi dependencies on xtend all with ;resolution=optional?

For org.eclipse.xtend.lib.macro I cannot find anything.

Annotations are per say optional and should not break linking at runtime.

If you seen this in generic thing provider then its a DSL related (things/items).

This is beyond my knowledge. I’ve just learned that it uses xtend. Remember that a lot of this code is generated (by the Maven build), so you might not find all the references just searching the search code. If you make a full build, and then search the source code, you will have the generated code as well.

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.