apache / jena

Apache Jena
https://jena.apache.org/
Apache License 2.0
1.11k stars 652 forks source link

Make Fuseki compatible with Jakarta #1763

Open LuLeRoemer opened 1 year ago

LuLeRoemer commented 1 year ago

Version

4.7.0

Feature

We are trying to use the embedded Fuseki server with Spring Boot version 3.0.1. Unfortunately, we run into a problem where we get a ClassNotFoundException exception for javax.servlet.ServletContext. I assume this is due to the fact that jena-fuseki-core in version 4.7.0 uses jetty-servlets in version 10.0.12. From what I understand, the next major version (11) of jetty-servlets replaces javax.* with the jakarta.* API that Spring Boot provides. As described here, we cannot mix the two.

Are you interested in contributing a solution yourself?

No

afs commented 1 year ago

The blocker is the WAR file which shares jena-fuseki-core.

It locks to specific versions of Apache Tomcat (Tomcat 10 being the first Jakarka based Tomcat). There are also the Spring Boot 2 users.

Spring Boot 3 was only a few months ago - Nov 2022

See preparation work : #1643

The migration Jakarta 8 to Jakarta 9 is only renaming. It's not all javax.* but identifying which and running the maven shade plugin should perform this conversion. (There are others tools.)

If anyone has tried, we'd like to hear of your experiences.

afs commented 1 year ago

Seeking information: email to users@ asking about tomcat usage.

rzo1 commented 1 year ago

The migration Jakarta 8 to Jakarta 9 is only renaming. It's not all javax.* but identifying which and running the maven shade plugin should perform this conversion. (There are others tools.)

Maven Shade works just fine. We are using it in several ASF projects (Geronimo, Johnzon, TomEE, ...) to provide Jakarta ready artifacts via Maven classifiers. It has some drawbacks, but it is most likely a quick win rather than dropping javax support completly :-)

Requires some effort from 3rd party libs too (like shiro, but they are also provide jakarta classified artifacts produced via shade)

We (in TomEE) also documented some of our efforts: https://tomee.apache.org/javax-to-jakarta.html

afs commented 1 year ago

@rzo1,

presumably this works in reverse as well -- convert jakarta.* to javax.* (providing no new capabilities of the various specs are used).

There is likely to be a long tail on javax.* usage because of SpringBoot2 and general slowness of updating to recent Tomcat releases.

If this "down-shading" works, we can move to jakarta.* but still have a way of supporting SpringBoot2 and Tomcat<10.

afs commented 1 year ago

We plan to switch to jakarka. at Jena5 (which wil also require Java17). Conversion to jakarka. has been tried - it was pretty uneventful.