在tomcat 6.0.28上部署应用程序时出现问题

时间:2012-04-11 12:17:35

标签: grails deployment tomcat6

我遇到一个问题,我无法在tomcat上部署我的grails应用程序,我遵循以下书面步骤:

  1. grails prod war
  2. mv target/app.war /var/lib/tomcat6/webapps
  3. 使用sudo service stop
  4. 重新启动tomcat

    问题是我的服务器启动了,但它没有部署战争,因为当我转到/myapp时,我得到了404。

    我得到的日志是:

    `

    Configuring Spring Security ...
    System properties loaded from: /var/lib/tomcat6/webapps/jbilling/WEB-INF/classes/jbilling.properties
    Resolved jbilling resources directory to: 
    Apr 11, 2012 4:25:30 PM org.apache.catalina.core.StandardContext start
    SEVERE: Error listenerStart
    Apr 11, 2012 4:25:30 PM org.apache.catalina.core.StandardContext start
    SEVERE: Context [/jbilling] startup failed due to previous errors
    Apr 11, 2012 4:25:30 PM org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
    SEVERE: The web application [/jbilling] registered the JBDC driver [org.postgresql.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
    Apr 11, 2012 4:25:30 PM org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap
    SEVERE: The web application [/jbilling] created a ThreadLocal with key of type [null] (value [org.codehaus.groovy.grails.commons.spring.ReloadAwareAutowireCapableBeanFactory$2@127ea69]) and a value of type [java.lang.Boolean] (value [false]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.
    log4j:ERROR LogMananger.repositorySelector was null likely due to error in class reloading, using NOPLoggerRepository.
    Apr 11, 2012 4:26:33 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
    INFO: validateJarFile(/var/lib/tomcat6/webapps/jbilling/WEB-INF/lib/geronimo-servlet_2.5_spec-1.2.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
    Apr 11, 2012 4:26:33 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
    INFO: validateJarFile(/var/lib/tomcat6/webapps/jbilling/WEB-INF/lib/servlet-api-2.3.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
    Loading configuration files from classpath
    log4j:WARN No appenders could be found for logger (org.hibernate.cfg.annotations.Version).
    log4j:WARN Please initialize the log4j system properly.
    log4j:ERROR setFile(null,true) call failed.
    java.io.FileNotFoundException: stacktrace.log (Permission denied)
        at java.io.FileOutputStream.openAppend(Native Method)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:207)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:131)
        at org.apache.log4j.FileAppender.setFile(FileAppender.java:290)
        at org.apache.log4j.FileAppender.activateOptions(FileAppender.java:164)
        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:616)
        at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoCachedMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:229)
        at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:52)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:121)
        at org.codehaus.groovy.grails.plugins.logging.Log4jConfig.createFullstackTraceAppender(Log4jConfig.groovy:177)
        at org.codehaus.groovy.grails.plugins.logging.Log4jConfig.this$2$createFullstackTraceAppender(Log4jConfig.groovy)
        at org.codehaus.groovy.grails.plugins.logging.Log4jConfig$this$2$createFullstackTraceAppender.callCurrent(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:44)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:143)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:147)
        at org.codehaus.groovy.grails.plugins.logging.Log4jConfig.configure(Log4jConfig.groovy:145)
        at org.codehaus.groovy.grails.plugins.logging.Log4jConfig$configure.callCurrent(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:44)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:143)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:151)
        at org.codehaus.groovy.grails.plugins.logging.Log4jConfig.configure(Log4jConfig.groovy:92)
        at org.codehaus.groovy.grails.web.util.Log4jConfigListener.contextInitialized(Log4jConfigListener.java:65)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4135)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4630)
        at org.apache.catalina.manager.ManagerServlet.start(ManagerServlet.java:1276)
        at org.apache.catalina.manager.HTMLManagerServlet.start(HTMLManagerServlet.java:625)
        at org.apache.catalina.manager.HTMLManagerServlet.doGet(HTMLManagerServlet.java:136)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        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:102)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
        at java.lang.Thread.run(Thread.java:679)
    Log4j XML Plugin - please put a log4j.groovy or log4j.xml under /grails-app/conf, or uninstall this plugin
    

    `

    我甚至在文件夹路径/ usr / share / tomcat6 / bin / grails-app / conf下有一个log4j.xml文件。

    我试过谷歌搜索,但我无法理解给出的解决方案,有人可以帮忙吗?

1 个答案:

答案 0 :(得分:1)

我刚刚在我们的日志文件中看到了这个错误。它并没有阻止我们的应用程序加载。

我们正在清理我们的日志,所以这里是修复:在log4j机箱中的Config.groovy文件中放置

appenders {
    'null' name:'stacktrace'
}