openhab-core icon indicating copy to clipboard operation
openhab-core copied to clipboard

Upgrade to Karaf 4.4.5 and Xtext 2.34

Open holgerfriedrich opened this issue 11 months ago • 5 comments

Upgrade Karaf from 4.4.4 to 4.4.5: https://issues.apache.org/jira/secure/ReleaseNote.jspa?version=12353604&projectId=12311140

  • Sync runtime dependencies with Karaf 4.4.5, most notably:
    • Jetty 9.4.53.v20231009
    • JNA 5.14.0
    • Pax Logging 2.2.6
    • Pax Web 8.0.24
    • ASM 9.6
  • Resolve itest runbundles

Upgrade Xtext from 2.32 to 2.34

  • Sync depencencies, most notably:
    • Guava 33.0.0
    • classgraph 4.8.165 changing provider to io.github.classgraph
  • ~Migrate old Xtext generator xtext.generator to xtext.xtext.generator as xtext.generator has been removed from Xtext, affecting org.openhab.core.model.lazygen~

Refs: openhab/openhab-distro#1590

holgerfriedrich avatar Mar 05 '24 19:03 holgerfriedrich

This PR is still work in progress. Karaf and Xtext have been upgraded, it seems I found a consistent set of dependencies which passes tests and feature verification. 🥳

One problem is still open: org.openhab.core.model.lazygen depended on the old xtext.generator which was deprecated quite a while ago and was finally removed from xtext. The replacement xtext.xtext.generator has quite a different syntax.

Code in LazyLanguageConfig.java has been completely removed in this PR.

Maybe someone could explain what org.openhab.core.model.lazygen is for, I do not see where it is used.

holgerfriedrich avatar Mar 05 '24 19:03 holgerfriedrich

@kaikreuzer @wborn Could you give some insights on org.openhab.core.model.lazygen? I cannot find what it is for and going back in the git history did not help as well.

Apart from that: all PRs for the different repos are prepared and ready for review.

holgerfriedrich avatar Mar 08 '24 19:03 holgerfriedrich

Thanks for the PRs! I also did some local testing with the newer Karaf and Xtext and similarly ran into the lazygen bundle needing updates. I also didn't know what it was used for but apparently is was used for regenerating all model code, see https://github.com/eclipse-archived/smarthome/pull/348.

wborn avatar Mar 09 '24 09:03 wborn

@wborn thanks for the pointer. Following the logs in the archive, LazyGenerator was abandoned on 2017, eclipse-archived/smarthome#4122.

So my proposal is to remove org.openhab.core.model.lazygen. I will adapt my PRs.

holgerfriedrich avatar Mar 09 '24 15:03 holgerfriedrich

Removed lazygen. Only use in openhab/openhab-distro, launch/ModelGen.launch. This target seems to install every package named org.openhab.core.model.*.

holgerfriedrich avatar Mar 09 '24 19:03 holgerfriedrich

This pull request has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/failed-to-execute-goal-org-apache-karaf-tooling4-4-4-verify/154678/4

openhab-bot avatar Mar 17 '24 17:03 openhab-bot

I'm getting these error messages on my openHAB dev machine (latest snapshot) since this PR:

 org.apache.felix.resolver.reason.ReasonException: Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=kar; type=karaf.feature; version="[4.4.5,4.4.5]"; filter:="(&(osgi.identity=kar)(type=karaf.feature)(version>=4.4.5)(version<=4.4.5))" [caused by: Unable to resolve kar/4.4.5: missing requirement [kar/4.4.5] osgi.identity; osgi.identity=org.apache.karaf.kar.core; type=osgi.bundle; version="[4.4.5,4.4.5]"; resolution:=mandatory [caused by: Unable to resolve org.apache.karaf.kar.core/4.4.5: missing requirement [org.apache.karaf.kar.core/4.4.5] osgi.wiring.package; filter:="(&(osgi.wiring.package=org.osgi.framework)(version>=1.0.0)(!(version>=3.0.0)))" [caused by: Unable to resolve org.eclipse.osgi/3.18.0.v20220516-2155: missing requirement [org.eclipse.osgi/3.18.0.v20220516-2155] osgi.ee; filter:="(| (&(osgi.ee=JavaSE)(version=1.8)) (&(osgi.ee=JavaSE/compact1)(version=1.8)) )"]]]
        at org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341)
        at org.apache.felix.resolver.ResolverImpl.doResolve(ResolverImpl.java:433)
        at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:420)
        at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:374)
        at org.apache.karaf.features.internal.region.SubsystemResolver.resolve(SubsystemResolver.java:256)
        at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:399)
        at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1069)
        at org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:1004)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
        at java.base/java.lang.Thread.run(Thread.java:840)

@kaikreuzer Is there anything that needs to be uploaded to our Maven repo?

florian-h05 avatar Mar 21 '24 16:03 florian-h05

@florian-h05 I cannot reproduce the issue you mentioned above with S3998 on my RPI. Is it still there for you with S3998? At which log level does it show up?

If yes, let's open a separate issue to continue the discussion there.

