今天把tomcat從6.0.18升級到7.0.25,發現了兩個問題
問題1
java.lang.ClassNotFoundException: org.apache.catalina.mbeans.ServerLifecycleListener
發現居然找不到這個類,然後把catatina.jar下載下來反編譯一看mbenas這個文件夾居然是空的
解決辦法
6.0.18以前,conf/server.xml裏面的配置有這項
<Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" />註釋掉就可以了
<!--<Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" /> -->
問題2
嚴重: Begin event threw exception
java.lang.IllegalArgumentException: taglib definition not consistent with specification version
tomcat 6.0.18裏面的web.xml裏面的tab配置如下
<taglib>
<taglib-uri>http://java.sun.com/jstl/core</taglib-uri>
<taglib-location>/WEB-INF/c.tld</taglib-location>
</taglib>
tomcat 7.0.25裏面web.xml的tag配置應該如下所示
<jsp-config>
<taglib>
<taglib-uri>http://java.sun.com/jstl/core</taglib-uri>
<taglib-location>/WEB-INF/c.tld</taglib-location>
</taglib>
</jsp-config>