Core Bundle installation doesn't work

My basic intention was to add something to “openHAB Core :: Bundles :: REST Interface :: Core”. I did compile this on the 4.0 main branch, then deployed it and it worked fine a few times…

However, I noticed I should extract/refactor some of my code to “openHAB Core :: Bundles :: Core” and from deploying this core bundles on nothing worked anymore as expected. I wasn’t able to start that bundle (it got stuck in waiting) and finally I gave up, so I reverted to the one (rest) bundle only just to move on for the time being but I never got it working again as in the beginning.

(note I always made sure that I stop the original bundles before and used the addons folder to deploy the new bundles).

So to get to the situation of the beginning I did the following:

  • I cleaned the cache, restarted openHAB
  • I updated from Version: 4.0.0-SNAPSHOT (#3262) to Version: 4.0.0-SNAPSHOT (#3263)
  • I even did a “apt reinstall openhab”

I made sure all bundles are rolled back to the original version and the system would work well.

openhab> bundle:list | grep "openHAB Core :: Bundles :: Core"
149 │ Active │  80 │ 4.0.0.202212302150     │ openHAB Core :: Bundles :: Core
openhab> bundle:list | grep "openHAB Core :: Bundles :: REST Interface :: Core"
178 │ Active │  80 │ 4.0.0.202212302158     │ openHAB Core :: Bundles :: REST Interface :: Core
openhab> bundle:stop 178

I then stopped the one bundle I intended to replace

bundle:stop 178
openhab> bundle:list | grep "openHAB Core :: Bundles :: REST Interface :: Core"
178 │ Resolved │  80 │ 4.0.0.202212302158     │ openHAB Core :: Bundles :: REST Interface :: Core

Then I copied the newly compiled bundle-jar to the addon-folder but it complains about unresolved dependencies and then I did a “diag”

178 │ Resolved  │  80 │ 4.0.0.202212302158     │ openHAB Core :: Bundles :: REST Interface :: Core
318 │ Installed │  80 │ 4.0.0.202301012156     │ openHAB Core :: Bundles :: REST Interface :: Core


openhab> diag
openHAB Core :: Bundles :: REST Interface :: Core (318)
-------------------------------------------------------
Status: Installed
Unsatisfied Requirements:
osgi.wiring.package; filter:="(&(osgi.wiring.package=org.openhab.core.addon)(&(version>=3.4.0)(!(version>=4.0.0))))"
osgi.wiring.package; filter:="(&(osgi.wiring.package=org.openhab.core.binding)(&(version>=3.4.0)(!(version>=4.0.0))))"
osgi.wiring.package; filter:="(&(osgi.wiring.package=org.openhab.core.binding.dto)(&(version>=3.4.0)(!(version>=4.0.0))))"
osgi.wiring.package; filter:="(&(osgi.wiring.package=org.openhab.core.common)(&(version>=3.4.0)(!(version>=4.0.0))))"
osgi.wiring.package; filter:="(&(osgi.wiring.package=org.openhab.core.common.registry)(&(version>=3.4.0)(!(version>=4.0.0))))"
osgi.wiring.package; filter:="(&(osgi.wiring.package=org.openhab.core.events)(&(version>=3.4.0)(!(version>=4.0.0))))"
osgi.wiring.package; filter:="(&(osgi.wiring.package=org.openhab.core.i18n)(&(version>=3.4.0)(!(version>=4.0.0))))"
osgi.wiring.package; filter:="(&(osgi.wiring.package=org.openhab.core.items)(&(version>=3.4.0)(!(version>=4.0.0))))"
osgi.wiring.package; filter:="(&(osgi.wiring.package=org.openhab.core.items.dto)(&(version>=3.4.0)(!(version>=4.0.0))))"
osgi.wiring.package; filter:="(&(osgi.wiring.package=org.openhab.core.items.events)(&(version>=3.4.0)(!(version>=4.0.0))))"
osgi.wiring.package; filter:="(&(osgi.wiring.package=org.openhab.core.library.items)(&(version>=3.4.0)(!(version>=4.0.0))))"
osgi.wiring.package; filter:="(&(osgi.wiring.package=org.openhab.core.library.types)(&(version>=3.4.0)(!(version>=4.0.0))))"
osgi.wiring.package; filter:="(&(osgi.wiring.package=org.openhab.core.types)(&(version>=3.4.0)(!(version>=4.0.0))))"
osgi.service; filter:="(osgi.jaxrs.media.type=application/json)"; effective:="active"; resolution:="optional"
Declarative Services

For the record here are all core bundles of which some are mentioned above and it shows that all are beyond 4.0.0

149 │ Active    │  80 │ 4.0.0.202212302150     │ openHAB Core :: Bundles :: Core
150 │ Active    │  80 │ 4.0.0.202212302201     │ openHAB Core :: Bundles :: Marketplace Add-on Services
151 │ Active    │  80 │ 4.0.0.202212302201     │ openHAB Core :: Bundles :: Community Marketplace Add-on Service :: Karaf
152 │ Active    │  80 │ 4.0.0.202212302154     │ openHAB Core :: Bundles :: Audio
153 │ Active    │  80 │ 4.0.0.202212302153     │ openHAB Core :: Bundles :: JAAS Authentication
154 │ Active    │  80 │ 4.0.0.202212302154     │ openHAB Core :: Bundles :: OAuth2Client
155 │ Active    │  80 │ 4.0.0.202212302156     │ openHAB Core :: Bundles :: Automation
156 │ Active    │  80 │ 4.0.0.202212302200     │ openHAB Core :: Bundles :: Automation Media Modules
157 │ Active    │  80 │ 4.0.0.202212302159     │ openHAB Core :: Bundles :: Automation Script Modules
158 │ Active    │  80 │ 4.0.0.202212302200     │ openHAB Core :: Bundles :: Automation Script RuleSupport
159 │ Active    │  80 │ 4.0.0.202212302159     │ openHAB Core :: Bundles :: Automation REST API
160 │ Active    │  80 │ 4.0.0.202212302156     │ openHAB Core :: Bundles :: Binding XML
161 │ Active    │  80 │ 4.0.0.202212302153     │ openHAB Core :: Bundles :: Configuration Core
162 │ Active    │  80 │ 4.0.0.202212302156     │ openHAB Core :: Bundles :: Configuration Discovery
163 │ Active    │  80 │ 4.0.0.202212302159     │ openHAB Core :: Bundles :: Configuration mDNS Discovery
164 │ Active    │  80 │ 4.0.0.202212302155     │ openHAB Core :: Bundles :: Configuration Dispatcher
165 │ Active    │  75 │ 4.0.0.202212302154     │ openHAB Core :: Bundles :: Configuration XML
166 │ Active    │  80 │ 4.0.0.202212302154     │ openHAB Core :: Bundles :: Ephemeris
167 │ Active    │  80 │ 4.0.0.202212302154     │ openHAB Core :: Bundles :: ID
168 │ Active    │  80 │ 4.0.0.202212302152     │ openHAB Core :: Bundles :: Console
169 │ Active    │  80 │ 4.0.0.202212302153     │ openHAB Core :: Bundles :: Console for OSGi runtime Karaf
170 │ Active    │  80 │ 4.0.0.202212302150     │ openHAB Core :: Bundles :: HTTP Interface
171 │ Active    │  80 │ 4.0.0.202212302153     │ openHAB Core :: Bundles :: HTTP Interface Authentication
173 │ Active    │  80 │ 4.0.0.202212302158     │ openHAB Core :: Bundles :: Monitor
174 │ Active    │  80 │ 4.0.0.202212302152     │ openHAB Core :: Bundles :: Network I/O
175 │ Active    │  80 │ 4.0.0.202212302152     │ openHAB Core :: Bundles :: REST Interface
176 │ Active    │  80 │ 4.0.0.202212302156     │ openHAB Core :: Bundles :: Audio REST Interface
177 │ Active    │  80 │ 4.0.0.202212302155     │ openHAB Core :: Bundles :: Authentication Support for the REST Interface
178 │ Resolved  │  80 │ 4.0.0.202212302158     │ openHAB Core :: Bundles :: REST Interface :: Core
179 │ Active    │  80 │ 4.0.0.202212302159     │ openHAB Core :: Bundles :: REST mDNS Announcer
180 │ Active    │  80 │ 4.0.0.202212302201     │ openHAB Core :: Bundles :: Sitemap REST Interface
181 │ Active    │  80 │ 4.0.0.202212302156     │ openHAB Core :: Bundles :: SSE Interface
182 │ Active    │  80 │ 4.0.0.202212302154     │ openHAB Core :: Bundles :: REST Interface :: Swagger 1
183 │ Active    │  80 │ 4.0.0.202212302157     │ openHAB Core :: Bundles :: Transformation REST Interface
184 │ Active    │  80 │ 4.0.0.202212302201     │ openHAB Core :: Bundles :: UI REST Interface
185 │ Active    │  80 │ 4.0.0.202212302157     │ openHAB Core :: Bundles :: Voice REST Interface
186 │ Active    │  80 │ 4.0.0.202212302158     │ openHAB Core :: Bundles :: mDNS Service
187 │ Active    │  80 │ 4.0.0.202212302153     │ openHAB Core :: Bundles :: WebSocket
188 │ Active    │  80 │ 4.0.0.202212302154     │ openHAB Core :: Bundles :: Karaf Integration
189 │ Active    │  80 │ 4.0.0.202212302155     │ openHAB Core :: Bundles :: Model Core
190 │ Active    │  80 │ 4.0.0.202212302157     │ openHAB Core :: Bundles :: Model Items
191 │ Active    │  80 │ 4.0.0.202212302159     │ openHAB Core :: Bundles :: Model Item IDE
192 │ Active    │  80 │ 4.0.0.202212302159     │ openHAB Core :: Bundles :: Model Items Runtime
193 │ Active    │  80 │ 4.0.0.202212302203     │ openHAB Core :: Bundles :: Language Server
194 │ Active    │  80 │ 4.0.0.202212302157     │ openHAB Core :: Bundles :: Model Persistence
195 │ Active    │  80 │ 4.0.0.202212302159     │ openHAB Core :: Bundles :: Model Persistence IDE
196 │ Active    │  80 │ 4.0.0.202212302159     │ openHAB Core :: Bundles :: Model Persistence Runtime
197 │ Active    │  80 │ 4.0.0.202212302202     │ openHAB Core :: Bundles :: Model Rules
198 │ Active    │  80 │ 4.0.0.202212302203     │ openHAB Core :: Bundles :: Model Rule IDE
199 │ Active    │  80 │ 4.0.0.202212302203     │ openHAB Core :: Bundles :: Model Rules Runtime
200 │ Active    │  80 │ 4.0.0.202212302201     │ openHAB Core :: Bundles :: Model Script
201 │ Active    │  80 │ 4.0.0.202212302202     │ openHAB Core :: Bundles :: Model Script IDE
202 │ Active    │  80 │ 4.0.0.202212302202     │ openHAB Core :: Bundles :: Model Script Runtime
203 │ Active    │  80 │ 4.0.0.202212302157     │ openHAB Core :: Bundles :: Model Sitemap
204 │ Active    │  80 │ 4.0.0.202212302200     │ openHAB Core :: Bundles :: Model Sitemap IDE
205 │ Active    │  80 │ 4.0.0.202212302200     │ openHAB Core :: Bundles :: Model Sitemap Runtime
206 │ Active    │  80 │ 4.0.0.202212302200     │ openHAB Core :: Bundles :: Model Thing
207 │ Active    │  80 │ 4.0.0.202212302200     │ openHAB Core :: Bundles :: Model Thing IDE
208 │ Active    │  80 │ 4.0.0.202212302200     │ openHAB Core :: Bundles :: Model Thing Runtime
209 │ Active    │  80 │ 4.0.0.202212302155     │ openHAB Core :: Bundles :: Persistence
210 │ Active    │  80 │ 4.0.0.202212302153     │ openHAB Core :: Bundles :: Semantics
211 │ Active    │  80 │ 4.0.0.202212302156     │ openHAB Core :: Bundles :: JSON Storage
212 │ Active    │  80 │ 4.0.0.202212302154     │ openHAB Core :: Bundles :: Thing
213 │ Active    │  75 │ 4.0.0.202212302156     │ openHAB Core :: Bundles :: Thing XML
214 │ Active    │  80 │ 4.0.0.202212302155     │ openHAB Core :: Bundles :: Transformation Service
215 │ Active    │  80 │ 4.0.0.202212302200     │ openHAB Core :: Bundles :: UI
216 │ Active    │  80 │ 4.0.0.202212302201     │ openHAB Core :: Bundles :: UI Icon Support
217 │ Active    │  80 │ 4.0.0.202212302156     │ openHAB Core :: Bundles :: Voice
297 │ Active    │  80 │ 4.0.0.202212302158     │ openHAB Core :: Bundles :: Configuration UPnP Discovery
298 │ Active    │  80 │ 4.0.0.202212302158     │ openHAB Core :: Bundles :: Configuration USB-Serial Discovery
299 │ Active    │  80 │ 4.0.0.202212302200     │ openHAB Core :: Bundles :: Configuration USB-Serial Discovery for Linux using sysfs scanning
300 │ Active    │  80 │ 4.0.0.202212302200     │ openHAB Core :: Bundles :: Configuration USB-Serial Discovery using ser2net mDNS scanning
301 │ Active    │  80 │ 4.0.0.202212302200     │ openHAB Core :: Bundles :: Configuration Serial
302 │ Active    │  80 │ 4.0.0.202212302155     │ openHAB Core :: Bundles :: MQTT Transport
303 │ Active    │  80 │ 4.0.0.202212302153     │ openHAB Core :: Bundles :: Serial Transport
304 │ Active    │  80 │ 4.0.0.202212302154     │ openHAB Core :: Bundles :: Serial Transport for RXTX
305 │ Active    │  80 │ 4.0.0.202212302156     │ openHAB Core :: Bundles :: Serial Transport for RFC2217
306 │ Active    │  80 │ 4.0.0.202212302153     │ openHAB Core :: Bundles :: UPnP Transport
318 │ Installed │  80 │ 4.0.0.202301012156     │ openHAB Core :: Bundles :: REST Interface :: Core

(uninstalling 318 and restarting 178 works fine)

I am out of ideas:

  1. How can I deploy this single bundle org.openhab.core.io.rest.core so it doesn’t complain, respectively why is it complaining at all at the moment?

  2. … as a later and second topic: If I want to change something in org.openhab.core and in org.openhab.core.io.rest.core, what is the recommended approach during development to deploy these?

Thanks in advance for the support, :pray:
Stefan

Update: I just did the same thing on my 3.4.1 installation and it worked right out of the box. :confused:

(&(version>=3.4.0)(!(version>=4.0.0)))

A version between 3.4.0 and less than 4.0.0 is requested by your bundle. This is not satisfied on openHAB 4. Did you create the branch from 3.4 and then adjust only the version in your bundle’s POM?

Oh, it means 3.4 between 4.0 (I did not understand the !) … arghh.

No, I am on “main”.

Did you do a full build? Is the code available on GitHub?

Yes, Jan, I did a full build. No it isn’t yet on github because I did’'t dare to expose it before I knew it would at least work or I wouldn’t be ashamed to share it with the public :wink:

I am currently on 3.4.x because it works there. Give me some minutes (or more) to finish that and I will move it over again to 4.0.0 and then push it to github, so you can have look (thanks a lot for that!)

2 Likes

Now that I think about it, I guess I thought I did a full build but it was probably only in org.openhab.core but not in root. I’ll try that now.

Now I did a full build (mvn install) on jdk 17 and after that a mvn install in the folder ./openhab-core/bundles/org.openhab.core.io.rest.core which I then deployed, unfortunately with the same result (>3.4 && < 4.0).

I pushed my changes to GitHub - stefan-hoehn/openhab-core at 4.0_add_get-item_namespaces

Thanks for taking a look, Jan :bowing_man:

I check out your branch and it looks fine. Can you please rename the .jar to .zip and check the META-INF/MANIFEST.MF. It should contain

Import-Package: io.swagger.v3.oas.annotations;resolution:=optional;ver
 sion="[2.1,3)",io.swagger.v3.oas.annotations.media;resolution:=option
 al;version="[2.1,3)",io.swagger.v3.oas.annotations.responses;resoluti
 on:=optional;version="[2.1,3)",io.swagger.v3.oas.annotations.security
 ;resolution:=optional;version="[2.1,3)",io.swagger.v3.oas.annotations
 .tags;resolution:=optional;version="[2.1,3)",javax.annotation.securit
 y;resolution:=optional;version="[1.2,2)",com.google.gson;version="[2.
 9,3)",javax.ws.rs,javax.ws.rs.core,javax.ws.rs.ext,org.openhab.core.a
 ddon;version="[4.0,5)",org.openhab.core.binding;version="[4.0,5)",org
 .openhab.core.binding.dto;version="[4.0,5)",org.openhab.core.common;v
 ersion="[4.0,5)",org.openhab.core.common.registry;version="[4.0,5)",o
 rg.openhab.core.config.core;version="[4.0,5)",org.openhab.core.config
 .core.dto;version="[4.0,5)",org.openhab.core.config.core.status;versi
 on="[4.0,5)",org.openhab.core.config.core.validation;version="[4.0,5)
 ",org.openhab.core.config.discovery;version="[4.0,5)",org.openhab.cor
 e.config.discovery.dto;version="[4.0,5)",org.openhab.core.config.disc
 overy.inbox;version="[4.0,5)",org.openhab.core.events;version="[4.0,5
 )",org.openhab.core.i18n;version="[4.0,5)",org.openhab.core.io.rest;v
 ersion="[4.0,5)",org.openhab.core.io.rest.core.config,org.openhab.cor
 e.io.rest.core.item,org.openhab.core.io.rest.core.link,org.openhab.co
 re.io.rest.core.service,org.openhab.core.io.rest.core.thing,org.openh
 ab.core.items;version="[4.0,5)",org.openhab.core.items.dto;version="[
 4.0,5)",org.openhab.core.items.events;version="[4.0,5)",org.openhab.c
 ore.library.items;version="[4.0,5)",org.openhab.core.library.types;ve
 rsion="[4.0,5)",org.openhab.core.persistence;version="[4.0,5)",org.op
 enhab.core.persistence.dto;version="[4.0,5)",org.openhab.core.semanti
 cs;version="[4.0,5)",org.openhab.core.thing;version="[4.0,5)",org.ope
 nhab.core.thing.binding;version="[4.0,5)",org.openhab.core.thing.bind
 ing.firmware;version="[4.0,5)",org.openhab.core.thing.dto;version="[4
 .0,5)",org.openhab.core.thing.firmware;version="[4.0,5)",org.openhab.
 core.thing.firmware.dto;version="[4.0,5)",org.openhab.core.thing.i18n
 ;version="[4.0,5)",org.openhab.core.thing.link;version="[4.0,5)",org.
 openhab.core.thing.link.dto;version="[4.0,5)",org.openhab.core.thing.
 profiles;version="[4.0,5)",org.openhab.core.thing.profiles.dto;versio
 n="[4.0,5)",org.openhab.core.thing.type;version="[4.0,5)",org.openhab
 .core.thing.util;version="[4.0,5)",org.openhab.core.transform;version
 ="[4.0,5)",org.openhab.core.types;version="[4.0,5)",org.osgi.framewor
 k;version="[1.9,2)",org.osgi.service.cm;version="[1.6,2)",org.slf4j;v
 ersion="[1.7,2)"

