開發SpringMVC項目的時候,運用的Maven的骨架生成,準備部署到Tomcat,但是在選擇run on server的時候報錯:
The server does not support version 3.0 of the J2EE Web module specification.
錯誤意思是服務器不支持3.0的版本的項目,遇到這種情況只需要修改一下項目的版本就可以了!
在項目根目錄下的setting文件夾中有這么一個文件org.eclipse.wst.common.project.facet.core.xml
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<fixed facet="wst.jsdt.web"/>
<installed facet="java" version="1.6"/>
<installed facet="jst.web" version="3.0"/>
<installed facet="wst.jsdt.web" version="1.0"/>
</faceted-project>
可以看到項目中的 <installed facet="jst.web" version="3.0"/>
只需要改成2.5即可 <installed facet="jst.web" version="2.5"/>