0

Here is the code:

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");

This gives me a InvocationTargetException error when SAXBuilder is instantiated.

Anyone have this before? Seems like this should work.

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)
rpfujiw
  • 57
  • 1
  • 10

1 Answers1

1

I'm going to go out on a limb here and say that while SAXBuilder may be in your build path, it is not on your run path.

Reimeus
  • 158,255
  • 15
  • 216
  • 276
  • the jar is in my buildpath, I'm using eclipse I'm not sure I know what you mean by runpath? – rpfujiw Aug 07 '12 at 23:03
  • Download the latest jdom.jar. If you are runnng from the same project that you build from then the dependencies should already be set up. Check in Run Configurations...->Classpath for the failing run config. – Reimeus Aug 07 '12 at 23:42
  • That's a pretty solid limb, methinks :) – forty-two Aug 08 '12 at 00:43