Java SAXBuilderJDOM给出了异常

Java SAXBuilderJDOM给出了异常,java,xml,sax,jdom,Java,Xml,Sax,Jdom,代码如下: Representation representation = representItem(exp.getItem(),MediaType.TEXT_XML); Document doc = new SAXBuilder().build(representation.getStream()); XPath xpath = XPath.newInstance("/xnat:MRSession/xnat:scan/xnat:file");

代码如下:

Representation representation = representItem(exp.getItem(),MediaType.TEXT_XML);

            Document doc = new SAXBuilder().build(representation.getStream());
            XPath xpath = XPath.newInstance("/xnat:MRSession/xnat:scan/xnat:file");
在实例化SAXBuilder时,这给了我一个InvocationTargetException错误

以前有人吃过这个吗?看来这应该行得通

2012-08-07 17:17:58,441 [http-8080-1] ERROR org.restlet.XNATVirtualHost.XNATApplication - Unhandled exception or error intercepted
java.lang.NoClassDefFoundError: org/jdom/input/SAXBuilder
    at org.nrg.xnat.restlet.actions.SessionCopy.<init>(SessionCopy.java:98)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
2012-08-07 17:17:58441[http-8080-1]错误org.restlet.XNATVirtualHost.XNATApplication-未处理的异常或截获的错误
java.lang.NoClassDefFoundError:org/jdom/input/SAXBuilder
位于org.nrg.xnat.restlet.actions.SessionCopy(SessionCopy.java:98)
位于sun.reflect.NativeConstructorAccessorImpl.newInstance0(本机方法)
位于sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
在sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

我想说,虽然可能在构建路径中,但它不在运行路径中。

向我们展示堆栈跟踪。xml输入也可能有帮助。我添加了日志,但是SAXBuilder包在buildpath中。jar在我的buildpath中,我正在使用eclipse。我不确定我是否知道runpath是什么意思?下载最新的jdom.jar。如果您是从构建的同一个项目运行NNG,那么应该已经设置了依赖项。签入运行配置…->失败的运行配置的类路径。我认为这是一个非常可靠的分支:)