zoukankan      html  css  js  c++  java
  • org/w3c/dom/ElementTraversal 错误解决办法

    org/w3c/dom/ElementTraversal 错误解决办法

            不记得之前几天把什么maven依赖包删除了,今天利用htmlunit运行代码的时候报了下面的错误:

    Exception in thread "main" java.lang.NoClassDefFoundError: org/w3c/dom/ElementTraversal
    	at java.lang.ClassLoader.defineClass1(Native Method)
    	at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
    	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    	at java.net.URLClassLoader.defineClass(URLClassLoader.java:455)
    	at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
    	at java.net.URLClassLoader$1.run(URLClassLoader.java:367)
    	at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
    	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    	at java.lang.ClassLoader.defineClass1(Native Method)
    	at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
    	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    	at java.net.URLClassLoader.defineClass(URLClassLoader.java:455)
    	at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
    	at java.net.URLClassLoader$1.run(URLClassLoader.java:367)
    	at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
    	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    	at java.lang.ClassLoader.defineClass1(Native Method)
    	at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
    	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    	at java.net.URLClassLoader.defineClass(URLClassLoader.java:455)
    	at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
    	at java.net.URLClassLoader$1.run(URLClassLoader.java:367)
    	at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
    	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    	at com.iteye.injavawetrust.dj.ClickMyPage.main(ClickMyPage.java:15)
    Caused by: java.lang.ClassNotFoundException: org.w3c.dom.ElementTraversal
    	at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
    	at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
    	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    	... 37 more

            解决办法:pom中添加依赖

    <dependency>
    	<groupId>xml-apis</groupId>
    	<artifactId>xml-apis</artifactId>
    	<version>1.4.01</version>
    </dependency>

            问题解决。

  • 相关阅读:
    内联表值函数FUNCTION
    视图
    公用表表达式(CTE)
    关于TOP (n) WITH TIES的运用
    Python类变量和实例变量(类属性和实例属性)
    方差、协方差、相关系数(转载)
    Fama-French三因子模型
    (转载)什么是阿尔法和贝塔
    Macaca 环境搭建
    UIRecorder + Macaca 自动化测试 Android
  • 原文地址:https://www.cnblogs.com/new0801/p/6146667.html
Copyright © 2011-2022 走看看