启动tomcat遇到的问题整理

问题1.[commons-attributes-api.jar]: Required extension "ant" not found.
解决:原因在于commons-attributes-compiler.jar包的MANIFEST.MF文件出现问题,如果对这个包没有依赖,直接 删除这个包的引用,项目就可以正常启动,如果对这个包有依赖,那么可以通过以下两种方式来解决。

1、修改MANIFEST.MF文件
原compiler.jar包中的MF文件结构
程序代码
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.5.3
Created-By: Apache Maven
Built-By: hen
Package: org.apache.commons.attributes
Build-Jdk: 1.4.2_05
Extension-Name: commons-attributes-api
Specification-Title: Client API for Jakarta Commons Attributes.
Specification-Vendor: The Apache Software Foundation
Implementation-Title: org.apache.commons.attributes
Implementation-Vendor: The Apache Software Foundation
Implementation-Version: 2.2
Extension-List: ant qdox
ant-Extension-Name: ant
ant-Implementation-Version: 1.5
ant-Implementation-URL: http://www.ibiblio.org/maven/ant/jars/ant-1.5.
jar
qdox-Extension-Name: qdox
qdox-Implementation-Version: 1.5
qdox-Implementation-URL: http://www.ibiblio.org/maven/qdox/jars/qdox-1
.5.jar
Implementation-Vendor-Id: org.apache
X-Compile-Source-JDK: 1.4
X-Compile-Target-JDK: 1.4
我们可以看到URL后面的地址中含有一些不必要的字符,将MF文件修改如下
程序代码
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.5.3
Created-By: Apache Maven
Built-By: hen
Package: org.apache.commons.attributes
Build-Jdk: 1.4.2_05
Extension-Name: commons-attributes-api
Specification-Title: Client API for Jakarta Commons Attributes.
Specification-Vendor: The Apache Software Foundation
Implementation-Title: org.apache.commons.attributes
Implementation-Vendor: The Apache Software Foundation
Implementation-Version: 2.2
Extension-List: ant qdox
ant-Extension-Name: ant
ant-Implementation-Version: 1.5
ant-Implementation-URL: http://www.ibiblio.org/maven/ant/jars/ant-1.5.jar
qdox-Extension-Name: qdox
qdox-Implementation-Version: 1.5
qdox-Implementation-URL: http://www.ibiblio.org/maven/qdox/jars/qdox-1.5.jar
Implementation-Vendor-Id: org.apache

X-Compile-Source-JDK: 1.4
X-Compile-Target-JDK: 1.4

这个问题就可以解决。 (这方法我试过了,貌似没有什么效果,如果对这个包没有依赖,可以删除相关的这几个包)

2、替换commons-attributes-compiler.jar包

问题2:The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory
解决:可能是你项目中的诸如:catalina.jar、jsp-api.jar、servlet-api.jar、javax.servlet.jar、javax.servlet.jsp.jar等包和应用服务器(JBoss/Tomcat等)中的包重复且比其版本低,应用服务器在启动时会优先加载项目中的包,这样就导致和应用服务器中的其它包不匹配。可把重复的包从项目中删除,或将应用服务器下的这些包拷贝到项目中,重启服务即可。

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章