Pax Web 8.0.2 & Karaf 4.4.0 and context path /

201 views
Skip to first unread message

Jakub Herkel

unread,
May 14, 2022, 2:31:17 AM5/14/22
to OPS4J
Hi,

I tried to migrate our application to karaf 4.4.0. Unfortunately I found out that I couldn't access to application via browser. Our app has a lot of osgi bundles and one big WAR with angular app (web context path is "/").  It works fine with karaf 4.3.6. But with karaf 4.4.0 when I tried to access web I received 404. 

Here are some of outputs from web command :
karaf@root()> web:context-list
Bundle ID │ Symbolic Name                         │ Context Path │ Context Name │ Rank │ Service ID │ Type        │ Scope   │ Registration Properties
──────────┼───────────────────────────────────────┼──────────────┼──────────────┼──────┼────────────┼─────────────┼─────────┼─────────────────────────────────────────────────
202       │ org.apache.cxf.cxf-rt-transports-http │ /            │ default      │ MAX  │ 0          │ HttpService │ static* │ httpContext.id=default
          │                                       │              │              │      │            │             │         │ httpContext.path=/
          │                                       │              │              │      │            │             │         │ osgi.http.whiteboard.context.httpservice=default
          │                                       │              │              │      │            │             │         │ osgi.http.whiteboard.context.path=/
326       │ tech.pantheon.chronos.web             │ /            │ /            │ MAX  │ 0          │ WAB         │ static* │ osgi.http.whiteboard.context.path=/

karaf@root()> web:servlet-list
Bundle ID │ Name                       │ Class                                                             │ Context Path(s) │ URLs          │ Type        │ Context Filter
──────────┼────────────────────────────┼───────────────────────────────────────────────────────────────────┼─────────────────┼───────────────┼─────────────┼───────────────
202       │ cxf-osgi-transport-servlet │ org.apache.cxf.transport.servlet.CXFNonSpringServlet              │ /               │ /cxf/*        │ HttpService │ -
326       │ default                    │ org.ops4j.pax.web.service.jetty.internal.web.JettyResourceServlet │ /               │ /             │ WAB         │ -
326       │ jsp                        │ org.ops4j.pax.web.jsp.JspServlet                                  │ /               │ *.jspx, *.jsp │ WAB         │ -

karaf@root()> web:wab-info 326

Chronos :: Web project (326)
----------------------------
Context Path: /
Deployment State: Deployed
WAB ClassPath:
 - bundle://11e5e938-27e2-46c1-ad0d-76992b218d96_326.0:0/WEB-INF/classes/
ServletContainerInitializers:
 - org.ops4j.pax.web.jsp.JasperInitializer
Container web fragments (reachable bundles without /META-INF/web-fragment.xml):
 - (102) org.ops4j.pax.web.pax-web-jsp/8.0.2

Could someone help me find out what is wrong?

Jakub

Grzegorz Grzybek

unread,
May 16, 2022, 2:07:59 AM5/16/22
to op...@googlegroups.com
Hello

I've created https://github.com/ops4j/org.ops4j.pax.web/issues/1717 issue to investigate this problem.

Pax Web 8 has (it had to) changed completely the context management to be compliant with OSGi CMPN Whiteboard Service. There are lot of conflict resolution aspects - especially when you mix servlets (and generally web elements) "coming from" HttpService, Whiteboard and WABs.

Let me check it this week - please monitor https://github.com/ops4j/org.ops4j.pax.web/issues/1717

regards
Grzegorz Grzybek

--
--
------------------
OPS4J - http://www.ops4j.org - op...@googlegroups.com

---
You received this message because you are subscribed to the Google Groups "OPS4J" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ops4j+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ops4j/dd40e36b-7596-4b03-a391-16390b0d5f32n%40googlegroups.com.

Grzegorz Grzybek

unread,
May 20, 2022, 2:34:58 AM5/20/22
to op...@googlegroups.com
Hello


It was a bit tricky, but finally it works - HttpService, Whiteboard and WAB elements can be safely mixed even in "/" context (which is special, because it's created even without any registration, because pax-web-extender-whiteboard and pax-web-runtime themselves create "/" contexts by default).

This fix will be part of 8.0.4 release (which will also include Tomcat upgrade to 9.0.63).

Thanks again Jakub for reporting - I forgot that you sometimes need a WAB installed at "/" context ;)

kind regards
Grzegorz Grzybek

Jakub Herkel

unread,
May 22, 2022, 1:45:13 PM5/22/22
to OPS4J
thanks a lot, I will check our app with 8.0.4.

Jakub
Reply all
Reply to author
Forward
0 new messages