Parsing XML report ClassNotFound errors

Source: Internet
Author: User

When parsing XML using DOM4J, it is a good idea to get the data for a node quickly, and Dom4j's quick manual also suggests that

In this way,

method is to use the selectnodes (String XPath) method of document.

selectSingleNode (String XPath)

Code notation:

list<?> list = Document.selectnodes ("//books/book");

The following exception was thrown when executing:

Exception in thread "main" 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.selectNodes (abstractnode.java:164)

How can such a good way to throw an exception, trace the past to see, unexpectedly is "List L = doc.selectnodes ("//cols/col1 ");

This error, check a bit to know, not only to have dom4j this bag, but also to have jaxen bag: <jaxen-1.1-beta-6.jar>

It should be DOM4J's base package, which can be found in the Lib directory of the dom4j Zip package. Even with this method, the following two packages are required:

Dom4j-1.6.1.jar
Jaxen-1.1.jar

Parsing XML report ClassNotFound errors

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.