users@jersey.java.net

Spring and XmlWebApplicationContext

From: <mailinglist_at_j-b-s.de>
Date: Wed, 04 Mar 2009 12:08:32 +0100

Hi!

I am new to Jersey and got a problem concerning "@Inject" of spring beans in my Jersey sample app. We use our own Web app context class which is directly derived from Springs XmlWebApplicationContext. When the application starts the context gets properly initialized so it is not a problem of the web.xml (well, it looks like not to be :-).
...
<context-param>
  <param-name>contextClass</param-name>
  <param-value>testpackage.SpringServiceApplicationContext</param-value>
</context-param>
...
so using this entry in web.xml the spring context is initialized.


Unfortunately no call from Jersey to one of the getBean methods happens, so it seems the @Inject is silently ignored. Can anyone give me a litte hint or point my in the right direction? Is there a special prop/setting where I can tell jersey to map "@inject" to "please use the SpringServiceApplicationContext" to retrieve the beans?


Thanks in advance

Jens