如何解决Tomcat服务器在初始化应用的时候的以下异常问题
1,Cannot change version of project facet Dynamic Web Module to 3.0
2,One or more constraints have not been satisfied
3,严重: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/....]] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
需要修改 project的 properties的 Project Facts的 Dynamic Web Moudle Version版本和 web.xml中的版本一致,然后 在通过maven update(Alt+F5)
如图所示:如果禁止修改 则在项目的根目录下 \.settings\org.eclipse.wst.common.project.facet.core.xml 里面
修改这一句话: <installed facet="jst.web" version="3.0"/>
以下为 web.xml的各个版本:
web.xml v2.3
[xml] view plain copy
- <?xml version="1.0" encoding="ISO-8859-1"?>
- <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
- <web-app>
- </web-app>
web.xml v2.4
[xml] view plain copy
- <?xml version="1.0" encoding="UTF-8"?>
- <web-app id="WebApp_9" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
- </web-app>
web.xml v2.5
[xml] view plain copy
- <?xml version="1.0" encoding="UTF-8"?>
- <web-app xmlns=<a target="_blank" href="http://java.sun.com/xml/ns/javaee">http://java.sun.com/xml/ns/javaee</a>
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
- version="2.5">
- </web-app>
web.xml v3.0
- <?xml version="1.0" encoding="UTF-8"?>
- <web-app
- version="3.0"
- xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
- </web-app>