Tomcat無法啟動
console顯示org.apache.catalina.LifecycleException
檢查web.xml中<servlet-mapping>的<url-pattern>標簽中的url柠掂,漏/可能會出現(xiàn)該錯誤
HTTP Status 500 – Internal Server Error
Type Exception Report
Message Error instantiating servlet class [servlet.ListServlet]
Description The server encountered an unexpected condition that prevented it from fulfilling the request.
Exception
javax.servlet.ServletException: Error instantiating servlet class [packagename.classname]
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:475)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80)
org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:625)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:498)
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:796)
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1372)
org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
java.lang.Thread.run(Thread.java:748)
- Eclipse中修改Server Locations為Use Tomcat Installation,修改Deploy Path為webapps
進tomcat安裝目錄下webapps\projectname\WEB-INF\classes中查找是否存在class -
檢查web.xml中<servlet>和<servlet-mapping>中的內(nèi)容是否寫錯荡碾,檢查出錯servlet是否放在正確的source folder下的正確包內(nèi)
極有可能是這個原因荡澎,但是自己就是看不出來哪里寫錯了均践,這時候就干點別的放松一下再回來找錯吧