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>

            问题解决。

  • 相关阅读:
    Mysql常用语句
    关于nginx的一个错误操作记录
    windows下安装ElasticSearch
    在IIS托管服务中设置Rewrite重定向到webapi接口
    asp.net IHttpHandler浅析
    asp.net IHttpModule浅析
    vscode 创建.net core项目初体验
    批量联表更新
    mysql 关于数据库和数据表的基本操作
    mysql Navicat客户端
  • 原文地址:https://www.cnblogs.com/muyuge/p/6152063.html
Copyright © 2011-2022 走看看