users@jersey.java.net

[Jersey] Re: [JERSEY2.2] Injecting a Spring beans in Jersey resources / exception manager

From: Ivar <ivarconr_at_gmail.com>
Date: Fri, 23 Aug 2013 16:58:48 +0200

Hi again,

you are absolutely right. The only way I am able to have other services
injected to a provider is through the @Autowired/_at_Inject annotation. This
is even working without using component-scanning in spring, so it has to be
the "jersey-spring3" module actually injecting the dependencies.

I looks to me, after testing a lot, that the "jersey-spring3" module is
kind of buggy, and your best bet it to rely on annotation's for injecting
dependencies. You can limit the auto-wiring to only be used inside
providers with external dependencies.

Hopefully the developers of the jersey-spring3 project will add support for
controlling everything through manual wiring in the future.

Maybe you should open an issue for this?


Ivar