Skip to content

Migrate to Jakarta EE 10 / Jetty 12 / Karaf 4.5 - #1893

Draft
holgerfriedrich wants to merge 7 commits into
openhab:mainfrom
holgerfriedrich:k450
Draft

Migrate to Jakarta EE 10 / Jetty 12 / Karaf 4.5#1893
holgerfriedrich wants to merge 7 commits into
openhab:mainfrom
holgerfriedrich:k450

Conversation

@holgerfriedrich

Copy link
Copy Markdown
Member

@holgerfriedrich
holgerfriedrich marked this pull request as ready for review April 8, 2026 15:05
@holgerfriedrich
holgerfriedrich requested a review from a team as a code owner April 8, 2026 15:05
@holgerfriedrich
holgerfriedrich marked this pull request as draft April 8, 2026 15:05
@holgerfriedrich

Copy link
Copy Markdown
Member Author

Sorry, wrong button. PR not yet ready, rest registration is not working properly....

holgerfriedrich and others added 4 commits August 9, 2026 16:43
* remove java2 endorsement libs
* adapt jetty config
* jakarta servlet config
* disable sni

Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
openhab-core's Karaf 4.5 / Jetty 12 migration (Jersey-based JAX-RS
whiteboard, JAXB 4.0, Jakarta Servlet 6.1) left launch/app/app.bndrun
unable to resolve. Several issues compounded:

- org.apache.aries.jax.rs.whiteboard was replaced with the Jersey-based
  org.eclipse.osgitech.rest triplet, matching openhab-core's own
  itest bndruns.
- -runrequires.ee updated for the JAXB 4 stack (jakarta.activation-api,
  org.glassfish.jaxb.{core,runtime,txw2}, com.sun.istack.commons-runtime)
  instead of the old servicemix activation-api.
- swagger-core-jakarta hard-requires jakarta.xml.bind.annotation in range
  [3.0,4), which nothing provides once bom/runtime moved to JAXB 4.0.5.
  Repository construction was switched from bnd-run-maven-plugin's live
  Maven-dependency-graph resolution (which can only ever expose one
  version per artifact) to bnd-indexer-maven-plugin building its own
  index + a small frozen jaxb3-compat-index.xml, wired in via
  -standalone - the same technique openhab-core's bom/runtime-index /
  bom/openhab-core-index pair uses, so swagger gets a 3.0.0 candidate
  alongside the real 4.0.5 used everywhere else.
- org.apache.felix.http.servlet-api and org.apache.tomcat-servlet-api
  are stale/duplicate providers of jakarta.servlet and javax.servlet
  (5 distinct bundles exported the same heavily "uses"-referenced
  packages); this ambiguity was driving Felix's resolver into
  exponential backtracking (confirmed via thread dump) whenever enough
  of the feature set was requested together, most visibly with
  org.eclipse.osgitech.rest and org.apache.felix.webconsole.plugins.ds.
  Blacklisting both fixes the resolve; org.ops4j.pax.web.pax-web-
  compatibility-servlet is deliberately kept off the blacklist since
  it's the real bridge providing the osgi.contract=JakartaServlet
  capability at both 5.0.0 (needed by osgitech.rest, pinned to Jakarta
  Servlet 5.0) and 6.1.0 (needed by pax-web-runtime on Jetty 12).
- jakarta.ws.rs-api is no longer blacklisted, since it's required by
  the Jersey-based stack.

The org.apache.felix.webconsole 4.8.12 -> 5.0.18 bump and the
org.owasp.encoder dependency it needs live in openhab-core's
bom/runtime, not this repo.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
…aunch/app

org.eclipse.osgitech.rest.servlet.whiteboard's
JakartarsServletWhiteboardRuntimeComponent has
configuration-policy="require": it never activates without a matching
ConfigAdmin configuration, which means it never publishes the
JakartarsServiceRuntime service, which means
org.openhab.core.io.rest.internal.resources.RootResource (which
@references that service) stays permanently unsatisfied - so /rest
404s even though individual REST resources underneath it still
register fine.

The Karaf distribution already ships the equivalent default at
distributions/openhab/src/main/resources/userdata/etc/
JakartarsServletWhiteboardRuntimeComponent.cfg; launch/app never had
one. Since launch/app uses Felix's own file-based ConfigAdmin
(felix.cm.dir) rather than Karaf's fileinstall-watched *.cfg
directory, the equivalent has to be seeded directly in Felix's own
persistence format.

Verified end-to-end on a scratch instance: the component goes from
"no config" to "active", RootResource goes from "unsatisfied
(reference)" to "active", and /rest now returns the real REST API
root listing instead of 404.

launch/app/runtime/userdata is otherwise gitignored (per-instance
runtime state); carved out a precise exception so only this one seed
file is tracked, everything else (logs, machine-specific bundle cache
paths, etc.) stays ignored as before.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This patching step has no longer worked for quite a while.

`findResources` was removed from pax-web upstream in January 2020 (commit
`cf6861615`, part of the PAXWEB-1190 Http/Whiteboard refactor), replaced by
the current `findEntries(...)` methods - over a year and a half *before*
pax-web `8.0.0` GA even shipped (September 2021). Every pax-web version
openHAB has used since, including `8.0.35`/`8.0.36` (pre-migration) and
`11.1.2` (this branch), has no method by that name.

`ClassAdapter`'s method-matching (`"findResources".equals(name)`) therefore
never fires, and `ClassPathUtilPatcher` has no verification step - it always
prints `"Finished updating ..."` and exits 0 regardless of whether anything
was actually patched.

Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant