> Date: Mon, 28 Dec 2015 16:12:46 +0300 > Subject: Re: Fail to start Tomcat 8 with xerces library > From: knst.koli...@gmail.com > To: users@tomcat.apache.org > > 2015-12-28 12:17 GMT+03:00 Kien Vo <votrik...@outlook.com>: > > My current xerces version is 2.6.1. > > My app used Tomcat 7 without any issues. But upgrading to Tomcat 8 got that > > error. > > Is there any way to by-pass this error? > > > >> Subject: Re: Fail to start Tomcat 8 with xerces library > >> To: users@tomcat.apache.org > >> From: ma...@apache.org > >> Date: Mon, 28 Dec 2015 07:58:14 +0000 > >> > >> On 28/12/2015 07:24, Kien Vo wrote: > >> > Hi all, > >> > > >> > I encountered this error when starting Tomcat 8 with > >> > xerces library. Any help appreciated! > >> > > >> > I put xerces.jar in this folder C:\tomcat8\endorsed. If I > >> > don't put it there, Tomcat does not load that library at all. My > >> > application > >> > gets "NoSuchMethodException". > >> > > >> > Tomcat server: 8.0.30.0 > >> > JVM Version: > >> > 1.7.0_51-b13 (32 bit) > >> > OS Name: > >> > Windows 7 (64 bit) > >> > OS Version: > >> > 6.1 > >> > >> That version information is helpful but it doesn't include the Xerces > >> version. There have been quite a few Xerces releases so the version is > >> important. > >> > >> > org.w3c.dom.ls.LSException: > >> > java.lang.NullPointerException > >> > > >> > at > >> > com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl.writeToString(DOMSerializerImpl.java:534) > >> > > >> > at > >> > org.apache.catalina.core.JreMemoryLeakPreventionListener.lifecycleEvent(JreMemoryLeakPreventionListener.java:447) > >> > >> Have you looked at line 447 of Tomcat's JreMemoryLeakPreventionListener? > >> If not, take a look. If yes, you should be able to ask a more specific > >> question. > >> > > Rules: > http://tomcat.apache.org/lists.html#tomcat-users > -> 6. Top-posting is bad. > > > Placing the library into "\endorsed" directory means that you are > trying to replace JRE-provided implementation of XML APIs with a 3rd > party one. > > If you are doing so, you must use XML library that implements the same > set of APIs and the same specification level as implemented in JRE. > Xerces-J 2.6.1 was released in January 2004, so there is no wonder > that it cannot be used as replacement implementation and fails in > strange ways. Try with the current version (2.11.0). > > http://xerces.apache.org/#xerces2-j > > > Actually placing something into "\endorsed" does not replace the > existing library inside of JRE, but just places the new library in > front of bootstrap classpath. So in your case the JRE operates on a > mix of up-to-date and historic classes. > > Best regards, > Konstantin Kolinko > > ---------------------------------------------------------------------
Thanks Kolinko and Mark. I solved my issue. I used the latest version of Xerces library (2.11.0), put "xercesImpl.jar" and "xml-apis.jar" in TOMCAT_HOME/endorsed folder.