java - 将 Grails 应用程序从 2.2 升级到 2.4 时出错

标签 java spring grails

我正在将我的 grails 应用程序从版本 2.2 升级到 2.4,并获得下面列出的堆栈跟踪。我在 grails jira 错误跟踪中发现了一个案例,并且该问题仍然悬而未决。

https://jira.grails.org/browse/GRAILS-11441

有谁知道我可以做些什么吗?或者,这是否意味着在解决此问题之前我无法完成升级?

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:1104)
    at org.codehaus.groovy.ant.Groovyc.compile(Groovyc.java:1155)
    at org.codehaus.groovy.grails.compiler.Grailsc.compile(Grailsc.java:78)
    at org.codehaus.groovy.ant.Groovyc.execute(Groovyc.java:770)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
    at sun.reflect.GeneratedMethodAccessor85.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1270)
    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)
    at org.codehaus.groovy.grails.project.compiler.GrailsProjectCompiler.compilePluginSources(GrailsProjectCompiler.groovy:378)
    at org.codehaus.groovy.grails.project.compiler.GrailsProjectCompiler.this$3$compilePluginSources(GrailsProjectCompiler.groovy)
    at org.codehaus.groovy.grails.project.compiler.GrailsProjectCompiler$this$3$compilePluginSources$3.callCurrent(Unknown Source)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:49)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:145)
    at org.codehaus.groovy.grails.project.compiler.GrailsProjectCompiler.compilePlugins(GrailsProjectCompiler.groovy:346)
    at org.codehaus.groovy.grails.project.compiler.GrailsProjectCompiler$compilePlugins$2.callCurrent(Unknown Source)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:49)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
    at org.codehaus.groovy.grails.project.compiler.GrailsProjectCompiler.compilePlugins(GrailsProjectCompiler.groovy:312)
    at org.codehaus.groovy.grails.project.compiler.GrailsProjectCompiler$compilePlugins$1.call(Unknown Source)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:112)
    at _GrailsCompile$_run_closure3_closure8_closure9.doCall(_GrailsCompile.groovy:61)
    at _GrailsCompile$_run_closure3_closure8_closure9.doCall(_GrailsCompile.groovy)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1270)
    at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:207)
    at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.call(PogoMetaMethodSite.java:68)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:112)
    at _GrailsCompile.withCompilationErrorHandling(_GrailsCompile.groovy:68)
    at _GrailsCompile.this$4$withCompilationErrorHandling(_GrailsCompile.groovy)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1270)
    at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
    at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1085)
    at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:909)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1030)
    at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:909)
    at groovy.lang.DelegatingMetaClass.invokeMethod(DelegatingMetaClass.java:149)
    at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133)
    at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:168)
    at groovy.lang.GroovyObjectSupport.invokeMethod(GroovyObjectSupport.java:44)
    at groovy.lang.MetaClassImpl.invokeMethodOnGroovyObject(MetaClassImpl.java:1150)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1044)
    at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:909)
    at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:66)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:49)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
    at _GrailsCompile$_run_closure3_closure8.doCall(_GrailsCompile.groovy:60)
    at _GrailsCompile$_run_closure3_closure8.doCall(_GrailsCompile.groovy)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1270)
    at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
    at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1085)
    at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:909)
    at groovy.lang.Closure.call(Closure.java:423)
    at groovy.lang.Closure.call(Closure.java:417)
    at org.codehaus.groovy.grails.cli.api.BaseSettingsApi.profile(BaseSettingsApi.java:342)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1270)
    at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
    at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1085)
    at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:952)
    at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:909)
    at groovy.lang.MetaClassImpl.invokePropertyOrMissing(MetaClassImpl.java:1131)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1087)
    at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:909)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:730)
    at groovy.lang.GroovyObjectSupport.invokeMethod(GroovyObjectSupport.java:44)
    at groovy.lang.Script.invokeMethod(Script.java:78)
    at groovy.lang.MetaClassImpl.invokeMethodOnGroovyObject(MetaClassImpl.java:1150)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1044)
    at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:909)
    at groovy.lang.DelegatingMetaClass.invokeMethod(DelegatingMetaClass.java:149)
    at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133)
    at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:66)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:49)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:145)
    at _GrailsCompile$_run_closure3.doCall(_GrailsCompile.groovy:57)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

构建配置文件:

