Comments (9)
Thank you. I see the problem. Do you mind if I incorporate your Test into the fix?
from jersey2-guice.
No problem.
I have done a little debugging and it seems that Guice annotation type gets lost in GuiceBinder line 81
from jersey2-guice.
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.
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.
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.
Sorry, I have understood now: "at-Other isn't a JSR-330 Qualifier."
Please ignore my last comment and commit
from jersey2-guice.
Adding this fixes the problem:
Basically, you want to instantiate your HelloResource resource with Guice and not with HK2.
from jersey2-guice.
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.
Done
from jersey2-guice.
Related Issues (20)
- base path HOT 3
- Getting a ServletContext HOT 3
- AOP requires registration in two places HOT 4
- JerseyGuiceServletContextListener uses constructor to Initialize injector HOT 1
- Custom scopes are not mapped to hk2 scopes HOT 4
- @Qualifier / @BindingAnnotation annotated dependencies are not being injected into hk2 created services
- How to get custom @Context injections? HOT 1
- 0.8 relies on guice 4.0-SNAPSHOT HOT 5
- Guice scope annotations are ignored HOT 1
- jersey2-guice, Jersey 2.16 and uber-jar HOT 2
- Error injecting constructor, java.lang.IllegalStateException HOT 2
- java.lang.IllegalStateException: ServiceLocatorImpl(GuiceServiceLocator-9,8,1066656936) has been shut down HOT 10
- Lazily construct the Injector in JerseyGuiceServletContextListener so that modules can be added at runtime HOT 1
- Guice binding annotations not working HOT 10
- Guice type conversions for constant bindings don't work for primitive types HOT 2
- java.lang.IllegalStateException: java.lang.NoSuchFieldException: defaultGenerator HOT 1
- It appears jersey2-guice-spi is either not present or in conflict with some other Jar HOT 4
- Does not work with embedded jetty HOT 4
- OSGi manifest
- Jersey 2.26 compatibility HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jersey2-guice.