I have resources in my java project under resources folder. When i use following ways [2] to load the resource it is working . But when i deploy my war in wildfly 9.x it says cannot find the file.avsc file. It gives the class path as[1]; How can i load resource files in jboss war?
[1]
java.io.FileNotFoundException: /content/ratha.war/WEB-INF/lib/core-0.0.1-SNAPSHOT.jar/avro_schemas/file.avsc (No such file or directory)
[2]
ClassLoader classLoader = getClass().getClassLoader();
ClassLoader classLoader = this.getClass().getClassLoader();
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
File file = new File(classLoader.getResource("avro_schemas/file.avsc").getFile());