An initial version of open source geonames code in java is now available. This very first part is a webservice client to consume geonames webservices. Deatails here : http://www.geonames.org/source-code/
And the corresponding blog entry :
http://geonames.wordpress.com/2006/09/23/geonames-source-code/