GithubHelp home page GithubHelp logo

Comments (9)

rkapsi avatar rkapsi commented on June 4, 2024

Thank you. I see the problem. Do you mind if I incorporate your Test into the fix?

from jersey2-guice.

abrandimarti avatar abrandimarti commented on June 4, 2024

No problem.

I have done a little debugging and it seems that Guice annotation type gets lost in GuiceBinder line 81

from jersey2-guice.

rkapsi avatar rkapsi commented on June 4, 2024

ServiceLocatorImpl lines 532-535

Guice's BindingAnnotation is not a JSR-330 Qualifier and HK2 ignores it. There is a Descriptor cache and it ends up using the GuiceBinder for the plain HelloService.

from jersey2-guice.

rkapsi avatar rkapsi commented on June 4, 2024

And you're correct as well. The at-Other annotation gets lost in GuiceBinder. But that's because at-Other isn't a JSR-330 Qualifier.

from jersey2-guice.

abrandimarti avatar abrandimarti commented on June 4, 2024

I have added a new commit on my pull request. It's only an attempt that tries to fix the at-Other testcase.

Unfortunately it uses Guice internal static method Annotations.generateAnnotation(). This method has a precondition that the annotation must have methods with a default value. I wonder if Guice check Annotations.isAllDefaultMethods() should return true also in the case that the annotations has no methods?

By the way, it would be nice to have Travis to pass Gradle --continue to see all failures

Thanks
Alessandro

from jersey2-guice.

abrandimarti avatar abrandimarti commented on June 4, 2024

Sorry, I have understood now: "at-Other isn't a JSR-330 Qualifier."
Please ignore my last comment and commit

from jersey2-guice.

rkapsi avatar rkapsi commented on June 4, 2024

Adding this fixes the problem:

3eb788d

Basically, you want to instantiate your HelloResource resource with Guice and not with HK2.

from jersey2-guice.

abrandimarti avatar abrandimarti commented on June 4, 2024

Thanks Roger. I have tested 0.5-SNAPSHOT on my project and it works correctly.
Any chance to release 0.5 soon?

from jersey2-guice.

rkapsi avatar rkapsi commented on June 4, 2024

Done

from jersey2-guice.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.