I have a code that deals with elasticsearch index. One of its steps, the program needs to read a jsonschema file in order to continue its execution. The code works well on my machine, but when I execute it as jar file inside a docker container, it gives me the following error:
java.io.FileNotFoundException: dm.jsonschema (No such file or directory)
the code that loads the schema is:
public class loadSchema {
private static final String JSON_SCHEMA_DOCUMENT = "dm.jsonschema";
....
public static JsonSchema tryLoadJSONSchema() {
JsonSchemaFactory factory = JsonSchemaFactory.byDefault();
JsonNode cdmSchema = null;
try {
cdmSchema = JsonLoader.fromPath(JSON_SCHEMA_DOCUMENT);
} catch (IOException e) {
System.out.println(e);
System.exit(-1);
}
I placed the jsonschema file next to the jar file in the container, but it keeps giving me the same error. Any idea how to solve this problem?