gpt4 book ai didi

tomcat - 尝试在 Tomcat 中启动 grails 应用程序时出现 "SEVERE: Error listenerStart"

转载 作者:行者123 更新时间:2023-11-28 21:45:06 27 4
gpt4 key购买 nike

我正在处理的 grails 应用程序有问题,我无法解决。这是一个 grails 2.0 应用程序,应该在带有 Tomcat7 的 Debian 稳定版上运行。所以我构建了 war 文件并将其部署到 Tomcat。我一启动它,就会在 Tomcat 日志文件 (catalina.out) 中得到以下日志输出:

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
28-Jan-2012 13:02:00 org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
28-Jan-2012 13:02:00 org.apache.catalina.core.StandardContext start
SEVERE: Context [/Gibbons5] startup failed due to previous errors
28-Jan-2012 13:02:00 org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
SEVERE: The web application [/Gibbons5] registered the JBDC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.

我尝试通过将 Tomcats 日志级别增加到 FINEST 使输出更详细一些,但这并没有给我任何更多信息。此外,我将应用程序的日志级别更改为调试,但这也无济于事。

在我本地的 Tomcat 上,在同一个 war 和 Tomcat7 上一切正常。

BuildConfig.groovy

grails.project.class.dir = "target/classes"
grails.project.test.class.dir = "target/test-classes"
grails.project.test.reports.dir = "target/test-reports"
grails.project.dependency.resolution = {
// inherit Grails' default dependencies
inherits("global") {
}
log "warn" // log level of Ivy resolver, either 'error', 'warn', 'info', 'debug' or 'verbose'
repositories {
grailsPlugins()
grailsHome()
grailsCentral()
mavenCentral()
}
dependencies {
compile "org.jadira.usertype:usertype.jodatime:1.9"
runtime 'mysql:mysql-connector-java:5.1.18'
}
}

codenarc.reports = {
XMLReport('xml') {
outputFile = 'CodeNarcReport.xml'
title = 'Gibbons5'
}
HTMLReport('html') {
outputFile = 'CodeNarcReport.html'
title = 'Gibbons5'
}
}
codenarc.propertiesFile = 'codenarc.properties'

// cobertura exclusions
coverage {
exclusions = [
'**/BuildConfig*',
'**/*SecurityConfig*'
]
}

应用程序属性

#Grails Metadata file
#Tue Jan 03 23:21:41 CET 2012
app.context=/
app.grails.version=2.0.0
app.name=Gibbons5
app.servlet.version=2.5
app.version=0.1
plugins.burning-image=0.5.0
plugins.code-coverage=1.2.5
plugins.codenarc=0.16.1
plugins.hibernate=2.0.0
plugins.joda-time=1.3.BUILD-SNAPSHOT
plugins.jquery=1.7.1
plugins.svn=1.0.1
plugins.syntax-highlighter=0.1.4
plugins.tomcat=2.0.0

BootStrap.groovy

导入 grails.util.GrailsUtil

class BootStrap {

def baseDataGenerator

def init = { servletContext ->
switch (GrailsUtil.environment) {
case 'development':
log.debug("init() - booting as development")

baseDataGenerator.generateData()

break

case 'production':
log.info("init() - booting as production")

baseDataGenerator.generateData()

break

case 'test':
log.debug("init() - booting as test")

baseDataGenerator.generateData()

break

default:
log.warn("init() - uncovered environment " + GrailsUtil.environment)
}
}

def destroy = {}
}

最佳答案

我遇到了同样的错误,但我找到了以下文章:

http://mythinkpond.wordpress.com/2011/07/01/tomcat-6-infamous-severe-error-listenerstart-message-how-to-debug-this-error/

在 resume 中,你需要在你的 WEB-INF/classes 中创建一个 logging.properties 文件(你可以将它添加到 webapps 中的 exploded 文件夹并重新启动 tomcat)

logging.properties 的内容可以是:

org.apache.catalina.core.ContainerBase.[Catalina].level = INFO
org.apache.catalina.core.ContainerBase.[Catalina].handlers = java.util.logging.ConsoleHandler

重启Tomcat后你可以看到更详细的错误。

关于tomcat - 尝试在 Tomcat 中启动 grails 应用程序时出现 "SEVERE: Error listenerStart",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9045155/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com