Closed mikycol closed 6 years ago
Are you putting the database inside a JAR? If so, you may be running into https://github.com/maxmind/MaxMind-DB-Reader-java#packaging-database-in-a-jar
No, I'm not putting it inside the jar.
Any suggestions?
I just tested out the test.mmdb
generated by your script and it works fine for me. Here is my Java code:
import com.fasterxml.jackson.databind.JsonNode;
import com.maxmind.db.Reader;
import java.io.File;
import java.io.IOException;
import java.net.InetAddress;
public class Test {
public static void main(String[] args) throws IOException {
File database = new File("test.mmdb");
Reader reader = new Reader(database);
InetAddress address = InetAddress.getByName("1.1.1.1");
JsonNode response = reader.get(address);
System.out.println(response);
reader.close();
}
}
Please verify that you have the latest version of this library and that the database has not been modified.
I begin to think that there is something wrong with the generation and not with reading. Can you send me the database you used?
Thank you
I just ran your script. If you provide me with your email address, I can send you the file. You could also run mmdbverify on your file.
My mail is mikycol AT gmail DOT com
Thank You very much
I've created a test database and I'm trying to use it with the Java API, but I always get the following error:
I use the following code for reading:
This is the code used to write the custom database:
The same database works perfectly in perl and python
I don't understand what i did wrong
examples.zip