在ServletContext资源中定义名为'pluginManager'的bean时出错

时间:2014-08-04 06:33:09

标签: java grails tomcat7

在tomcat中部署WAR文件时出现以下错误。有人能告诉我应该怎么做。我

我尝试增加堆大小,但没有任何效果。

Jul 03, 2014 6:44:20 AM org.apache.catalina.core.ApplicationContext log
INFO: No Spring WebApplicationInitializer types detected on classpath
Jul 03, 2014 6:44:27 AM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Jul 03, 2014 6:45:54 AM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class org.codehaus.groovy.grails.web.context.GrailsContextLoaderListener
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 [HibernateGrailsPlugin]!
        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 [HibernateGrailsPlugin]!
        ... 5 more
Caused by: java.lang.OutOfMemoryError: Java heap space

Jul 03, 2014 6:59:15 AM org.apache.catalina.core.ApplicationContext log
INFO: No Spring WebApplicationInitializer types detected on classpath
Jul 03, 2014 6:59:17 AM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Jul 03, 2014 8:03:16 AM org.apache.catalina.core.ApplicationContext log
INFO: No Spring WebApplicationInitializer types detected on classpath
Jul 03, 2014 8:03:19 AM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext

1 个答案:

答案 0 :(得分:0)

Java命令行参数

-Xms:初始堆大小 -Xmx:最大堆大小

如果您使用的是Tomcat。更新CATALINA_OPTS环境变量

导出CATALINA_OPTS = -Xms16m -Xmx256m;

上面的答案我从下面的链接中得到了它。有关详细信息,请参阅以下链接

Error creating bean with name 'pluginManager' defined in ServletContext resource