Make sure that the file name is correct and that the file is actually in the class path. getResourceAsStream()
will return null if this is not the case which causes the last line to throw the exception.
If myProp.properties is in the root directory of your project, use /myProp.properties
instead.