重啓tomcat的時候出錯
Illegal access: this web application instance has been stopped already. Could not load oracle.net.mesg.Message. The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.
原因是因爲在tomcat重啓的時候,之前的tomcat的線程還沒有完全關閉,最新啓動tomcat就會報這個異常,只要把tomcat的server.xml 中的reloadable="true" 改成false就OK
</Service>
<Service name="Catalina">
<Connector port="8086" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
<Connector port="9003" 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">
<Context docBase="Helloword" path="" workDir="work/Catalina1/localhost/Helloword" reloadable="true"/>
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log." suffix=".txt"
pattern="%h %l %u %t "%r" %s %b" />
</Host>
</Engine>
</Service>
Context(表示一個web應用程序,通常爲WAR文件,關於WAR的具體信息見servlet規範) | docBase | 應用程序的路徑或者是WAR文件存放的路徑 |
path | 表示此web應用程序的url的前綴,這樣請求的url爲http://localhost:8080/path/**** | |
reloadable | 這個屬性非常重要,如果爲true,則tomcat會自動檢測應用程序的/WEB-INF/lib 和/WEB-INF/classes目錄的變化,自動裝載新的應用程序,我們可以在不重起tomcat的情況下改變應用程序 |
其中
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log." suffix=".txt"
pattern="%h %l %u %t "%r" %s %b" />
的含義參見如下文章