title: @Autowired does not work Spring 3
body: <p>I looked all around to find a solution and couldn't find.</p>
  
  <p>I am using Tomcat, Spring 3 with the jars: </p>
  
  <pre><code>org.springframework.aop-3.0.5.RELEASE.jar
  org.springframework.asm-3.0.5.RELEASE.jar
  org.springframework.beans-3.0.5.RELEASE.jar
  org.springframework.context-3.0.5.RELEASE.jar
  org.springframework.core-3.0.5.RELEASE.jar
  org.springframework.expression-3.0.5.RELEASE.jar
  org.springframework.jdbc-3.0.5.RELEASE.jar
  org.springframework.orm-3.0.5.RELEASE.jar
  org.springframework.test-3.0.5.RELEASE.jar
  org.springframework.transaction-3.0.5.RELEASE.jar
  org.springframework.web-3.0.5.RELEASE.jar
  </code></pre>
  
  <p>and my code is like this:</p>
  
  <pre><code>public class EmailResource {
  @Autowired
  EmailManager emailManager;
  }
  </code></pre>
  
  <p>in applicationContext I have:</p>
  
  <pre><code>&lt;beans xmlns="http://www.springframework.org/schema/beans"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
  xsi:schemaLocation="http://www.springframework.org/schema/beans
  http://www.springframework.org/schema/beans/spring-beans.xsd
  http://www.springframework.org/schema/context
  http://www.springframework.org/schema/context/spring-context.xsd"&gt;
  
  &lt;bean
      class="org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor" /&gt;
  &lt;bean id="emailManager" class="com.mycompany.manager.impl.EmailManagerImpl" /&gt;
  &lt;context:component-scan base-package="com.mycompany.component" /&gt;
  </code></pre>
  
  <p></p>
  
  <p>and the web.xml:</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
      http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"&gt;
  
  
      &lt;context-param&gt;
          &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
          &lt;param-value&gt;classpath:/applicationContext.xml&lt;/param-value&gt;
      &lt;/context-param&gt;
  
  
      &lt;listener&gt;
          &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt;
      &lt;/listener&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p>However, the emailManager is always null! What am I missing?</p>
  
  <p><strong>EDITED</strong></p>
  
  <p>The EmailResource is jersey servlet for rest calls and is defined like this:</p>
  
  <pre><code>&lt;servlet&gt;
      &lt;servlet-name&gt;Jersey Web Application&lt;/servlet-name&gt;
      &lt;servlet-class&gt;com.sun.jersey.spi.container.servlet.ServletContainer&lt;/servlet-class&gt;
      &lt;init-param&gt;
          &lt;param-name&gt;com.sun.jersey.config.property.packages&lt;/param-name&gt;
          &lt;param-value&gt;com.mycompany.resource&lt;/param-value&gt;
      &lt;/init-param&gt;
      &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
  &lt;/servlet&gt;
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;Jersey Web Application&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/api/*&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  </code></pre>