Jetty Classpath, Ant vs Eclipse

30 views
Skip to first unread message

Thad

unread,
Dec 23, 2009, 12:23:03 PM12/23/09
to Google Web Toolkit, th...@mindwrap.com
I'm using GWT 2.0.0 on Linux with JDK 1.6 targeting JDK 1.5.0 (for
compatibility reasons with older Macs).

When I launch DevMode via Eclipse, all runs fine. It also runs fine
when deployed as a WAR file on Linux or on MacOS 10.5. However if I
launch DevMode via ant from the command line, my application's
services Impl's seem to choose a different classpath. Here's the code
snippet that throws an exception:

// Parse the XML.
InputSource source = new InputSource(bais);
XPathFactory factory = XPathFactory.newInstance();
XPath xpath = factory.newXPath();
String expression = "//page[@number='"+page+"']";
result = (Node)xpath.evaluate(expression, source,
XPathConstants.NODE);

The classes are imported from the JDK's javax.xml.xpath package.
The exception trace points to the last line of the above snippet:

00:01:21.111 [WARN] Error for /webclient/getImageServlet
java.lang.NoSuchMethodError: org.apache.xpath.XPathContext.<init>(Z)V
at org.apache.xpath.jaxp.XPathImpl.eval(XPathImpl.java:207)
at org.apache.xpath.jaxp.XPathImpl.evaluate(XPathImpl.java:476)
at com...getLayerPage(GetImageServlet.java:647)

This seems to indicate that when run from the command line the XPath
is being derived from Xalan, which does not have the particular
evaluate() method I'm using.

My ant project class path is

<path id="project.class.path">
<pathelement path="${java.class.path}/"/>
<pathelement path="${gwt.sdk}/gwt-user.jar" />
<pathelement path="${gwt.sdk}/gwt-dev.jar" />
...
<fileset dir="${third.party.libs}">
<include name="*.jar"/>
</fileset>
</path>

${third.party.libs} includes Xalan, JDOM, JAI, and other jars. Both
gwt-user.jar and gwt-dev.jar are in war/WEB-INF/lib. My devmode
target looks like the ones in the 2.0.0 samples.

Any ideas?

Reply all
Reply to author
Forward
0 new messages