0

在 Cpanel(WHM)中的 Tomcat 中部署 WAR 文件时出现以下错误。我收到以下错误..对此有任何帮助吗?

catalina.out 的日志文件

    [11491] net].[/sample] 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 java.lang.RuntimeException: Unable to locate constructor with Class parameter for class org.codehaus.groovy.grails.commons.DefaultGrailsControllerClass
            at java.security.AccessController.doPrivileged(Native Method)
            at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3795)
            at org.apache.catalina.core.StandardContext.start(StandardContext.java:4252)
            at org.apache.catalina.manager.ManagerServlet.start(ManagerServlet.java:1173)
            at org.apache.catalina.manager.HTMLManagerServlet.start(HTMLManagerServlet.java:550)
            at org.apache.catalina.manager.HTMLManagerServlet.doGet(HTMLManagerServlet.java:105)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
            at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:563)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:879)
            at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
            at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
            at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
            at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
            at java.lang.Thread.run(Thread.java:662)
    Caused by: java.lang.RuntimeException: Unable to locate constructor with Class parameter for class org.codehaus.groovy.grails.commons.Defau                    ltGrailsControllerClass
            ... 21 more
    Caused by: java.lang.reflect.InvocationTargetException
            ... 21 more
    Caused by: org.codehaus.groovy.grails.exceptions.NewInstanceCreationException: Could not create a new instance of class [PhysicalAbilityCon                    troller]!
            ... 21 more
    Caused by: java.lang.OutOfMemoryError: PermGen space
            at java.lang.ClassLoader.defineClass1(Native Method)
            at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
            at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
            at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
            at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1960)
            at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:933)
            at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1405)
            at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1284)
            at PhysicalAbilityController.<init>(PhysicalAbilityController.groovy)

这是 catalina.err 的错误,如下所示; catalina.err 的日志文件

         Jul 10, 2012 2:09:03 AM org.apache.catalina.core.ApplicationContext log
            INFO: HTMLManager: start: Starting web application at '/sample'
            Jul 10, 2012 2:09:04 AM org.apache.catalina.loader.WebappClassLoader validateJarFile
            INFO: validateJarFile(/usr/local/jakarta/apache-tomcat-5.5.35/work/Catalina/sample.net/sample/WEB-INF/lib/javaee.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
            Jul 10, 2012 2:09:05 AM org.apache.catalina.loader.WebappClassLoader validateJarFile
            INFO: validateJarFile(/usr/local/jakarta/apache-tomcat-5.5.35/work/Catalina/sample.net/sample/WEB-INF/lib/jsp-api.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/jsp/JspPage.class
            Jul 10, 2012 2:09:16 AM org.apache.catalina.core.StandardContext start
            SEVERE: Error listenerStart
            Jul 10, 2012 2:09:16 AM org.apache.catalina.core.StandardContext start
            SEVERE: Context [/sample] startup failed due to previous errors
4

1 回答 1

0
Caused by: java.lang.OutOfMemoryError: PermGen space

您没有足够的 PermGen 内存,这在使用 Tomcat + Groovy 时很常见。将此添加到您的启动脚本/JVM 选项中:

-XX:PermSize=150M

如果问题仍然存在,请使用更大的值。您可以在catalina.sh/中设置此值catalina.bat,搜索JAVA_OPTS变量。

于 2012-07-09T20:53:50.173 回答