title: Can't get Spring dependency Injection to work
body: <p>I'm pretty much a total beginner to Spring so don't assume that just because I didn't mention something I probably did it anyway.</p>
  
  <p>I'm trying to get dependency injection to work, I got a spring.xml with the following content: </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &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-2.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.1.xsd"&gt;
  
  &lt;context:annotation-config/&gt;
  &lt;bean id="connection" class="richo.project.ConnectionImpl"/&gt;
  &lt;/beans&gt;
  </code></pre>
  
  <p>and then in my code I have:</p>
  
  <pre><code>private IConnection conn;
  @Resource(name="connection")
  public void setConn(IConnection conn){
  this.conn = conn;
  }
  </code></pre>
  
  <p>and when I try to use the conn-object in my code I get a nullpointerexception</p>
  
  <p>Bear in mind that I don't actually know if spring is running, I'm using IntelliJ and it placed 13 spring related jar-files in my lib directory, but I can't really tell if Spring is even trying to inject anything</p>