but I guess in your case it’s not [4.0,5) but [3.4,4), correct?

Did you use mvn install or mvn clean install?

BTW: You can speed-up build by skipping checks and tests and enable parallel build with mvn clean install -DskipChecks -DskipTests -T 1.5C which makes a full build less than 4 minutes on my MacBook Air.

I did a screenshot intentionally so I could hightlight my bundle entry and the starts of the bundles:

Yes and no, it seems to be worse, some of them are 3.4,4, some are 4.0,5.

(I have also attached the manifest file)
MANIFEST.MF.txt (12.2 KB)

I did a “mvn install” :worried:
I’ll try another round with cleaning first.

Thanks, very appreciated :star_struck:

This is really awesome :smiley:

Total time: 01:18 min (Wall Clock)

Finally the full build of the whole project openhab-core/bundles with “mvn clean install” has cleaned up the dependencies also in the subproject bundles/org.openhab.core.io.rest.core.

Learning: Always clean the full house first before you deploy a new room that depends on the house :upside_down_face:

Thanks already so far, Jan.

Next step then:

As mentioned earlier, I want to refactor it in a way that part of the org.openhab.core.io.rest.core would go into org.openhab.core.

As I have become cautious at this point, in which sequence should I deploy these two bundles and when should I stop which of the original bundles or do you think that should make a difference? At least quite a number of bundles depend on org.openhab.core (note that it is not a breaking change).

After exchanging org.openhab.core I suggest you restart openHAB. It’s very difficult to get it right otherwise. What do you want to move from core.io.rest.core to core?

Currently all the logic I implemented is in the Rest-Call-Method

    Set<String> allItemMetadataNamespaces = metadataRegistry.getAll().stream()
            .filter(n -> !excludedNamespaces.contains(n.getUID().getNamespace()))
            .filter(n -> n.getUID().getItemName().equals(itemname)).map(n -> n.getUID().getNamespace())
            .collect(Collectors.toSet());

@florian-h05 asked me if we could not provide the getNamespaces-Method to the item-Metadata-Registry, so I would extract to to

Set<String> allItemMetadataNamespaces = metadataRegistry.getAllNamespaces(itemname).stream()
        .filter(n -> !excludedNamespaces.contains(n))
        .collect(Collectors.toSet());

with getAllNamespaces being:

    public Set<String> getAllNamespaces(String itemname) {
        return getAll().stream().filter(n -> {
            return n.getUID().getItemName().equals(itemname);
        }).map(n -> n.getUID().getNamespace()).collect(Collectors.toSet());
    }

I wouldn’t put the the excludes into it though.

What do you think?

1 Like

Looks good.

What machine are you using to build in less than 1 1/2 minute?

Similar to yours, I would say, Apple M1 Pro (32GB)
Total Number of Cores: 10 (8 performance and 2 efficiency)

