gpt4 book ai didi

tomcat - 启动Tomcat时出现异常

转载 作者:行者123 更新时间:2023-11-28 22:00:18 26 4
gpt4 key购买 nike

启动 Tomcat 时出现此异常。

除此之外,Tomcat 似乎运行正常。不过,我不喜欢我的控制台出现异常,我的 Google 搜索也没有找到相关结果,因此非常感谢您的帮助。谢谢

Listening for transport dt_socket at address: 8787
Handler error
java.lang.ClassNotFoundException: startup
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at org.apache.juli.ClassLoaderLogManager.readConfiguration(ClassLoaderLogManager.java:521)
at org.apache.juli.ClassLoaderLogManager.readConfiguration(ClassLoaderLogManager.java:464)
at org.apache.juli.ClassLoaderLogManager.readConfiguration(ClassLoaderLogManager.java:288)
at java.util.logging.LogManager$2.run(LogManager.java:258)
at java.security.AccessController.doPrivileged(Native Method)
at java.util.logging.LogManager.readPrimordialConfiguration(LogManager.java:256)
at java.util.logging.LogManager.getLogManager(LogManager.java:239)
at java.util.logging.Logger.<init>(Logger.java:221)
at java.util.logging.LogManager$RootLogger.<init>(LogManager.java:973)
at java.util.logging.LogManager$RootLogger.<init>(LogManager.java:970)
at java.util.logging.LogManager$1.run(LogManager.java:179)
at java.security.AccessController.doPrivileged(Native Method)
at java.util.logging.LogManager.<clinit>(LogManager.java:156)
at java.util.logging.Logger.getLogger(Logger.java:274)
at org.apache.juli.logging.impl.Jdk14Logger.getLogger(Jdk14Logger.java:181)
at org.apache.juli.logging.impl.Jdk14Logger.<init>(Jdk14Logger.java:61)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.apache.juli.logging.impl.LogFactoryImpl.createLogFromClass(LogFactoryImpl.java:1116)
at org.apache.juli.logging.impl.LogFactoryImpl.discoverLogImplementation(LogFactoryImpl.java:914)
at org.apache.juli.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:604)
at org.apache.juli.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:336)
at org.apache.juli.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:310)
at org.apache.juli.logging.LogFactory.getLog(LogFactory.java:685)
at org.apache.catalina.startup.Bootstrap.<clinit>(Bootstrap.java:60)
log4j:WARN No appenders could be found for logger (org.apache.catalina.startup.Catalina).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

编辑server.xml的内容:

<?xml version='1.0' encoding='utf-8'?>

<Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
<Listener className="org.apache.catalina.core.JasperListener" />
<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
<Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />
<Listener className="com.atomikos.tomcat.AtomikosLifecycleListener" />

<GlobalNamingResources>
<Resource name="UserDatabase" auth="Container" type="org.apache.catalina.UserDatabase"
description="User database that can be updated and saved"
factory="org.apache.catalina.users.MemoryUserDatabaseFactory" pathname="conf/tomcat-users.xml" />
</GlobalNamingResources>

<Service name="Catalina">
<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />

<Engine name="Catalina" defaultHost="localhost">
<Realm className="org.apache.catalina.realm.LockOutRealm">
<Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase" />
</Realm>

<Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true">
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log." suffix=".txt" pattern="%h %l %u %t &quot;%r&quot; %s %b" />
</Host>
</Engine>
</Service>

* 编辑 2 *

这是我在 logging.properties 文件中得到的内容:

handlers = startup
.handlers = startup, java.util.logging.ConsoleHandler

############################################################
# Handler specific properties.
# Describes specific configuration info for Handlers.
############################################################

startup.level = FINE
startup.directory = ${catalina.base}/logs
startup.prefix = startup.

java.util.logging.ConsoleHandler.level = FINE
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter

最佳答案

因为它说 Handler error 我感觉你的 tomcat 的 conf/logging.properties 有问题。

特别要查找该文件前两行中的任何杂散条目。默认情况下,这些是

handlers = 1catalina.org.apache.juli.FileHandler, 2localhost.org.apache.juli.FileHandler,
3manager.org.apache.juli.FileHandler, 4host-manager.org.apache.juli.FileHandler,
java.util.logging.ConsoleHandler

.handlers = 1catalina.org.apache.juli.FileHandler, java.util.logging.ConsoleHandler

关于tomcat - 启动Tomcat时出现异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15974515/

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