Indeed for NetBeans this codepath should not be hit. If permissions were somehow messed with though, the file might indeed be unreadable and thus explain why the "load from classpath" route is taken.
Storing configuration in the environment is one of the tenets of a twelve-factor app. Anything that is likely to change between deployment environments–such as resource handles for databases or ...