Skip to content

Support for jakarta annotationsΒ #1490

Closed as not planned
Closed as not planned

Description

@hejcz

Do you have any time estimations for supporting jakarta.* annotations? We want to migrate to Jersey 3 but it's impossible because GuiceFilter implements javax.servlet.Filter. Another problem is #1383.

Activity

  1. kashike commented on Feb 19, 2021

    @kashike
    Contributor
  2. hejcz commented on Feb 19, 2021

    @hejcz
    Author

    #1383 mentions only jakarta.inject so I don't know if it adresses the same scope of changes.

  3. GedMarc commented on Feb 19, 2021

    @GedMarc

    You can also use
    https://search.maven.org/artifact/com.guicedee.services/guice

    which is a compiled guice (from master branch/5) with all references on jakarta -

  4. nsoft commented on Jul 27, 2021

    @nsoft

    I have a "quickfix" support for this which was done by the ugly but expedient strategy of copying a bunch of classes into new packages and editing them, not guaranteed to work for everything, and I'm not committing maintaining it, but my Shiro/Guice integrated application seems to be running fine with it on Tomcat 10. https://github.com/nsoft/guice/commits/jakarta-servlet. guicedee is probably great, but if you have things other than your own code that depend on guice in your stack, it's not really an option. (shiro 1.8 hacked to use my fork of guice is here: https://github.com/nsoft/shiro/tree/SHIRO-814_1_8)

    Posting these mostly to encourage the Guice maintainers to do something about this.

  5. onacit commented on Feb 9, 2022

    @onacit

    @GedMarc Check this out, yo.

  6. docent commented on May 11, 2022

    @docent

    Bumping this for visibility. We have to recompile Guice in order to move to to the new jakarta.inject and jakarta.servlet packages. Not ideal...

  7. kbarczynski-rtbh commented on Aug 31, 2022

    @kbarczynski-rtbh

    Logback switched from javax.servlet-api to jakarta.servlet-api in version 1.4.0.
    We have guice 5.1.0 which (still) doesn't have support for jakarta.servlet-api.
    It basically means we're blocked with upgrading to the newer logback.

    Could we somehow fix the World? πŸ˜„

  8. froque commented on Aug 31, 2022

    @froque

    @krisso-rtb there is logback 1.3 to solve that problem https://logback.qos.ch/news.html

    But your point remains, the lack of Jakarta support in Guice is a show stopper for us

  9. ben-manes commented on Sep 28, 2022

    @ben-manes

    @sameb could we get something simple and low effort to be forward compatible? Maybe a new extension, guice-jakarta-servlet, that forks the old one with the updated imports? I don't think the community is asking for much, just a little support so that we can update our http servlet engines (tomcat, jetty, etc).

  10. sameb commented on Sep 28, 2022

    @sameb
    Member
  11. ben-manes commented on Sep 29, 2022

    @ben-manes

    I don't think there is an ask for on going maintenance beyond what is done today. The existing extension is perfect. The problem is that Eclipse hard forked the namespace and forced the community to transition from javax to jakarta so that they did not have to participate in JEP / JCP (an IBM vs Oracle tantrum). In that transition all that is required is a find-and-replace of the import.

    Since Guice is still broadly used but lacks an active community having something in core is useful for trust reasons. A random github user's non-discoverable, unmaintained dependency is not as attractive as a frozen Google dependency. Otherwise it's a forcing function to drop Guice externally to Google, so just a tiny bit of help would keep this excellent library alive for us otherwise very happy users (e.g. see #1630 where the work was done).

  12. sameb commented on Sep 29, 2022

    @sameb
    Member

    Ugh, what a horrible mess. Silly IBM.

    The proposed pull request is both invasive (on the core guice side), and a huge pit of code duplication (on the servlet extension side).

    For servlet, I honestly think the best outcome is for someone else to create and host it. I'd be happy to point to it from any "official" docs. But us bundling it seems like a bad idea. The existing servlet extension already has bugs, and we don't really maintain it except for keeping it compiling. Someone could probably fork it and make it much better already. I'm loathe to copy/paste and search/replace a large swathe of code, especially when it will have zero ongoing usages that we can validate.

    As for the annotation/provider support... it adds a bunch of SPI classes and API methods. It's not all that appealing.

    @mcculls -- what are y'all doing with Maven? Is this impacting you?

    Let me talk to a few folks internally and see what the deal is. I imagine this impacts Dagger too?

    What a gross situation.

  13. techwhizbang commented on Dec 22, 2022

    @techwhizbang

    To echo what others have said our team recently went to upgrade from Jetty 9.x to Jetty 11.x. We realized that we were blocked because the newer Jetty depends on the new jakarta.servlet-api and Guice is using the older javax.servlet API.

    A large swath of the most widely used libraries in the Java community have moved on and have adopted jakarta.servlet-api. Some well known projects that use the servlet APIs maintained two versions during the transition pointing at the old and new servlet API. Honestly though when you look at the adoption it becomes clearer there is no looking back.

    As this continues to shake out can the Guice community get a version of Guice servlet extension with jakarta.servlet-api(one that isn't forked)?

    What a lovely Christmas present this would be πŸŽ„πŸŽ… πŸ˜„

  14. ryru commented on Mar 6, 2023

    @ryru

    We can't update to Tomcat 10 at the moment because Guice still has dependencies on javax.servlet.*. As others have pointed out, a Guice fork is not an option for us.

    @sameb, any news from the internal team?

  15. ben-manes commented on Mar 6, 2023

    @ben-manes

    fwiw, for gradle users we can maybe use gradle-jakartaee-migration-plugin as a stop gap. I haven't tried it yet.

  16. JKomoroski commented on Apr 17, 2023

    @JKomoroski

    There is also this option: #1383 (comment)

  17. sameb commented on Apr 25, 2023

    @sameb
    Member

    Duplicate of #1383

  18. marked this as a duplicate ofΒ jakarta.inject support #1383 on Apr 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions