Closed ops4j-issues closed 6 years ago
Grzegorz Grzybek commented
Fixed here in https://github.com/ops4j/org.ops4j.pax.web/commits/pax-web-7.2.x branch.
Fixed here in https://github.com/ops4j/org.ops4j.pax.web/commits/master branch.
The documentation is available here: https://ops4j1.jira.com/wiki/spaces/paxweb/pages/354025473/HTTP+Context+processing
Grzegorz Grzybek created PAXWEB-1167
The background of this issue is:
/cxf
servlet using plainorg.osgi.service.http.HttpService#registerServlet()
call/cxf
Keycloak project provides a tricky way to change this situation - by re-registering CXF servlet in http Service scoped for different (Keycloak's) bundle after registering login configuration (
org.ops4j.pax.web.service.WebContainer#registerLoginConfig()
) and adding security constraints (org.ops4j.pax.web.service.WebContainer#registerConstraintMapping
). However, whenorg.apache.cxf.osgi
PID changes, the Keycloak's re-registration is broken, because CXF registers another/cxf
servlet in its own http service (risking duplicate alias mapping).My idea is:
ManagedServiceFactory
that tracksorg.ops4j.pax.web.context
factory PIDsregisterServlet()
in its own bundle-scopedHttpService
/WebContainer
doesn't have to be aware of our additional configurationHere's example of PID:
Having such facility inside pax-web-runtime gives me access to
ServerController
instance, so I can for example stop the context before adding context params / login configuration. Also some of the methods of should stop throwingIllegalStateException
if the context has some already registered servlets. Instead the context should simply be restarted (just like its done currently if one simply registers two servlets in a row usingHttpService
).Fixed in: 8.0.0, 7.2.0 Votes: 0, Watches: 1