holgerfriedrich avatar Mar 22 '24 16:03 holgerfriedrich

I see the same issue:

17:23:38.379 [ERROR] [.core.karaf.internal.FeatureInstaller] - Failed to refresh bundles after processing config update
org.apache.felix.resolver.reason.ReasonException: Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=shell; type=karaf.feature; version="[4.4.5,4.4.5]"; filter:="(&(osgi.identity=shell)(type=karaf.feature)(version>=4.4.5)(version<=4.4.5))" [caused by: Unable to resolve shell/4.4.5: missing requirement [shell/4.4.5] osgi.identity; osgi.identity=org.apache.karaf.shell.core; type=osgi.bundle; version="[4.4.5,4.4.5]"; resolution:=mandatory [caused by: Unable to resolve org.apache.karaf.shell.core/4.4.5: missing requirement [org.apache.karaf.shell.core/4.4.5] osgi.wiring.package; filter:="(&(osgi.wiring.package=org.osgi.framework)(version>=1.0.0)(!(version>=3.0.0)))" [caused by: Unable to resolve org.eclipse.osgi/3.18.0.v20220516-2155: missing requirement [org.eclipse.osgi/3.18.0.v20220516-2155] osgi.ee; filter:="(| (&(osgi.ee=JavaSE)(version=1.8)) (&(osgi.ee=JavaSE/compact1)(version=1.8)) )"]]]
	at org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341) ~[org.eclipse.osgi-3.18.0.jar:?]
	at org.apache.felix.resolver.ResolverImpl.doResolve(ResolverImpl.java:433) ~[org.eclipse.osgi-3.18.0.jar:?]
	at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:420) ~[org.eclipse.osgi-3.18.0.jar:?]
	at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:374) ~[org.eclipse.osgi-3.18.0.jar:?]
	at org.apache.karaf.features.internal.region.SubsystemResolver.resolve(SubsystemResolver.java:256) ~[?:?]
	at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:399) ~[?:?]
	at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1069) ~[?:?]
	at org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:1004) ~[?:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [?:?]
	at java.lang.Thread.run(Thread.java:840) [?:?]
Caused by: org.apache.felix.resolver.reason.ReasonException: Unable to resolve shell/4.4.5: missing requirement [shell/4.4.5] osgi.identity; osgi.identity=org.apache.karaf.shell.core; type=osgi.bundle; version="[4.4.5,4.4.5]"; resolution:=mandatory [caused by: Unable to resolve org.apache.karaf.shell.core/4.4.5: missing requirement [org.apache.karaf.shell.core/4.4.5] osgi.wiring.package; filter:="(&(osgi.wiring.package=org.osgi.framework)(version>=1.0.0)(!(version>=3.0.0)))" [caused by: Unable to resolve org.eclipse.osgi/3.18.0.v20220516-2155: missing requirement [org.eclipse.osgi/3.18.0.v20220516-2155] osgi.ee; filter:="(| (&(osgi.ee=JavaSE)(version=1.8)) (&(osgi.ee=JavaSE/compact1)(version=1.8)) )"]]
	at org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341) ~[org.eclipse.osgi-3.18.0.jar:?]
	... 12 more
Caused by: org.apache.felix.resolver.reason.ReasonException: Unable to resolve org.apache.karaf.shell.core/4.4.5: missing requirement [org.apache.karaf.shell.core/4.4.5] osgi.wiring.package; filter:="(&(osgi.wiring.package=org.osgi.framework)(version>=1.0.0)(!(version>=3.0.0)))" [caused by: Unable to resolve org.eclipse.osgi/3.18.0.v20220516-2155: missing requirement [org.eclipse.osgi/3.18.0.v20220516-2155] osgi.ee; filter:="(| (&(osgi.ee=JavaSE)(version=1.8)) (&(osgi.ee=JavaSE/compact1)(version=1.8)) )"]
	at org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341) ~[org.eclipse.osgi-3.18.0.jar:?]
	at org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341) ~[org.eclipse.osgi-3.18.0.jar:?]
	... 12 more
Caused by: org.apache.felix.resolver.reason.ReasonException: Unable to resolve org.eclipse.osgi/3.18.0.v20220516-2155: missing requirement [org.eclipse.osgi/3.18.0.v20220516-2155] osgi.ee; filter:="(| (&(osgi.ee=JavaSE)(version=1.8)) (&(osgi.ee=JavaSE/compact1)(version=1.8)) )"
	at org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341) ~[org.eclipse.osgi-3.18.0.jar:?]
	at org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341) ~[org.eclipse.osgi-3.18.0.jar:?]
	at org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341) ~[org.eclipse.osgi-3.18.0.jar:?]
	... 12 more

It only happens once for me after an update / cleaned cache.

J-N-K avatar Mar 22 '24 16:03 J-N-K

I have created a new issue #4158 to track it....

holgerfriedrich avatar Mar 22 '24 17:03 holgerfriedrich

This pull request has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/log-file-not-recreated-on-system-restart/155858/17

openhab-bot avatar May 08 '24 15:05 openhab-bot