title: Error upgrading Grails from 2.1.1 to 2.4.3: java.lang.NoClassDefFoundError: org/springframework/aop/framework/AopInfrastructureBean
body: <p>I was upgrading my grails application from version 2.1.1 to 2.4.3 but i got the error info as below:</p>
  
  <pre><code>| Compiling 405 source files.
  | Error Compilation error: startup failed:
  General error during conversion: java.lang.NoClassDefFoundError: org/springframework/aop/framework/AopInfrastructureBean
  
  java.lang.RuntimeException: java.lang.NoClassDefFoundError: org/springframework/aop/framework/AopInfrastructureBean
      at org.codehaus.groovy.control.CompilationUnit.convertUncaughtExceptionToCompilationError(CompilationUnit.java:1083)
      at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1061)
      at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:583)
      at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:561)
      at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:538)
      at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:517)
      at org.codehaus.groovy.tools.FileSystemCompiler.compile(FileSystemCompiler.java:59)
      at org.codehaus.groovy.tools.FileSystemCompiler.doCompilation(FileSystemCompiler.java:215)
      at org.codehaus.groovy.ant.Groovyc.runCompiler(Groovyc.java:1161)
      at org.codehaus.groovy.ant.Groovyc.compile(Groovyc.java:1212)
      at org.codehaus.groovy.grails.compiler.Grailsc.compile(Grailsc.java:78)
      at org.codehaus.groovy.ant.Groovyc.execute(Groovyc.java:827)
      at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
      at sun.reflect.GeneratedMethodAccessor43.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:483)
      at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
      at groovy.util.AntBuilder.performTask(AntBuilder.java:319)
      at groovy.util.AntBuilder.nodeCompleted(AntBuilder.java:264)
      at groovy.util.BuilderSupport.doInvokeMethod(BuilderSupport.java:147)
      at groovy.util.AntBuilder.doInvokeMethod(AntBuilder.java:203)
      at groovy.util.BuilderSupport.invokeMethod(BuilderSupport.java:64)
      at org.codehaus.gant.GantBuilder.invokeMethod(GantBuilder.java:99)
      at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:45)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:120)
  ...
  ...
  ...
  ...
  ...
  org.codehaus.groovy.tools.javac.JavaAwareCompilationUnit$1.call(JavaAwareCompilationUnit.java:67)
      at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1047)
      ... 565 more
  Caused by: java.lang.ClassNotFoundException: org.springframework.aop.framework.AopInfrastructureBean
      at org.codehaus.groovy.tools.RootLoader.findClass(RootLoader.java:175)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
      at org.codehaus.groovy.tools.RootLoader.loadClass(RootLoader.java:147)
      at org.codehaus.groovy.grails.cli.support.GrailsRootLoader.loadClass(GrailsRootLoader.java:51)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
      ... 589 more
  
  1 error
  </code></pre>
  
  <p>Build Config file:</p>
  
  <pre><code>grails.servlet.version = "2.5"
  grails.project.class.dir = "target/classes"
  grails.project.test.class.dir = "target/test-classes"
  grails.project.test.reports.dir = "target/test-reports"
  grails.project.target.level = 1.6
  grails.project.source.level = 1.6
  //grails.project.war.file = "target/${appName}-${appVersion}.war"
  grails.project.dependency.resolution = {
      // inherit Grails' default dependencies
      inherits("global") {
          // uncomment to disable ehcache
          // excludes 'ehcache'
      }
      log "warn" // log level of Ivy resolver, either 'error', 'warn', 'info', 'debug' or 'verbose'
      repositories {
          inherits true
  
          grailsPlugins()
          grailsHome()
          grailsCentral()
  
          // uncomment the below to enable remote dependency resolution
          // from public Maven repositories
          mavenLocal()
          mavenCentral()
          //mavenRepo "http://snapshots.repository.codehaus.org"
          //mavenRepo "http://repository.codehaus.org"
          mavenRepo "http://download.java.net/maven/2/"
          //mavenRepo "http://repository.jboss.com/maven2/"
          mavenRepo "http://repository.springsource.com/maven/bundles/release"
          mavenRepo "http://repository.springsource.com/maven/bundles/external"
      }
      dependencies {
          // specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes eg.
  
          runtime 'mysql:mysql-connector-java:5.1.20'
          compile "javax.mail:mail:1.4.3"
          runtime "org.springframework:spring-test:4.0.6.RELEASE" 
      }
  
      plugins {
          runtime ":hibernate4:4.3.5.5" // or ":hibernate:3.6.10.17"
          runtime ":jquery:1.8.0"
          runtime ":resources:1.1.6"
          build ":tomcat:7.0.55"
          runtime ":database-migration:1.4.0"
          compile ":cache:1.1.8"
          compile ":mail:1.0.7"
          compile ":spring-security-core:2.0-RC4"
          compile ":searchable:0.6.9"
          compile ":yui:2.8.2.1"
      }
  }
  </code></pre>
  
  <p>I almost updated most of the plugins to the latest version, e.g. <code>:spring-security-core:2.0-RC4</code></p>
  
  <p>I also found an issue in grails's official jira, which describe the same problem as mine:
  <a href="https://jira.grails.org/browse/GPSPRINGSECURITYUI-62" rel="nofollow">https://jira.grails.org/browse/GPSPRINGSECURITYUI-62</a></p>
  
  <p>I don't know if it's still a bug which is not solved yet?</p>