hapifhir / hapi-fhir

🔥 HAPI FHIR - Java API for HL7 FHIR Clients and Servers
http://hapifhir.io
Apache License 2.0
1.94k stars 1.3k forks source link

Migrate javax.servlet to jakarta.servlet and upgrade to Spring 6 and Boot 3 #2082

Closed darmbrust closed 6 months ago

darmbrust commented 3 years ago

Is there currently and play or timeline for the migration of code like https://github.com/jamesagnew/hapi-fhir/blob/9711b5ed1876e1566435a86873be5ee40f0ffc62/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/RestfulServer.java#L76

from javax to jakarta?

Servers such as Tomcat and Jetty now have beta versions out that have the change made, but I don't believe any of them support deploying code that is still using javax (though I would be happy to be wrong...). Tomcat suggests a migration tool to help in the transition: https://github.com/apache/tomcat-jakartaee-migration

jamesagnew commented 3 years ago

Are there any advantages to making this transition?

Healthcare orgs often move very slowly so we'd probably alienate a number of current users of HAPI FHIR if we made a change that prevented deploying on anything but a brand new app container.

Unless there is a really compelling reason I can't see us moving anytime soon.

darmbrust commented 3 years ago

I'm just trying to work through the migration hell myself... and basically, it appears that nobody supports using old code with new. I'm trying to use Jetty, for example, to deploy my rest code, which uses the new annotations... while also having the Fhir server... and I can't make them play together. Hoping that maybe I can use the tomcat suggested migration tool to change the fhir jars... but haven't tried yet. Have a similar problem with wicket, which also hasn't transitioned.

I'd happy to be shown that there was a way to deploy Servlets that use javax on servers that are build for jakarta..... but right now, it appears to be completely incompatible.

jamesagnew commented 3 years ago

Would it work to just implement both interfaces in the same Servlet class by any chance?

On Tue, Sep 15, 2020 at 1:53 PM Dan Armbrust notifications@github.com wrote:

I'm just trying to work through the migration hell myself... and basically, it appears that nobody supports using old code with new. I'm trying to use Jetty, for example, to deploy my rest code, which uses the new annotations... while also having the Fhir server... and I can't make them play together. Hoping that maybe I can use the tomcat suggested migration tool to change the fhir jars... but haven't tried yet. Have a similar problem with wicket, which also hasn't transitioned.

I'd happy to be shown that there was a way to deploy Servlets that use javax on servers that are build for jakarta..... but right now, it appears to be completely incompatible.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jamesagnew/hapi-fhir/issues/2082#issuecomment-692876713, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA2N7HPO6L5HHLHHQFPLD3TSF6S2FANCNFSM4RNPHUIA .

darmbrust commented 3 years ago

Not sure, I'm still experimenting. I was hoping I would find a little library where someone had just done the translations... but apparently I'm still too early in trying to deal with it. I'll report back if I find anything that makes it relatively easy to be compatible...

goafabric commented 1 year ago

Just stumbled upon this This is honestly now needed. As the upcoming Spring Boot 3.0 has Jakarta EE9 as a baseline. And support for 2.x will fade out. Also more and more projects are migrating to Jakarta.

From my (little) experience I don't think it will be possible to support both within the same version. Other projects usually bump up the major version and from there on, it will be jakarta ee9

jamesagnew commented 1 year ago

I think the likely timeline would be 2023 sometime.

This is a really hard thing to time, given the enormous impact it will have on users. There are countless interceptors written against the javax.servlet API, many people who have annoying corporate rules against upgrading to modern containers, etc.

I do want to get this done, but it will be tough.

goafabric commented 1 year ago

@jamesagnew ok thanks for the information @goafabric remindme

Richard-de-Vries commented 1 year ago

I would also be interested in the migration to Jakarta EE9 because of the Spring Boot 3.x release :smile:

maxime-dumont commented 1 year ago

My team is also interested in this. We need to migrate to springboot 3 because of a CVE, but since hapi fhir still uses javax.servlet we can't :(

jkiddo commented 1 year ago

This PR is sort of related to this discussion https://github.com/hapifhir/hapi-fhir-jpaserver-starter/pull/473

janverhoeckx commented 1 year ago

We are also interested in this because it's blocking us from migrating to Spring Boot 3.x.

tamasVarjas commented 1 year ago

@jamesagnew – is there any update on the prospective timeline for this?

eevaturkka commented 1 year ago

We are also interested in this because of upgrading spring.

demarco88 commented 1 year ago

That's an important question!!! HAPI Fhir Rest-Server actually seems not support Jakarta EE >= 9 and therfore didn't run in such environments?! Not only Spring Boot 3; also several other environemnts like JEE 10 application servers or web containers. JEE8 is running out of maintenance! We need a timeline or better a solution!

jamesagnew commented 1 year ago

This is clearly getting more important to people. I have heard a lot of arguments for it, and none against it.

Will try to provide a proposed timeline soon.

apeteri commented 1 year ago

Just wanted to chime in and tell that the Tomcat migration tool mentioned by @darmbrust in the first comment seems to be working, as far as it allowing a minimal Plain Server to be started in Spring Boot 3.0.5 without any errors.

