-
Notifications
You must be signed in to change notification settings - Fork 95
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
Binding annotations aren't being consistently honored #91
Comments
Do you have an example I can use to reproduce this? |
No, I'll have to work on one. And since it's non-deterministic, I'm not sure what part of the complexity of my current setup might be related. |
Ok, I think I have a stand alone test. I ran this, hit both endpoints: http://localhost:8080/a/foo In my log output, I can see:
As you can see, the ModuleBApi got injected with the wrong string despite the binding annotation. Unless I'm doing something wrong with annotations? I crammed everything into one file, so hopefully this is easy for you to test:
|
I tried to file this with Guice, but they won't look at it because I'm using Dropwizard, so maybe this is the right place?
I have two modules, each provides an instance of the same class (a specific Gson configuration). So, each module has a method like so:
Then I have constructors for classes that use those Gson items, that look like:
This does NOT work consistently. Sometimes it injects the @moduleb version of Gson into things annotationed with @ModuleA.
I'm using Dropwizard 0.8.5 with dropwizard-guice 0.8.4 and Guice 4.1.
The text was updated successfully, but these errors were encountered: