dropwizard-guicier
dropwizard-guicier copied to clipboard
@BeanParam Values not being populated
I have a GET resource that accepts a @BeanParam
object with two @QueryParam
strings. The bean object appears to be being instantiated by Guice and hydration of the query parameters is not occurring.
In the same project, I have a POST resource that accepts an object which uses @JsonProperty
to populate the values. That appears to be working as expected (the JSON us being serialized in to the object properly).
Pushed an example project https://github.com/jcampos8782/broken-beans Confirmed that this is not reproducible without the GuiceBundle.
I can confirm this bug, did a little research a few days ago and found these issues: https://java.net/jira/browse/HK2-300 https://java.net/jira/browse/JERSEY-3119
With rolling back to dw v0.9.3 and guicier v0.9.1.0 you get it working again.
Is there a ETA for the next release of DropWizard with Jersey 2.23.2 & HK2 2.5.0-b06 , which claimed to have the fix?
My guess is that the issue is not related to "droopwizard-guicer" only, as far as it's observed for "dropwizard-guice" too: https://github.com/HubSpot/dropwizard-guice/issues/93 I also have created a project to demonstrate it: https://github.com/medvedev/beanparam-jersey-guice This comment explains the details of issue: https://github.com/HubSpot/dropwizard-guice/issues/93#issuecomment-251767171
Update: With jersey 2.25 and hk 2.5.0-b30 @BeanParam values are still not populated, as shown in my demo project.
Any idea when a new version might be released with a fix for this issue? I am encountering this in my project, where using the BeanParam annotation in association with QueryParams results in a empty object.
I am using DropWizard v1.0.5 and DropWizard Guicier v1.0.0.6.
Downgrading hk2-locator and hk2-api to 2.4.0-b31 works (the version used by the latest dropwizard-guicier where this still works). 2.4.0-b33 also works. So 2.4.0-b34 broke it. I'm looking at the differences with https://github.com/javaee/hk2/compare/2.4.0-b33...2.4.0-b34 ... Trying to find something. It links to https://java.net/jira/browse/HK2-170 which is a dead link. Anyone that can help me find the original jira? @ljnelson maybe you can help?
When it works, it's because there's a descriptor found in hk2 so the BeanParam object is created by hk2. When it's not working there's no descriptor found in hk2 and it falls back to try to create it with guice.
Was this fixed? Is there an "official" fix? I'm quite puzzled about what to do with this issue to keep it future proof.
This is still broken for me in guicier 1.0.0.6
Hello Guys, any updates on this?
I gave up on this a long while ago and ditched it for the much more flexible https://www.ninjaframework.org/