java.lang.ClassNotFoundException: org.apache.catalina.core.JasperListener--异常5

情景:最近项目需要从tomcat7转移到tomcat8中,tomca7中配置了https,tomcat8中也要对应配置,我就把tomcat7的server.xml拷贝到tomcat8中,结果tomcat8启动时,一闪而过,对就是一闪而过,然后就没了,留给我???--神马情况呀  查看配置端口没问题呀  

查看tomcat8的log结果如下: java.lang.ClassNotFoundException: org.apache.catalina.core.JasperListener

08-Apr-2019 17:09:07.501 SEVERE [main] org.apache.tomcat.util.digester.Digester.startElement Begin event threw exception
 java.lang.ClassNotFoundException: org.apache.catalina.core.JasperListener
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at org.apache.tomcat.util.digester.ObjectCreateRule.begin(ObjectCreateRule.java:116)
	at org.apache.tomcat.util.digester.Digester.startElement(Digester.java:1178)
	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:509)
	at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:182)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1338)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2781)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:504)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)
	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
	at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:643)
	at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1451)
	at org.apache.catalina.startup.Catalina.load(Catalina.java:551)
	at org.apache.catalina.startup.Catalina.load(Catalina.java:599)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:310)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:484)

分析原因:tomcat8没有配置https时,启动正常,我修改了后就启动失败,这就是server.xml中问题,我是直接把tomcat7的server.xml文件拷贝到tomcat8中,是不是tomcat7和tomcat8的server.xml有差异,抱着试试的态度对照了一下,发现还真是有不同的地方,

tomcat7中有

java.lang.ClassNotFoundException: org.apache.catalina.core.JasperListener--异常5_第1张图片

tomcat8是没有的

java.lang.ClassNotFoundException: org.apache.catalina.core.JasperListener--异常5_第2张图片

解决方法:tomcat8中原server.xml不要替换掉,在对应的端口处配置tomcat7中相关https端口信息即可(不要像我草率地直接拷贝,给自己挖坑呀)

 

ok 就到这里啦 (^ - ^)

 

 

 

你可能感兴趣的:(tomcat,常见异常收集与解决汇总)