启动tomcat时报如下异常:
Caused by: java.lang.IllegalArgumentException: The main resource set specified [C:\MyApp\apache-tomcat-9.0.29\wtpwebapps\jerryjsp] is not valid
at org.apache.catalina.webresources.StandardRoot.createMainResourceSet(StandardRoot.java:752)
at org.apache.catalina.webresources.StandardRoot.startInternal(StandardRoot.java:709)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
... 30 more
查看Servers文件夹下面的server.xml:
C:\Users\i042416\eclipse-workspace\Servers\Tomcat v9.0 Server at localhost-config\server.xml
发现里面指向了一个无效的jsp应用:
手动删除server.xml文件里的Context节点,问题解决。服务器又可以启动了:
把jsp应用的war包放到tomcat文件夹下的webapps里,会自动解压进行部署:
Jul 20, 2020 10:57:21 AM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive [C:\MyApp\apache-tomcat-9.0.29\webapps\jerryjsp.war]
Jul 20, 2020 10:57:22 AM org.apache.jasper.servlet.TldScanner scanJars
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
Jul 20, 2020 10:57:22 AM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deployment of web application archive [C:\MyApp\apache-tomcat-9.0.29\webapps\jerryjsp.war] has finished in [1,579] ms