I am trying to use the MaxMind java library with ColdFusion.
I am starting to convert this sample code to the official MaxMind website:
File database = new File("/path/to/GeoIP2-City.mmdb");
DatabaseReader reader = new DatabaseReader.Builder(database).build();
InetAddress ipAddress = InetAddress.getByName("128.101.101.101");
CityResponse response = reader.city(ipAddress);
Country country = response.getCountry();
I tried:
var file = "pathto\maxmind\GeoLite2-City.mmdb";
var db = createObject("java","java.io.File").init(file);
var mm = createObject("java", "com.maxmind.geoip2.DatabaseReader")
.Builder(db)
.build();
dump(c);abort;
I got this error:
Type: java.lang.NoSuchMethodException
Messages: No matching Method for Builder(java.io.File) found
for com.maxmind.geoip2.DatabaseReader
What am I doing wrong?
source
share