I am a step further but unfortunately now into a different direction:

as you recommended I stopped the core bundle, copied it to the addons folder and then restarted openhab which works well: the new core package got deployed and running

openhab> bundle:list | grep "openHAB Core :: Bundles :: Core"
149 │ Resolved │  80 │ 4.0.0.202212302150     │ openHAB Core :: Bundles :: Core
322 │ Active   │  80 │ 4.0.0.202301030833     │ openHAB Core :: Bundles :: Core

Though I noticed that that the core rest bundle got into the waiting mode when I deployed

178 │ Resolved │ 80 │ 4.0.0.202212302158 │ openHAB Core :: Bundles :: REST Interface :: Core
323 │ Waiting │ 80 │ 4.0.0.202301030849 │ openHAB Core :: Bundles :: REST Interface :: Core

After I had deployed I hadn’t checked the openhab UI and logs at all because I was so happy that the core bundle became active BUT

openhab isn’t starting anymore :

2023-01-03 10:22:08.467 [INFO ] [org.eclipse.jetty.util.log          ] - Logging initialized @16771ms to org.eclipse.jetty.util.log.Slf4jLog
2023-01-03 10:22:14.958 [INFO ] [org.eclipse.jetty.server.session    ] - DefaultSessionIdManager workerName=node0
2023-01-03 10:22:14.962 [INFO ] [org.eclipse.jetty.server.session    ] - No SessionScavenger set, using defaults
2023-01-03 10:22:14.976 [INFO ] [org.eclipse.jetty.server.session    ] - node0 Scavenging every 600000ms
2023-01-03 10:22:15.162 [INFO ] [.jetty.server.handler.ContextHandler] - Started HttpServiceContext{httpContext=org.ops4j.pax.web.extender.whiteboard.internal.WebApplication$1@419163b0}
2023-01-03 10:22:15.217 [INFO ] [org.eclipse.jetty.server.Server     ] - jetty-9.4.46.v20220331; built: 2022-03-31T16:38:08.030Z; git: bc17a0369a11ecf40bb92c839b9ef0a8ac50ea18; jvm 17.0.4+8-Debian-1deb11u1
2023-01-03 10:22:15.294 [INFO ] [.jetty.server.handler.ContextHandler] - Started o.e.j.s.h.ContextHandler@7a007532{/static,null,AVAILABLE}
2023-01-03 10:22:15.424 [INFO ] [pse.jetty.util.ssl.SslContextFactory] - x509=X509@123da5e3(mykey,h=[openhab.org],a=[],w=[]) for Server@384cf4f8[provider=null,keyStore=file:///var/lib/openhab/etc/keystore,trustStore=file:///var/lib/openhab/etc/keystore]
2023-01-03 10:22:15.636 [INFO ] [lipse.jetty.server.AbstractConnector] - Started 0.0.0.0:8443@42332b94{SSL, (ssl, http/1.1)}{0.0.0.0:8443}
2023-01-03 10:22:15.647 [INFO ] [lipse.jetty.server.AbstractConnector] - Started default@4af2579b{HTTP/1.1, (http/1.1)}{0.0.0.0:8080}
2023-01-03 10:22:15.651 [INFO ] [org.eclipse.jetty.server.Server     ] - Started @23973ms
2023-01-03 10:22:16.573 [WARN ] [.transport.servlet.ServletController] - Can't find the request for http://ourhome2:8080/rest/auth/token's Observer 
2023-01-03 10:22:25.300 [INFO ] [.jetty.server.handler.ContextHandler] - Started HttpServiceContext{httpContext=DefaultHttpContext [bundle=org.openhab.ui_4.0.0.202212311710 [218], contextID=default]}
2023-01-03 10:22:25.865 [INFO ] [.jetty.server.handler.ContextHandler] - Started HttpServiceContext{httpContext=DefaultHttpContext [bundle=org.jupnp_2.6.1 [265], contextID=custom]}
2023-01-03 10:22:29.223 [INFO ] [.jetty.server.handler.ContextHandler] - Started HttpServiceContext{httpContext=DefaultHttpContext [bundle=org.openhab.binding.homeconnect_4.0.0.202301011303 [273], contextID=default]}
2023-01-03 10:22:31.118 [INFO ] [.jetty.server.handler.ContextHandler] - Started HttpServiceContext{httpContext=DefaultHttpContext [bundle=org.openhab.ui.habpanel_4.0.0.202212311706 [315], contextID=default]}
2023-01-03 10:22:31.123 [INFO ] [ab.ui.habpanel.internal.HABPanelTile] - Started HABPanel at /habpanel
2023-01-03 10:22:32.838 [INFO ] [.jetty.server.handler.ContextHandler] - Started HttpServiceContext{httpContext=DefaultHttpContext [bundle=org.openhab.core.audio_4.0.0.202212302154 [152], contextID=custom]}
2023-01-03 10:22:33.364 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Time zone set to 'Europe/Berlin'.
2023-01-03 10:22:33.386 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Location set to '50.1021864320423,8.403853867202997'.
2023-01-03 10:22:33.388 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Locale set to 'en_DE'.
2023-01-03 10:22:33.390 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Measurement system set to 'SI'.
2023-01-03 10:22:33.792 [WARN ] [ipt.internal.ScriptEngineManagerImpl] - bundle org.openhab.core.automation.module.script:4.0.0.202212302159 (157)[org.openhab.core.automation.module.script.internal.ScriptEngineManagerImpl(59)] : Could not get service from ref {org.openhab.core.automation.module.script.ScriptEngineFactory}={service.config.factory=false, service.id=384, service.bundleid=266, service.scope=bundle, service.config.category=automation, service.pid=org.openhab.jsscripting, service.config.label=JS Scripting, component.name=org.openhab.automation.jsscripting.internal.GraalJSScriptEngineFactory, service.config.description.uri=automation:jsscripting, component.id=238}

So I checked that bundle (157) and it turns out it is in WAITING now

157 │ Waiting │ 80 │ 4.0.0.202212302159 │ openHAB Core :: Bundles :: Automation Script Modules

Note that it is not the only one, lots of bundles are now in waiting!

This is what it reveals when I check that bundle

openhab> diag 157
openHAB Core :: Bundles :: Automation Script Modules (157)
----------------------------------------------------------
Status: Waiting
Declarative Services
org.openhab.core.automation.module.script.internal.defaultscope.DefaultScriptScopeProvider (63)
  missing references: $000, $001, $002
org.openhab.core.automation.module.script.internal.ScriptExtensionManager (60)
org.openhab.core.automation.module.script.internal.action.ScriptActionScriptScopeProvider (61)
org.openhab.core.automation.module.script.LifecycleScriptExtensionProvider (56)
org.openhab.core.automation.module.script.internal.GenericScriptEngineFactory (58)
org.openhab.core.automation.module.script.internal.factory.ScriptModuleHandlerFactory (64)
org.openhab.core.automation.module.script.internal.ScriptEngineManagerImpl (59)
org.openhab.core.automation.module.script.internal.action.ScriptExecutionImpl (62)
org.openhab.core.automation.module.script.internal.provider.ScriptModuleTypeProvider (65)
org.openhab.core.automation.module.script.ScriptTransformationService (57)
  missing references: $000

I get the same message for all other waiting bundles as well!

Here is the list of the above mentioned numbers (bundles?) though 61 is missing (I checked on my production system 3.4 and 61 doesn’t exist their either) - all are active.

63 │ Active   │  80 │ 3.4.5                  │ Apache CXF Core
60 │ Active   │  80 │ 2.0.0                  │ Apache Aries JAX-RS Whiteboard
61 ?
56 │ Active   │  80 │ 3.2.0.v201101311130    │ ANTLR Runtime
58 │ Active   │  80 │ 1.2.2                  │ org.apache.aries.component-dsl.component-dsl
64 │ Active   │  80 │ 3.4.5                  │ Apache CXF Runtime JAX-RS Frontend
59 │ Active   │  80 │ 1.0.1                  │ Apache Aries JAX-RS Specification API
62 │ Active   │  80 │ 3.12.0                 │ Apache Commons Lang
65 │ Active   │  80 │ 3.4.5                  │ Apache CXF JAX-RS Client
57 │ Active   │  80 │ 1.0.0.v201105210816    │ Aopalliance Plug-in

Here is the code implementation that I did: https://github.com/openhab/openhab-core/compare/main...stefan-hoehn:openhab-core:4.0_add_get-item_namespaces

Do you have an idea how to proceed now?

I created a pull request:

Even though my guess would be when building the whole thing there is a high likelyhood that it will play together well, it would probably still be interesting to further research the deployment topic? What do you think?

Btw, I am also open to do a video session if you would think this is more efficient to get that topic solved.

In general it is better to use bundle:update because then resolving the depending bundles should work automatically. If you add the bundle in addition to the old bundle (even if it is not started) you need to resolve them manually by bundle:resolve ....

Ok, I’ll try that way again. I noticed in the last days that bundle:update has issues at least on updates as it doesn’t find the bundle file anymore later on but I agree it would be good enough during development.

I’ll be right back :wink:

And the other question I asked myself: How do I revert a bundle:update if it doesn’t work?

FINALLY

This worked well now! So definitely only use bundle:update during development.

(btw, I just read that there is also something like a bundle:refresh that might be needed for bundles that depend on your new bundle to refresh its dependences. see How does OSGi bundle update work? - Stack Overflow)

Hopefully last question then: How do I revert a bundle:update if it doesn’t work?

And if you don’t mind, there is a little PR waiting to be reviewed now :wink:

Thanks for all your support, Jan! I really appreciate that.