grails.servlet.version = "2.5" // Change depending on target container compliance (2.5 or 3.0)
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"

// uncomment (and adjust settings) to fork the JVM to isolate classpaths
//grails.project.fork = [
//   run: [maxMemory:1024, minMemory:64, debug:false, maxPerm:256]
//]

grails.project.dependency.resolution = {
    // inherit Grails' default dependencies
    inherits("global") {
        // specify dependency exclusions here; for example, uncomment this to disable ehcache:
        // excludes 'ehcache'
    }
    log "warn" // log level of Ivy resolver, either 'error', 'warn', 'info', 'debug' or 'verbose'
    checksums true // Whether to verify checksums on resolve
    legacyResolve false // whether to do a secondary resolve on plugin installation, not advised and here for backwards compatibility

    repositories {
        inherits true // Whether to inherit repository definitions from plugins

        grailsPlugins()
        grailsHome()
        grailsCentral()

        mavenLocal()
        mavenCentral()

        // uncomment these (or add new ones) to enable remote dependency resolution from public Maven repositories
        //mavenRepo "http://snapshots.repository.codehaus.org"
        //mavenRepo "http://repository.codehaus.org"
        //mavenRepo "http://download.java.net/maven/2/"
        //mavenRepo "http://repository.jboss.com/maven2/"
    }

    dependencies {
        // specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes e.g.

        // Allows connecting to MySQL DBs
        runtime 'mysql:mysql-connector-java:5.1.22'

        // For JodaTime plugin
        compile "org.jadira.usertype:usertype.jodatime:1.9.1"

        // So that spock can work with Grails 2.2
        test "org.spockframework:spock-grails-support:0.7-groovy-2.0"

        // Fix for a missing class
        compile "net.bull.javamelody:javamelody-core:1.43.0"
    }

    plugins {
        // Server
        build ':tomcat:7.0.53'

        // Testing
        test(":spock:0.7") {
            exclude "spock-grails-support"
        }

        // Metrics, Logging, and Debug
        // compile ":yammer-metrics:2.1.2-3" // Currently broken, but would be good to have
        // compile ":profiler:0.4" // Currently broken, but would be good to have
        compile ":grails-melody:1.14"
        compile ":runtime-logging:0.4"
        compile ":console:1.2"

        // Security
        compile ':spring-security-core:2.0-RC3'
        // compile ":spring-security-ldap:1.0.6"

        // Other
        compile ':cache:1.0.1'
        compile ":cache-headers:1.1.5"
        compile ":joda-time:1.4"
        compile ':mail:1.0.1', {
            excludes 'spring-test'
        }
        // compile ":ldap:0.8.2"

        // DB
        runtime ':hibernate:3.6.10.2'
        runtime ":database-migration:1.4.0"

        // UI
        runtime ":jquery:1.10.2"
        compile ":jquery-ui:1.8.24"
        runtime ":modernizr:2.6.2"
        compile ":fields:1.3"
        compile ":twitter-bootstrap:2.3.2"
        compile ":font-awesome-resources:3.2.1.1"
        runtime ":modernizr:2.6.2"

        // Resources Plugin
        runtime ":resources:1.1.6"
        runtime ":zipped-resources:1.0"
        runtime ":cached-resources:1.0"
    }
}

最佳答案

我认为 spring-security-ui 1.0-RC2 与 Grails 2.4 兼容。我希望您使用的是早期版本。

编辑:

将 spring-security-core 更新为 :spring-security-core:2.0-RC3 应该可以解决问题。

关于java - 将 Grails 应用程序从 2.2 升级到 2.4 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24271660/

相关文章:

hibernate - 如何在 groovy/grails 中为嵌套对象创建条件?

Grails 参数长数组

java - 带有 Jersey 的 OPTIONS 请求的 CORS header

java - 我试图将一个 Activity 中的用户输入存储到另一 Activity 中的 ListView 中。它不会工作

Java: NoClassDefFoundError: org/json/JSONException

java - Restful Spring postForObject 缺少所有属性值

java - 使 Spring Quartz Job Scheduler 在用户操作上运行

java - 如何使用 mockMvc 检查响应正文中的 JSON

java - Android 中使用 DataAdapter 在 GridView 中显示数据

unit-testing - Grails 域验证器 : Two fields, 可以为 null,但不能同时为 null