啓動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等)中的包重複且比其版本低,應用服務器在啓動時會優先加載項目中的包,這樣就導致和應用服務器中的其它包不匹配。可把重複的包從項目中刪除,或將應用服務器下的這些包拷貝到項目中,重啓服務即可。

 

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