title: Java dom4j org/jaxen/NamespaceContext exception
body: <p>I have downloaded <a href="http://downloads.sourceforge.net/project/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar?r=http://sourceforge.net/projects/dom4j/files/dom4j/1.6.1/&amp;ts=1350474200&amp;use_mirror=garr" rel="nofollow noreferrer">dom4j-1.6.1</a> and added it to java's build path. I am also familiar with <a href="https://stackoverflow.com/questions/10897922/java-lang-noclassdeffounderror-org-saxpath-saxpathexception">java.lang.NoClassDefFoundError: org/saxpath/SAXPathException</a> but I keep getting an exception.</p>
  
  <p>Enclosed a snippet:</p>
  
  <pre><code>public class Parser {
      public static void parse(final String path) throws Exception {
          final SAXReader reader = new SAXReader();
          final Document document = reader.read(new File(path).toURI().toURL());
          if (document == null) return;
          List list = document.selectNodes("/");
          for (Object o : list)
              System.out.println(o);
      }
  }
  </code></pre>
  
  <p>When I run it, I get the following stack trace</p>
  
  <pre><code>Exception in thread "main" java.lang.NoClassDefFoundError: org/jaxen/NamespaceContext
      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)
      at Parser.parse(Parser.java:15)
      at Main.main(Main.java:6)
  Caused by: java.lang.ClassNotFoundException: org.jaxen.NamespaceContext
      at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
      ... 5 more
  </code></pre>
  
  <p>Any clue what causes the error?</p>