首页 > 代码库 > org.w3c.dom.ls.LSException: java.lang.NullPointerException
org.w3c.dom.ls.LSException: java.lang.NullPointerException
操作环境:
OS:WIN 10.0.14393 x64 家庭版
JDK:JavaSE 1.5.0_20 i586
Tomcat:6.0.48 win32
-----------------------------------------------------------------
操作过程:
执行startup.bat,启动Tomcat。
-----------------------------------------------------------------
异常信息:
org.w3c.dom.ls.LSException: java.lang.NullPointerException
at com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl.writeToString(DOMSerializerImpl.java:546)
at org.apache.catalina.core.JreMemoryLeakPreventionListener.lifecycleEvent(JreMemoryLeakPreventionListener.java:410)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
at org.apache.catalina.core.StandardServer.initialize(StandardServer.java:820)
at org.apache.catalina.startup.Catalina.load(Catalina.java:538)
at org.apache.catalina.startup.Catalina.load(Catalina.java:562)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:592)
at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:261)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
-----------------------------------------------------------------
Tomcat源码:
388 >> if (xmlParsingProtection) {
389 >> // There are three known issues with XML parsing
390 >> // 1. DocumentBuilderFactory.newInstance().newDocumentBuilder();
391 >> // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6916498
392 >> // This issue is fixed in Java 7 onwards
393 >> DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
394 >> try {
395 >> DocumentBuilder documentBuilder = factory.newDocumentBuilder();
396 >> // The 2nd and 3rd links both relate to cached Exception
397 >> // instances that retain a link to the TCCL via the
398 >> // backtrace field. Note that YourKit only shows this
399 >> // field when using the HPROF format memory snapshots.
400 >> // https://bz.apache.org/bugzilla/show_bug.cgi?id=58486
401 >> // These issues are currently present in all current
402 >> // versions of Java
403 >> // 2. com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl
404 >> Document document = documentBuilder.newDocument();
405 >> document.createElement("dummy");
406 >> DOMImplementationLS implementation =
407 >> (DOMImplementationLS)document.getImplementation();
408 >> implementation.createLSSerializer().writeToString(document);
409 >> // 3. com.sun.org.apache.xerces.internal.dom.DOMNormalizer
410 >> document.normalize();
411 >> } catch (ParserConfigurationException e) {
412 >> log.error(sm.getString("jreLeakListener.xmlParseFail"),
413 >> e);
414 >> }
415 >> }
org.w3c.dom.ls.LSException: java.lang.NullPointerException