I have the same problem.
If we're both doing something wrong, or if you find a work around please let me know.
(I'm using jboss-3.2.0_tomcat-4.1.24 also)
I had the same problem on 3.2.1/Tomcat 4.1.24, and didn't find a solution or explanation.
Also I couldn't get the WAR to auto-unpack (the unpackWARs directive). My workaround has been Jetty, although I would prefer Tomcat.
I have asked this question about a year ago since JBoss 3.0.2.
http://www.jboss.org/modules/bb/index.html?module=bb&op=viewtopic&t= no reply.
Since that time, I use JBoss with Jetty.
It seems that the problem is not solved for a year.
Or no one aware of this?
I found the following in the servlet-2_3-fcs-docs for ServletContext.getRealPath():
"This method returns null if the servlet container cannot translate the virtual path to a real path for any reason (such as when the content is being made available from a .war archive)."
So if Tomcat accesses the resource that you pass as
argument to getRealPath() through a .war, getRealPath() will return null.
You have 3 alternatives now:
1. You unpack the .war file manually with jar xf and delete it afterwards.
2. In the Tomcat's config file `server.xml' you change the Host directive's argument from unpackWARs="false" to unpackWARs="true"
3. To get the resource regardless of it is in a .war or not use getResourceAsStream.