[Geoip-java] GeoIP Java Api problem
Brought to you by:
tjmather
From: Dejan M. <D....@pa...> - 2011-08-25 14:16:47
|
Dear ladies and gentlemen, We would like to use the GeoIP Java API together with GeoIpCity DB. For some tests I installed localy the lite version of GeoIPCity DB and also downloaded and compiled all classes into a JAR file. This dependency is then used in some of my unit tests (I just wanted to try the API). I loaded the database and created instance of LookupService. // Read binary database from local classpath String fileName = GeoIpApiTest.class.getClassLoader().getResource("GeoLiteCity.dat").getPath(); fileName = fileName.substring(1); // Create lookup service ls = new LookupService(fileName, LookupService.GEOIP_MEMORY_CACHE | LookupService.GEOIP_CHECK_CACHE); Then I tried to call some basic methods like: Country country = ls.getCountry("151.38.39.114"); Unfortunatelly I am always getting ArrayOutOfBoundException: java.lang.ArrayIndexOutOfBoundsException: -12636850 at com.maxmind.geoip.LookupService.getCountry(LookupService.java:503) at com.maxmind.geoip.LookupService.getCountry(LookupService.java:456) We would like to buy the licence for binary database and also to use update functionality with job written in C. Can you help me by this problem? p.s. I also tried to put all java files into default package but this was not working either. Any ideas? Thank you very much for further help. best regards / Mit freundlichen Grüßen Dejan Music Dipl.-Ing. Dejan Music Senior Software Developer paysafecard.com Wertkarten AG Am Euro Platz 2, A-1120 Wien mobile: +43 676 / 765 71 43 skype: dejan.music_paysafecard mail: d....@pa...<mailto:d....@pa...> web: www.paysafecard.com<http://www.paysafecard.com/> Firmenbuch: FN 194434h Handelsgericht Wien ---------------------------------------------------------------------------------------- IMPORTANT CONFIDENTIALITY NOTICE The information in this e-mail is confidential and is intended solely for the addressee. Access to this e-mail by anyone else is unauthorised. If you are not the intended recipient any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it is prohibited and may be unlawful. Please also contact the sender and delete the material from any computer. |