java - Jersey 2.*. Custom InjectionResolver and "A HTTP GET method ... should not consume any entity" -
i have followed michal's guide answer question [1] on implementing custom annotation injecting arbitrary things resource methods. (gist) [2] contains minimalistic testbed adapted jersey-quickstart-grizzly2
archetype. refer in following text.
i encountered few problems:
my resolver parametrized type (or @ least make things more cleaner, in opinion) , can not
bind
in binder way michal suggests.// instead of suggested: // bind(myinjectionresolver.class).to(new typeliteral<injectionresolver<myannotation>>() {}).in(singleton.class); // do: bind(myinjectionresolverobject).to(new typeliteral<injectionresolver<myannotation>>() {});
when use
myannotation
in resource method, following warning on server start-up (but server still starts):warning: following warnings have been detected: warning: http method, public java.lang.string com.example.myresource.get02(java.lang.integer,java.lang.string), should not consume entity.
when request resource (
curl -x http://localhost:8080/myresource/01/aa
),02: value = aa; providedvalue = null
instead of expected02: value = aa; providedvalue = 123
.the
myresolver.resolve
method never executed (butmybinder.configure
executed).(this not concern testbed application, encounter problem in more complicated code: resource method never executed , server responds
500 no content map object due end of input
)
any ideas might doing wrong?
Comments
Post a Comment