I have a web application which has following structure (partial).
Project Name src/main/java com.package MainFile.java src/main/resources
Try this:
ClassLoader loader = SomeClass.class.getClassLoader(); InputStream is = loader.getResourceAsStream("sample.xml")); byte[] b = null; int numBytes = is.read(b);
resources should be in the classpath and ClassLoader should find it for you.