The JBoss-Tomcat combination does not expand the WAR file. Under these conditions, the getRealPath() method will return a null. This is within spec and caters for any situation where the deployment does not exist locally or where the individual files do not physically reside on local storage media (it is still packaged, or in a DB or otherwise accessed from a remote location).
You can use ServletContext.getResourceAsStream("/WEB-INF/MyFile.xml"). I think that is the correct style string but you need to experiment with this as it has been a long while since I did this and it was on SilverStream at the time, I think.