title: @Configuration annotation causes IllegalArgumentException "is not an enhanced class"
body: <p>I'm rather new to Spring and I'm working with an old 3.2.4.RELEASE version of it inside a Jetty container.  I'm getting a rather odd error when I try to use component-scanner indicating that the @Configuration class I've set up is not an enhanced class:</p>
  
  <pre><code>Caused by: java.lang.IllegalArgumentException: class com.datasource.DBConfiguration$$EnhancerByCGLIB$$8a295c55 is not an enhanced class
  at org.springframework.cglib.proxy.Enhancer.setCallbacksHelper(Enhancer.java:621) ~[spring-core-3.2.4.RELEASE.jar:3.2.4.RELEASE]
  at org.springframework.cglib.proxy.Enhancer.registerStaticCallbacks(Enhancer.java:594) ~[spring-core-3.2.4.RELEASE.jar:3.2.4.RELEASE]
  at org.springframework.context.annotation.ConfigurationClassEnhancer.createClass(ConfigurationClassEnhancer.java:120) ~[spring-context-3.2.4.RELEASE.jar:3.2.4.RELEASE]
  at org.springframework.context.annotation.ConfigurationClassEnhancer.enhance(ConfigurationClassEnhancer.java:92) ~[spring-context-3.2.4.RELEASE.jar:3.2.4.RELEASE]
  at org.springframework.context.annotation.ConfigurationClassPostProcessor.enhanceConfigurationClasses(ConfigurationClassPostProcessor.java:356) ~[spring-context-3.2.4.RELEASE.jar:3.2.4.RELEASE]
  ... 78 common frames omitted
  </code></pre>
  
  <p>My spring beans file is on the classpath and looks like the following</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.xsd
      http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd"&gt;
  
  &lt;context:component-scan base-package="com.datasource" /&gt;&lt;/beans&gt;
  </code></pre>
  
  <p>The configuration class that I'm trying to setup looks like the following:</p>
  
  <pre><code>@Configuration
  public class DBConfiguration {
  
      @Bean
      public DataAccessInterface getDataAccessInterface(){
          return new DBDatasource();
      }
  }
  </code></pre>
  
  <p>The class that I want to inject the DBDatasource into looks like the following:</p>
  
  <pre><code>@Service
  public class DBService {
  
      private DataAccessInterface dai;
  
      @Autowired
      public DBService(DataAccessInterface dai){
          this.dai = dai;
      }
  }
  </code></pre>
  
  <p>What does the exception mean when it says that it is not an enhanced class? Am I not using component scan and the configuration annotation properly?</p>