Closed ScXin closed 3 years ago
It sounds like you are inserting strings directly into the database. The MaxMind ASN database has a structure similar to the one in this example:
If you want to decode a database where the data is just a string, you will need to used maxmind-db
directly. I think something like this would work:
import com.maxmind.db.Reader;
import java.io.File;
import java.io.IOException;
import java.net.InetAddress;
public class Lookup {
public static void main(String[] args) throws IOException {
File database = new File("/path/to/database/custom-database.mmdb");
try (Reader reader = new Reader(database)) {
InetAddress address = InetAddress.getByName("24.24.24.24");
String result = reader.get(address, String.class);
System.out.println(result);
}
}
}
Closing as I believe the above should solve this and the issue isn't directly related to this package.
Hi,
I have used the com.maxmind.geoip2.geoip2-2.1.50 maven repo to match the asn info in Java. The used mmdb file is produced by mmdb writer(https://github.com/maxmind/mmdbwriter.git). However, this following error comes after the program run a range of time:
I don't know why this error happen. Who can help me?