[Jersey] Re: Jersey 2.2 Spring Integration issues

From: Daniel Kirkdorffer <>
Date: Mon, 19 Aug 2013 20:12:54 +0000 (UTC)

That seems messed up to me: if I'm configuring via XML I shouldn't need to use annotations for it to work. At least that's what I thought.

A little testing with that concept seems to indicate that @Inject on the setter is also enough for it to inject my dependency.

I've been testing the same behavior with RESTEasy and it appears that the handling of annotations, and the returning of my singleton instance is working correctly with RESTEasy's integration with Spring - so I know I'm not losing my mind. :^)


Daniel Kirkdorffer
----- Original Message -----
From: "Ivar" <>
Sent: Monday, August 19, 2013 12:53:24 PM
Subject: [Jersey] Re: Jersey 2.2 Spring Integration issues

Hi Dan,

I have also been struggling today to get the resources wired up with applicationContext.xml instead of annotations. I manged to achieve this after adding the " @Component" annotation to my resource. This makes jersey-spring3 ( to not create a new instance of the resource and instead reuse the one provided by spring.

I have put an example of this on github:

When it comes to your other questions about @Service and @Singleton annotations and new instances I have not got so far in my testing yet. Please respond back with more information if you gain any more knowledge.