Maxmind's Java API getOrg causes IOExceptions when in Google App Engine, but not in standard Java

StackOverflow https://stackoverflow.com/questions/17791260

  •  03-06-2022
  •  | 
  •  

Question

I bought a site license for the GeoIP ISP database from Maxmind, and decided to implement it within my Google App Engine project.

I tested my own External IP with a regular Java project which used the same API/JAR and was able to resolve it to Comcast.

Implementing it within Google App Engine has been a pain. Using the same exact call (my own external IP), I received various IOExceptions, specifically EOFExceptions whenever using the standard LookupService (read from file) and OutOfBoundsArrayExceptions whenever using the memory-based LookupService.

Some specific information: The database file size should NOT be an issue. It is around ~3mb. You can find the API open sourced here : https://github.com/maxmind/geoip-api-java

I will eventually figure out this issue but it seems to be fairly low-level so it may take some time. I was wondering if anyone else had any issues.

UPDATE- I've just confirmed the .dat file's MD5 changes whenever checked using Commons Codec 1.8 DigestUtils.md5Hex.

It is different from the working files' MD5.

Was it helpful?

Solution

Fixed...

For some reason, having the .dat file in my WEB-INF was altering it significantly. The MD5 checksum was not the same.

Taking it one root above to my "webapp" folder which housed WEB-INF somehow escaped the changing of the file and the MD5 validated...

Might have to file a bug with Google for this one, or I'm misunderstanding something entirely...

UPDATE: Upon further introspection I've decided that it might of been the text set that my WEB-INF was using... UTF-8. This is the only thing I can think of.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top