title: Spring Boot, @Autowire into an unmanaged class using @Configurable and load time weaving
body: <p>I have a collection of unmanaged classes that I are instantiated outside of Spring. I've been attempting to use Spring AOP with load time weaving to <code>@Autowire</code> a bean into these classes but have so far not had any luck. </p>
  
  <p>I've been testing using Tomcat 8 and Spring Boot 1.2.0.</p>
  
  <p>My <code>@Configuration</code> where I attempt to set up class looks like this:</p>
  
  <pre><code>@Configuration
  @PropertySource("classpath:application.properties")
  @EnableSpringConfigured
  @EnableLoadTimeWeaving
  public class Config
  </code></pre>
  
  <p>Inside <code>Config</code> I define the bean I want to <code>@Auotwire</code> into my unmanaged classes:</p>
  
  <pre><code>@Bean
  public StateProvider stateProvider() {
      //setup bean
      return new DynamoStateProviderImpl( );
  }
  </code></pre>
  
  <p>The unmanaged bean looks like this:</p>
  
  <pre><code>@Configurable(autowire = Autowire.BY_TYPE, dependencyCheck = true,   preConstruction = true)
  public class StateOutput implements UnifiedOutput {
  
  @Autowired
  private StateProvider stateProvider;
  </code></pre>
  
  <p>And I have the following deps inside my pom</p>
  
  <pre><code>    &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-agent&lt;/artifactId&gt;
          &lt;version&gt;2.5.6.SEC03&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-tx&lt;/artifactId&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-aop&lt;/artifactId&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-aspects&lt;/artifactId&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;javax.el&lt;/groupId&gt;
          &lt;artifactId&gt;javax.el-api&lt;/artifactId&gt;
          &lt;version&gt;3.0.0&lt;/version&gt;
      &lt;/dependency&gt;
  </code></pre>
  
  <p>So far, I have not been able to see anything injected into <code>stateProvider</code> or been able to pull any info from the logs. I've also attempted setter style injection using </p>
  
  <pre><code>@Autowired
  public void setStateProvider(StateProvider stateProvider){
      this.stateProvider = stateProvider;
  }
  </code></pre>
  
  <p>Thanks</p>