在Grails 2.1.1 spring Security插件中执行Bootstrap时出错

时间:2013-06-24 09:37:20

标签: grails spring-security

我正在创建一个交互式grails应用程序,并尝试通过grails 2.1.1中的springSecurity插件进行身份验证。我正在使用IntelliJ idea IDE。当我运行我的应用程序时,会生成以下异常序列,这是我无法理解的。

Error 2013-06-24 13:46:53,524 [localhost-startStop-1] ERROR context.GrailsContextLoader  - Error executing bootstraps: Error creating bean with name 'instanceTagLibraryApi': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void     org.codehaus.groovy.grails.plugins.web.api.TagLibraryApi.setGspTagLibraryLookup(org.codehaus.groovy.grails.web.pages.TagLibraryLookup); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'gspTagLibraryLookup': Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.codehaus.groovy.grails.plugins.web.taglib.ApplicationTagLib': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.codehaus.groovy.grails.web.mapping.LinkGenerator org.codehaus.groovy.grails.plugins.web.taglib.ApplicationTagLib.linkGenerator; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'grailsLinkGenerator': Post-processing failed of bean type [class org.codehaus.groovy.grails.web.mapping.CachingLinkGenerator] failed; nested exception is java.lang.ClassCastException: com.sun.proxy.$Proxy24 cannot be cast to java.lang.annotation.Annotation
Message: Error creating bean with name 'instanceTagLibraryApi': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void org.codehaus.groovy.grails.plugins.web.api.TagLibraryApi.setGspTagLibraryLookup(org.codehaus.groovy.grails.web.pages.TagLibraryLookup); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'gspTagLibraryLookup': Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.codehaus.groovy.grails.plugins.web.taglib.ApplicationTagLib': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.codehaus.groovy.grails.web.mapping.LinkGenerator org.codehaus.groovy.grails.plugins.web.taglib.ApplicationTagLib.linkGenerator; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'grailsLinkGenerator': Post-processing failed of bean type [class org.codehaus.groovy.grails.web.mapping.CachingLinkGenerator] failed; nested exception is java.lang.ClassCastException: com.sun.proxy.$Proxy24 cannot be cast to java.lang.annotation.Annotation
    Line | Method
->>  334 | innerRun  in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
|    166 | run       in java.util.concurrent.FutureTask
|   1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
|    615 | run       in java.util.concurrent.ThreadPoolExecutor$Worker
^    722 | run . . . in java.lang.Thread

Caused by BeanCreationException: Could not autowire method: public void org.codehaus.groovy.grails.plugins.web.api.TagLibraryApi.setGspTagLibraryLookup(org.codehaus.groovy.grails.web.pages.TagLibraryLookup); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'gspTagLibraryLookup': Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.codehaus.groovy.grails.plugins.web.taglib.ApplicationTagLib': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.codehaus.groovy.grails.web.mapping.LinkGenerator org.codehaus.groovy.grails.plugins.web.taglib.ApplicationTagLib.linkGenerator; nested exception is org.springframework.beans.factory.BeanCreationException: 
    Error creating bean with name 'grailsLinkGenerator': Post-processing failed of bean type [class org.codehaus.groovy.grails.web.mapping.CachingLinkGenerator] failed; nested exception is java.lang.ClassCastException: com.sun.proxy.$Proxy24 cannot be cast to java.lang.annotation.Annotation
->>  334 | innerRun  in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
|    166 | run       in java.util.concurrent.FutureTask
|   1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
|    615 | run       in java.util.concurrent.ThreadPoolExecutor$Worker
^    722 | run . . . in java.lang.Thread

Caused by BeanCreationException: Error creating bean with name 'gspTagLibraryLookup': Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.codehaus.groovy.grails.plugins.web.taglib.ApplicationTagLib': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.codehaus.groovy.grails.web.mapping.LinkGenerator org.codehaus.groovy.grails.plugins.web.taglib.ApplicationTagLib.linkGenerator; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'grailsLinkGenerator': Post-processing failed of bean type [class org.codehaus.groovy.grails.web.mapping.CachingLinkGenerator] failed; nested exception is java.lang.ClassCastException: com.sun.proxy.$Proxy24 cannot be cast to java.lang.annotation.Annotation
->>  334 | innerRun  in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
|    166 | run       in java.util.concurrent.FutureTask
|   1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
|    615 | run       in java.util.concurrent.ThreadPoolExecutor$Worker
^    722 | run . . . in java.lang.Thread

