-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Upgrade to jakarta-annotation-api, javax.annotation-api has been deprecated #21297
Comments
The issue had no activity for 30 days, mark with Stale label. |
What is the impact of the deprecated annotations library? In the Pulsar code base, there are some dependencies to javax libraries due to Jetty 9.4.x dependencies. It could be useful to first upgrade to Jetty 12 (#22939) and then migrating to use Jakarta annotations and libraries (Servlet) during that. |
To use this with Quarkus, you’ll need to add the following dependency: <!-- Use an alternative package because Quarkus excludes javax.annotation-api after build -->
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-annotations-api</artifactId>
</dependency> This is necessary because Although this isn’t a critical issue, I believe it may make it progressively more challenging to integrate admin-client with codebases over time. |
@michalcukierman what's the impact if you don't specify this library? do you get some error message or does something fail? Please share the possible error message to make it searchable. |
Jakarta migration dev mailing list thread: https://lists.apache.org/thread/dp2zkqxorqpwsjg2yjmmqgq4lrfst1r8 |
Without tomcat annotations-api, the exception is thrown at runtime:
This is happening, because I don't argue with the reasoning. |
@michalcukierman Thanks. It looks like it's jersey-client 2.42 which pulls in the annotation-api dependency:
We'd have to migrate to jersey-client 3.0.x or higher to get rid of the dependency. |
Actually that's already using jakarta.annotation-api. |
It looks like there are problems with the shading configuration of pulsar-client-all and pulsar-client-admin-shaded. There are transitive dependencies which should be shaded. This could be seen in the published pom.xml files (https://repo1.maven.org/maven2/org/apache/pulsar/pulsar-client-all/4.0.0/pulsar-client-all-4.0.0.pom and https://repo1.maven.org/maven2/org/apache/pulsar/pulsar-client-admin/4.0.0/pulsar-client-admin-4.0.0.pom). |
Yes, but in version 1.x the jakarta annotation api is still using the javax package :). Regarding the shading configuration: I've taken a look at the |
@lhotari I would happily contribute a PR for this, but right now I'm still not sure what the desired outcome of the shading configuration is exactly. Also, can you maybe remove the |
I have recently worked on moving Starlight for JMS to the Jakarta packages and I had many problems due to this issue (and the users have to import the old package anyway) |
@cortlepp There are multiple issue. I created #23646 to address one of the problems. |
New attempt to address this in #23647 |
#23647 is now ready for review. It will address also this issue about javax.annotation-api . I addressed many inconsistencies in shading and addressed them. I was also surprised to find out that there are only small differences between pulsar-client-admin (shaded) and pulsar-client-all. pulsar-client-admin also includes the shaded pulsar-client, not just the admin client. |
Thank you! I only got to have a look at the PR just now, but at least from first glance it looks like this will resolve my issues. |
Resolved by #23647 |
Search before asking
Motivation
It seems like Pulsar, (especially Pulsar Admin Client) still depends on javax.annotation-api 1.3.2, which has been archived, deprecated and replaced by jakarta-annotation-api. This can block the future libraries upgrade and make it complicated to integrate with new framworks/libraries, due to classloading issues.
Observed on using Pulsar Admin Client with Quarkus.
Solution
Upgrade to jakarta-annotation-api, which is also used by transitive dependencies.
The source code can be found here: https://github.com/eclipse-ee4j/common-annotations-api
Alternatives
Not a long-term solution, but we could stick with javax.annotation-api for a while. Sooner or later we need to upgrade.
Anything else?
No response
Are you willing to submit a PR?
The text was updated successfully, but these errors were encountered: