Answering my own question here:
Don't use register in RestConfig. Instead create an AbstractBinder with the
service to inject.
register( new AbstractBinder() {
@Override
protected void configure() {
bind( MyServiceImpl.class ).to( MyService.class );
}
});
On Fri, Mar 7, 2014 at 2:45 PM, Robert DiFalco <robert.difalco_at_gmail.com>wrote:
> How do I make a service available for injection with Jersey 2.6?
>
> I simply want to have something like:
>
> @Inject
> private MyService service;
>
> In a resource. I assumed in my configuration I could just do this:
>
> register( MyService.class );
>
> But apparently that doesn't work. What's the simplest way to make
> MyResource @Inject-able with MyService in 2.6?
>
> TIA!
>
> R.
>