GeoNames Home | Postal Codes | Download / Webservice | About 

GeoNames Forum
  [Search] Search   [Recent Topics] Recent Topics   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Problem with executing sample code on geonames webservice  XML
Forum Index -> FAQ - frequently asked questions
Author Message
Sam



Joined: 05/03/2008 06:58:28
Messages: 28
Offline

when i try to execute

ToponymSearchCriteria searchCriteria = new ToponymSearchCriteria();
searchCriteria.setQ("zurich");
ToponymSearchResult searchResult = WebService.search(searchCriteria);
for (Toponym toponym : searchResult.getToponyms()) {
System.out.println(toponym.getName()+" "+ toponym.getCountryName());
}


i get error :

Exception in thread "main" java.lang.NoClassDefFoundError: org/jdom/input/SAXBuilder
at org.geonames.WebService.search(Unknown Source)
at GeonameMain.main(GeonameMain.java:16)

Can anyone please help me in resolving this error??
I have added the geonames-0.5.jar.
but yet it is giving this error when i try to run the code.
marc



Joined: 08/12/2005 07:39:47
Messages: 3993
Offline

Sam

You need to put the jar file for jdom in your classpath.
You can download it from here (see in the section "requirements")
http://www.geonames.org/source-code/

Or from the jdom.org website :
http://www.jdom.org/

Marc

[WWW]
Sam



Joined: 05/03/2008 06:58:28
Messages: 28
Offline

Thanks for your guidance.

Sam


 
Forum Index -> FAQ - frequently asked questions
Go to:   
Powered by JForum 2.1.5 © JForum Team