Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jakarta Servlet Support #1789

Closed
codylerum opened this issue Oct 31, 2021 · 9 comments
Closed

Jakarta Servlet Support #1789

codylerum opened this issue Oct 31, 2021 · 9 comments

Comments

@codylerum
Copy link

The package name for servlet in 5.0 is moving form javax.servlet to jakarta.servlet

https://jakarta.ee/specifications/servlet/4.0/apidocs/

to

https://jakarta.ee/specifications/servlet/5.0/apidocs/

Will Sentry be supporting both namespaces?

@maciejwalkowiak
Copy link
Contributor

I believe so, the question is how we want to execute on that. It will likely take years till users stop using javax namespace. We can:

  • move sentry-servlet to Jakarta namespace, and point users using javax namespace to older versions
  • create a separate sentry-jakarta-servlet module

While this issue relates currently to sentry-servlet, we will have similar problem eventually with Spring modules, once Spring 6 is released.

@bruno-garcia what's your take on that? Creating a new module - even if it's temporary - where temporary anyway likely means years - is relatively straightforward.

@marandaneto
Copy link
Contributor

maintaining a new module per integration for every major breaking change isn't scalable tho, I'd rather prefer to bump a major and point out people to use the older versions when needed via docs.

what I've seen also in the wild is that a few libraries rename their package eg https://github.com/square/okhttp/tree/master/okhttp/src/main/kotlin/okhttp3 so people can use the older and newer version at the same moment when they have applications mixing both versions.

since Jakarta 5 is still new, maybe we wait a little bit more for the adoption?

@Tristan971
Copy link

Fwiw Spring 6 / Spring Boot 3 are now reaching the first milestone stages and use the jakarta.* namespace, so this will soon start being more significantly adopted.

Having 2 global implementations does sound like a pain indeed, and the transition overall will take years most likely, so maybe some form of HttpServletRequest interface and 2 implementations would be best, then dealing with which one to pick either manually or at autoconfiguration time in the case of the Spring Boot starter?

@bruno-garcia bruno-garcia added this to the 6.0.0 milestone Feb 15, 2022
@bruno-garcia bruno-garcia moved this to Needs Discussion in Mobile & Cross Platform SDK Feb 16, 2022
@marandaneto marandaneto removed this from the 6.0.0 milestone Mar 1, 2022
@bruno-garcia
Copy link
Member

Agreed to move this out of 6.0 since we want to ship this asap and it seems like spring boot on jakarta is not hugely adopted just yet so it can go out on the next major

@maciejwalkowiak
Copy link
Contributor

Spring Boot 3.0 based on Jakarta EE will be released on the 24th of November 2022.

Until then I suggest following plan:

6.x

By default uses javax package. To support Jakarta EE we will need to add modules:

  • sentry-servlet-jakarta
  • sentry-spring-jakarta

Which are copies of the original sentry-servlet and sentry-spring modules that are meant to be kept in sync just with changes packages.

sentry-spring-boot-starter by default imports sentry-spring. To use with Jakarta sentry-spring has to be excluded and sentry-spring-jakarta added as a dependency.

7.x

By default uses Jakarta EE.

sentry-spring-boot-starter by default imports sentry-spring-jakarta. To use with Javax sentry-spring-jakarta has to be excluded and sentry-spring added as a dependency

Eventually at some point we will drop non-jakarta libraries but I assume it may take year(s) until all users migrate to Spring Boot 3 or migrate away from old application servers.

@tbroyer
Copy link

tbroyer commented Apr 11, 2022

Sentry currently is the only dependency holding me back on javax, for 3 classes and a total of 122 lines (excluding tests, but including imports and blank lines). In my case, due to other dependencies, this means using everything javax, holding me back on older versions of those other dependencies, meaning I cannot benefit from all their newer features.

What's the timeframe for 6.x? Should I wait with those older versions until 6.x is released? or just fork the lib in the mean time? (or use the Eclipse Transformer)

@bruno-garcia
Copy link
Member

The fact there are only 3 classes helps making this less priority to us as it's easy enough to unblock oneself by just vendoring-in the classes. But we discussed this and since servlet isn't changing much we'll just dupe all code into two packages as @maciejwalkowiak suggested above, creating sentry-servlet-jakarta. We'll aim to get this out in v6

For Spring and SB we'll need a bit more thinking as those have more things going on.

@marandaneto
Copy link
Contributor

@adinauer Should we close this issue since we have the other one to track Spring and Spring boot?
Docs for the new Jakarta package is live https://docs.sentry.io/platforms/java/guides/servlet/#jakarta-support

@adinauer
Copy link
Member

@marandaneto agreed, let's close this and figure out Spring and Spring Boot in #1984

Repository owner moved this from Needs Discussion to Done in Mobile & Cross Platform SDK Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

7 participants