tomcat运行时候报错:

java.lang.NoClassDefFoundError: org/jaxen/JaxenException
    at org.dom4j.DocumentFactory.createXPath(DocumentFactory.java:230)
    at org.dom4j.tree.AbstractNode.createXPath(AbstractNode.java:207)
    at org.dom4j.tree.AbstractNode.selectSingleNode(AbstractNode.java:183)

代码是

Element element=(Element) document.selectSingleNode("//user[@username='"+username+"' and @password='"+password+"']");

主要原因是:

使用dom4j解析XML时,要需要以下两个包:
dom4j-1.6.1.jar
jaxen-1.1.2.jar

我只导入了dom4j-1.6.1.jar

后来重新导入 jaxen-1.1.2.jar

问题就没有了

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-29
  • 2022-01-10
  • 2021-10-26
  • 2021-04-24
  • 2021-06-23
猜你喜欢
  • 2021-12-14
  • 2022-12-23
  • 2021-07-10
  • 2022-12-23
  • 2021-05-12
  • 2022-12-23
相关资源
相似解决方案