Error when tomcat is running:
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)
the code is
Element element=(Element) document.selectSingleNode("//user[@username='"+username+"' and @password='"+password+"']");
The main reason is:
When parsing XML with dom4j, the following two packages are required:
dom4j-1.6.1.jar
jaxen-1.1.2.jar
I only imported dom4j-1.6.1.jar
Later re-import jaxen-1.1.2.jar
the problem is gone