ops4j / org.ops4j.pax.web

OSGi R7 Http Service, Whiteboard and Web Applications (OSGi CMPN Release chapters 102, 140 and 128) implementation using Jetty 9, Tomcat 9 or Undertow 2.
https://ops4j1.jira.com/wiki/display/paxweb/Pax+Web
Other
144 stars 183 forks source link

Need to upgrade Jakarta.servlet-api to latest version (6.x) but pax-web-features uses older version #1965

Open vivekjaiprakash opened 1 month ago

vivekjaiprakash commented 1 month ago

We are using Karaf- 4.4.6 version in our project..While installing pax-web-features (9.0.16), it introduces dependency on Jakarta.servlet-api : 4.0.4.

mvn:jakarta.servlet/jakarta.servlet-api/4.0.4

We use 6.x version of Jakarta.servlet-api in the project which creates a conflict causing the following error.

org.ops4j.pax.web.pax-web-jetty [org.ops4j.pax.web.pax-web-jetty [71](R 71.0)] because it is exposed to package 'javax.servlet' from resources jakarta.servlet-api [jakarta.servlet-api [24](R 24.0)] and jakarta.servlet-api [jakarta.servlet-api [116](R 116.0)] via two dependency chains.

Please suggest a way to get around this error? Is there plans of upgrading jakarta.servlet-api in next karat version?

grgrzybek commented 1 month ago

Because of the biggest mistake in Java ecosystem, one does not simply upgrade from Servlet API 4 to Servlet API 6. One also needs to change the Servlet API implementation and all his/her code.

You can't for example just change Servlet API without changing Spring 5 to 6. Or if you're stuck with old JSF implementation...

Pax Web is a victim of politics too, but unfortunately wheels of OSGi gind slow but (probably) grind fine. There's no Pax Web implementation of new OSGi specifications based on jakarta.servlet API. Also because out of 3 web specifications:

Only the Whiteboard one was upgraded to new Servlet API.

There's a new https://github.com/ops4j/org.ops4j.pax.web/commits/main-jakarta/ branch where I work on Pax Web 10 in my spare time, but you know - it depends on the spare time aspect...

So please be patient here...

In the meantime you have Felix HTTP which is based on Jetty and doesn't (afaik) implement the WABs, but it works with new Servlet API.