Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Karaf 4.4.5 and Xtext 2.34 #4133

Merged
merged 4 commits into from
Mar 17, 2024
Merged

Conversation

holgerfriedrich
Copy link
Member

@holgerfriedrich holgerfriedrich commented Mar 5, 2024

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

Upgrade Karaf from 4.4.4 to 4.4.5:
* 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

Signed-off-by: Holger Friedrich <[email protected]>
Signed-off-by: Holger Friedrich <[email protected]>
@holgerfriedrich holgerfriedrich requested a review from a team as a code owner March 5, 2024 19:11
@holgerfriedrich
Copy link
Member Author

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
Copy link
Member Author

@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.

@wborn
Copy link
Member

wborn commented Mar 9, 2024

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 eclipse-archived/smarthome#348.

@holgerfriedrich
Copy link
Member Author

@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.

No longer in use sind 2017, see eclipse-archived/smarthome#4122.

Signed-off-by: Holger Friedrich <[email protected]>
@holgerfriedrich
Copy link
Member Author

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

@holgerfriedrich holgerfriedrich changed the title [WIP] Upgrade to Karaf 4.4.5 and Xtext 2.34 Upgrade to Karaf 4.4.5 and Xtext 2.34 Mar 9, 2024
Copy link
Member

@wborn wborn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many thanks for doing all the upgrades! 🙂

@wborn wborn merged commit 3850599 into openhab:main Mar 17, 2024
3 checks passed
@wborn wborn added this to the 4.2 milestone Mar 17, 2024
@wborn wborn added the enhancement An enhancement or new feature of the Core label Mar 17, 2024
@holgerfriedrich holgerfriedrich deleted the k445 branch March 17, 2024 08:51
@openhab-bot
Copy link
Collaborator

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

@florian-h05
Copy link
Contributor

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?

@holgerfriedrich
Copy link
Member Author

holgerfriedrich commented Mar 22, 2024

@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.

@J-N-K
Copy link
Member

J-N-K commented Mar 22, 2024

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.

@holgerfriedrich
Copy link
Member Author

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

@openhab-bot
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement or new feature of the Core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants