Dom4j错误:java.lang.NoClassDefFoundError: org/jaxen/JaxenException .

  Dom4j可以使用Xpath来定位元素,具体可以使用selectNodes方法,但是在实际调用该类方法的时候出现了:java.lang.NoClassDefFoundError: org/jaxen/JaxenException,上述错误。

         通过在网上查找,原来是缺少jaxen包,然后到jaxen的网站上看了这个包的介绍,上面写的是:Jaxen is an open source XPath library written in Java.It is adaptable to many different object models, includingDOM, XOM, dom4j, and JDOM. Is it also possible to writeadapters that treat non-XML trees such as compiled Java byte code or Java beans as XML, thus enabling you to query these trees with XPath too.

         Dom4j之所以能够使用XPath来定位,其实是依赖了这个包,所以把这个包导入到工程中,就可以使用了。

         jaxen包的官网地址 http://jaxen.codehaus.org/
posted @ 2014-11-14 12:31  ℡﹏嗳つ゛  阅读(270)  评论(0编辑  收藏  举报