启动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等)中的包重復且比其版本低,應用服務器在啟動時會優先加載項目中的包,這樣就導致和應用服務器中的其它包不匹配。可把重復的包從項目中刪除,或將應用服務器下的這些包拷貝到項目中,重啟服務即可。
?
轉載于:https://blog.51cto.com/dabuding/860637
總結
以上是生活随笔為你收集整理的启动tomcat遇到的问题整理的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 维监控利器Nagios:概念、结构和功能
- 下一篇: Linux学习笔记三--vim