Caused by BeanCreationException: Error creating bean with name 'org.codehaus.groovy.grails.plugins.web.taglib.ApplicationTagLib': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.codehaus.groovy.grails.web.mapping.LinkGenerator org.codehaus.groovy.grails.plugins.web.taglib.ApplicationTagLib.linkGenerator; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'grailsLinkGenerator': Post-processing failed of bean type [class org.codehaus.groovy.grails.web.mapping.CachingLinkGenerator] failed; nested exception is java.lang.ClassCastException: com.sun.proxy.$Proxy24 cannot be cast to java.lang.annotation.Annotation
->>  334 | innerRun  in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
|    166 | run       in java.util.concurrent.FutureTask
|   1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
|    615 | run       in java.util.concurrent.ThreadPoolExecutor$Worker
^    722 | run . . . in java.lang.Thread

Caused by BeanCreationException: Could not autowire field: private org.codehaus.groovy.grails.web.mapping.LinkGenerator org.codehaus.groovy.grails.plugins.web.taglib.ApplicationTagLib.linkGenerator; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'grailsLinkGenerator': Post-processing failed of bean type [class org.codehaus.groovy.grails.web.mapping.CachingLinkGenerator] failed; nested exception is java.lang.ClassCastException: com.sun.proxy.$Proxy24 cannot be cast to java.lang.annotation.Annotation
->>  334 | innerRun  in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
|    166 | run       in java.util.concurrent.FutureTask
|   1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
|    615 | run       in java.util.concurrent.ThreadPoolExecutor$Worker
^    722 | run . . . in java.lang.Thread

Caused by BeanCreationException: Error creating bean with name 'grailsLinkGenerator': Post-processing failed of bean type [class org.codehaus.groovy.grails.web.mapping.CachingLinkGenerator] failed; nested exception is java.lang.ClassCastException: com.sun.proxy.$Proxy24 cannot be cast to java.lang.annotation.Annotation
->>  334 | innerRun  in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
|    166 | run       in java.util.concurrent.FutureTask
|   1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
|    615 | run       in java.util.concurrent.ThreadPoolExecutor$Worker
^    722 | run . . . in java.lang.Thread

Caused by ClassCastException: com.sun.proxy.$Proxy24 cannot be cast to java.lang.annotation.Annotation
->>  334 | innerRun  in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
|    166 | run       in java.util.concurrent.FutureTask
|   1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
|    615 | run       in java.util.concurrent.ThreadPoolExecutor$Worker
^    722 | run . . . in java.lang.Thread

Process finished with exit code 1

请纠正我,如果有什么不对劲的话。 **下面是我的BuildConfig.groovy文件代码......

`

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"

grails.project.dependency.resolution = {
    // inherit Grails' default dependencies
    inherits("global") {
        // specify dependency exclusions here; for example, uncomment this to disable ehcache:
        // excludes 'ehcache'
    }
    log "error" // log level of Ivy resolver, either 'error', 'warn', 'info', 'debug' or 'verbose'
    checksums true // Whether to verify checksums on resolve

    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 eg.

        // runtime 'mysql:mysql-connector-java:5.1.20'
    }

    plugins {
        runtime ":hibernate:$grailsVersion"
        runtime ":jquery:1.8.0"
        runtime ":resources:1.1.6"

        // Uncomment these (or add new ones) to enable additional resources capabilities
        //runtime ":zipped-resources:1.0"
       // runtime ":cached-resources:1.0"
        //runtime ":yui-minify-resources:0.1.4"

        build ":tomcat:$grailsVersion"

        runtime ":database-migration:1.1"

        //compile ':cache:1.0.0'
    }
}

`**

2 个答案:

答案 0 :(得分:3)

ClassCastException: com.sun.proxy.$Proxy24 cannot be cast to java.lang.annotation.Annotation

表示您正在使GRAILS-9952犯规,这是dev-mode重新加载代理的问题。 JIRA声称修补程序将在下一个版本(2.1.6)中,或者有一种解决方法,涉及使用较新版本替换当前Grails中的弹出式JAR文件并清除~/.grails/<version>/.slcache目录。 / p>

答案 1 :(得分:0)

您将转到当前用户目录,然后转到clean/remove这些目录文件

.grials/2.1.1/.slcache/

OR

.grials/.slcache/