2013-04-12 122 views
2

啓動Tomcat時出現此異常。啓動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 
+1

啓動看起來像一個非資本開始類,並在默認包。我假設這是你的嗎? – Miquel

+0

請發佈更多配置細節,如server.xml或web.xml。 – Stefan

+0

據我所知,沒有叫「啓動」的類。 即使我沒有在其上部署任何應用程序,它也是這樣做的,但它是一個經過修改的Tomcat - 只是我不確切知道修改了哪些內容。 – ccc

回答

1

自說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 
+0

感謝您的建議。 我編輯了我的問題,添加了logging.properties的部分內容。我認爲那裏的「啓動」是導致問題的原因,但我不是那個加了它的人,我以前沒有用過這些配置,所以我不知道他們應該做什麼。 – ccc

+0

很顯然,'handler = startup'這一行是不正確的,在啓動tomcat的時候,你會一直得到一個異常,因爲沒有名稱爲'startup'的類。無論誰編輯該屬性文件顯然是錯誤的。用一些默認條目替換該行,例如我提到的那個,並且您的服務器開始很好 –

+0

Yeap。這是否和錯誤消失了。我仍然想知道該做什麼的人 - 只要我能找到那些做了那件事的人。無論如何,感謝您的幫助。我查看了其他配置文件,但出於某種原因,我沒有考慮在logging.properties中查找。 – ccc

相關問題