The downside is that one has to keep the transformed version of hapi-fhir-server around so that it can be added instead of the official one as a dependency to the project.

granadacoder commented 1 year ago

Hi.

We are also hitting this issue (very "abruptly").

Hapi FHIR plain server/facade. "6.4.4" (latest version as I write this comment)

JDK11 is near end of life (normal) support.

https://endoflife.date/java

(30 Sep 2023)

Thus JDK17 is the "current" LTS (LONG Term Support) option.

SpringBoot.

Spring Boot 2.7 is near end of life (normal) support.

https://endoflife.date/spring-boot

Ends in 6 months

(18 Nov 2023)

IMHO:

Thus SpringBoot 3.0 is a "very soon" needed upgrade.

I have not tried SB 3 with (force override) with Spring Framework 6.x combinations yet. This of course would be a Frankenstein ('s Monster) combination....but will try to find time to try this out.

nathanloyer commented 1 year ago

@jamesagnew Any updates on a timeline for this?

tanmaydarmorha commented 1 year ago

Hey, Our project uplifted to JDK17 recently and we had to uplift tomcat as well. Now we are facing issues with this library, is there any estimated timeline for jakarta migration?

shaleen-seth commented 1 year ago

looking for timeline for Jakarta Migration? we are using hapi-fhir and its still on javax-based JEE version

JPercival commented 1 year ago

One more consideration, Android 14 SDK (n preview) is supposed to bring partial JDK 17 support sometime after July: https://developer.android.com/about/versions/14/overview

granadacoder commented 1 year ago

Hi.

Hapi/James has published a survey here:

https://forms.gle/tMybKV9VrGRaTsrf9

Most important question (to people who have chimed in to this issue)

The Java EE spec has moved from the javax. package namespace to the new jakarta. namespace. HAPI FHIR will need to migrate to the new API and it is unfortunately not feasible to support both APIs long term. Migrating to the new API will be required in order to use HAPI FHIR with the current release of many popular frameworks including Spring 6, Spring Boot 3, and Hibernate 6.

This is a nontrivial change: It will require upgrades to Spring and Hibernate within HAPI FHIR. It will also require HAPI FHIR users to potentially upgrade their application servers, and rework any custom code (e.g. resource providers, interceptors) in order to use the new APIs.

Our current working plan is to make this upgrade as a part of our November 2023 release, with early access builds available before that time.

Please list your opinion on this change:

I will not be affected by this change so I do not have an opinion.

I am unable to upgrade my existing infrastructure to support the next jakarta. at this time and will be unable to use HAPI FHIR versions that so not support the old javax. packages.

I would like this upgrade to happen in November.

Other:

I voted "November" of course ! (October 2023, September 2023 would be even better!)

jamesagnew commented 11 months ago

FYI to anyone following along, here's a writeup of our plans: https://docs.google.com/document/d/1miIu85DEkyR1MsenU5eYgBQk9i50UP1u6_Rp16fMOAg/edit

jkiddo commented 9 months ago

@jamesagnew is there a public branch available where one can check out the amount of changes needed to one's own use of HAPI FHIR (I'm specifically thinking of the starter project as guinea pig here)

jamesagnew commented 9 months ago

@jkiddo The working branch for this change is ja_20230610_servlet_migration. Progress has been good so far, it's definitely on track for november relase. I'd guess we'll be merging this by early october or so.

jkiddo commented 9 months ago

Best news ever!

jamesagnew commented 8 months ago

FYI an update has been posted here: https://groups.google.com/g/hapi-fhir/c/U6dXYsC7LCg/m/N1Q752evBAAJ

jamesagnew commented 7 months ago

FYI we are now in review for this change. Our intention is to merge this after our November release.

This is now feature complete, but because of transitive dependencies on JAXB, it requires coordination with CQL/CR projects. The following two projects must be built locally for now. This will change in the coming weeks:

s4l4r commented 7 months ago

@jamesagnew thanks a lot for the update. do we know when the November release is going to happen? like an estimated date?

KevinDougan-SmileCDR commented 7 months ago

@s4l4r The November Release is coming out on Thursday, Nov. 16th

giovanni-attratto commented 7 months ago

@jamesagnew thanks for the news! Do you have forecast for the next one with the merge? thanks a lot

MatonAnthony commented 7 months ago

Since the intent of merging this with the november release will not happen. Do you intend to cut a new release with the Jakarta changes soon after ?

It's starting to become an issue for us to be late on our Spring updates

KevinDougan-SmileCDR commented 7 months ago

@MatonAnthony Yes, James stated above: "Our intention is to merge this after our November release." I would expect that the merge will happen before the end of November.

jamesagnew commented 6 months ago

This has now landed.

HAPI FHIR 6.11.5-SNAPSHOT and later are using the new Jakarta APIs. This will be released as HAPI FHIR 7.0.0 in Feb 2024.

JPA users can test this out using the branch in this PR: https://github.com/hapifhir/hapi-fhir-jpaserver-starter/pull/618