zoukankan      html  css  js  c++  java
  • java web程序中web.xml文件中servlet-name、url-pattern的值不能与映射的类名一致,否则tomcat启动不了,报错误: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/Servlet_day02]]

         新建一个web程序Servlet_day02新建一个ServletDemo1类继承HttpServlet,然后配置web.xml:

    启动tomcat,一直报错:

      

    报的错误是:Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/Servlet_day02]],

    Caused by: java.lang.IllegalArgumentException: The servlets named [ServletDemo1] and [com.guan.servlet.ServletDemo1] are both mapped to the url-pattern [/ServletDemo1] which is not permitted

    说明:servlet-name与url-pattern不能都与映射的类文件名相同。修改之:

    启动tomcat,成功。

  • 相关阅读:
    参考资料来自 懒兔子 的公众号
    Etcd
    zookeeper 杂记
    十二五
    防火墙
    APScheduler
    docker管理工具protainer
    java学习笔记
    linux学习笔记1
    [POI2007]ZAP-Queries
  • 原文地址:https://www.cnblogs.com/gwq369/p/5217232.html
Copyright © 2011-2022 走看看