NewInstanceCreationException:无法创建类[SpringSecurityCoreGrailsPlugin]的新实例!

时间:2014-06-30 16:24:02

标签: spring grails

我运行的grails应用程序在intelliJ中本地工作正常但在.war文件部署到生产服务器时获取此堆栈跟踪

栈跟踪

'2014-06-30 09:26:31,641 [localhost-startStop-6] ERROR context.ContextLoader  - Context initialization failed
'org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pluginManager' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is org.codehaus.groovy.grails.exceptions.NewInstanceCreationException: Could not create a new instance of class [SpringSecurityCoreGrailsPlugin]!
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:744)
Caused by: org.codehaus.groovy.grails.exceptions.NewInstanceCreationException: Could not create a new instance of class [SpringSecurityCoreGrailsPlugin]!
        ... 5 more
Caused by: java.lang.OutOfMemoryError: Java heap space
'2014-06-30 09:26:31,643 [localhost-startStop-6] ERROR context.GrailsContextLoader  - Error initializing the application: Error creating bean with name 'pluginManager' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is org.codehaus.groovy.grails.exceptions.NewInstanceCreationException: Could not create a new instance of class [SpringSecurityCoreGrailsPlugin]!
'org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pluginManager' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is org.codehaus.groovy.grails.exceptions.NewInstanceCreationException: Could not create a new instance of class [SpringSecurityCoreGrailsPlugin]!
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:744)
Caused by: org.codehaus.groovy.grails.exceptions.NewInstanceCreationException: Could not create a new instance of class [SpringSecurityCoreGrailsPlugin]!
        ... 5 more
Caused by: java.lang.OutOfMemoryError: Java heap space
'2014-06-30 09:26:31,644 [localhost-startStop-6] ERROR context.GrailsContextLoader  - Error initializing Grails: Error creating bean with name 'pluginManager' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is org.codehaus.groovy.grails.exceptions.NewInstanceCreationException: Could not create a new instance of class [SpringSecurityCoreGrailsPlugin]!
'org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pluginManager' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is org.codehaus.groovy.grails.exceptions.NewInstanceCreationException: Could not create a new instance of class [SpringSecurityCoreGrailsPlugin]!
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:744)
Caused by: org.codehaus.groovy.grails.exceptions.NewInstanceCreationException: Could not create a new instance of c...

build config

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
    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:$grailsVersion"

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

        compile ":grails-melody:1.14"
        compile ":runtime-logging:0.4"
        compile ":console:1.2"

        // Security
        compile ":spring-security-core:1.2.7.3"
        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"

        // DB
        runtime ":hibernate:$grailsVersion"
        runtime ":database-migration:1.3.2"

        // 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"
    }
}

我认为这是基于其他搜索的依赖性问题,但不确定如何确定。非常感谢任何帮助。

1 个答案:

答案 0 :(得分:2)

在实际上,看起来这是真正的问题是:

Caused by: java.lang.OutOfMemoryError: Java heap space –