rest - org.glassfish.hk2.api.UnsatisfiedDependencyException: There was no object available for injection at SystemInjecteeImpl -


i tried building sample restful app using jersey 2.0/ hk2. initial commit (as seen @ https://github.com/venkatramachandran/restful-sample-tomcat/commit/6e5ee ) should have worked, given class injected annotated @service. did not.

i created second commit ( https://github.com/venkatramachandran/restful-sample-tomcat/commit/2ca30f ) org.glassfish.jersey.server.resourceconfig instance registers instance of org.glassfish.hk2.utilities.binding.abstractbinder. binder binds @contract @service same class.

my question is, binder absolutely necessary hk2 work? or did miss configuration in initial commit causing org.glassfish.hk2.api.unsatisfieddependencyexception ?

yes, need perform sort of binding hk2 work standard @service this. prevent having bind services within jersey might want consider bridging external servicelocator in order supply service though, outlined in this question.

and of course best practice @contracts interfaces, although not mandatory.


Comments

Popular posts from this blog

apache - PHP Soap issue while content length is larger -

asynchronous - Python asyncio task got bad yield -

javascript - Complete OpenIDConnect auth when requesting via Ajax -