title: Why is Spring not wiring my @Autowired members in a dependent jar?
body: <p>I'm building a Google App Engine app using Spring 3.1 and am having a problem getting members in one of my jars wired.  </p>
  
  <p>I have three projects:</p>
  
  <ol>
  <li><code>server</code></li>
  <li><code>server.model</code></li>
  <li><code>server.persistence</code></li>
  </ol>
  
  <p>I have an ant build script so that when my workspace builds, it creates jars for <code>server.model</code> and <code>server.persistence</code>, and puts them in the correct lib directory for the <code>server</code> project.</p>
  
  <p>In <code>server</code>, I can autowire things from both <code>server.model</code> and <code>server.persistence</code>, but in <code>server.model</code> my <code>server.persistence</code> beans aren't getting wired even though they're the exact same as in <code>server</code>.  </p>
  
  <p>snippet from my servlet application config:</p>
  
  <pre><code>&lt;context:component-scan base-package="com.impersonal.server"/&gt;          
  
  &lt;bean autowire="byType" id="appEngineDataStore" class="com.impersonal.server.persistance.AppEngineDataStore"/&gt;
  
  &lt;bean autowire="byType" id="userList" class="com.impersonal.server.model.UserList"/&gt;
  </code></pre>
  
  <p>I have the following code in both the <code>server</code> project and the <code>server.model</code> project, and only the server one gets fulfilled.  Here's the one failing:</p>
  
  <pre><code>package com.impersonal.server.model;
  
  import java.util.ArrayList;
  import java.util.UUID;
  
  import org.springframework.beans.factory.annotation.Autowired;
  
  import com.impersonal.server.persistance.AppEngineDataStore;
  import com.impersonal.server.persistance.IDataStore;
  
  public class UserList extends ArrayList&lt;User&gt;
  {
      private UserList(){}
  
  //this is always null, but the same line in a class in the other project works
  private @Autowired AppEngineDataStore _dataStore;
  
  public UserList(UUID userId, String tempId)
  {
      String poo = "poo";
      poo.concat("foo ");
  
      int i = 3;
  }
  }
  </code></pre>
  
  <p><strong>Edit:</strong>
  Just did a test in the <code>server.model</code> project trying to @Autowired something that I don't have defined as a bean in my application config, and didn't get any errors.  I should have got a 'no such bean found' error like I do if I do the same thing for the <code>server</code> project.</p>
  
  <p>Any ideas why?</p>