In my SpringBoot application I have to read a Json file at this path src/main/resources/mock/fileName.json. I done it in this way
JsonReader jsonReaderStream = new JsonReader(new InputStreamReader(Objects.requireNonNull(ClassLoader.getSystemClassLoader().getResourceAsStream("./mock/fileName.json"))));
It works locally but when I deploy my docker file on Kubernetes and I try to read my Json file I received a NullPointerException. I use gradle for the build. I state that I am a beginner on gradle, docker and kubernetes.
Can anyone explain to me why it works locally but not on Kubernetes ?