|
Hey
Joe,
I think that I have seen this problem before... Just to
make sure I understand the problem... you will create a war file and when you
open it in winzip it doesn't appear to have everything you expect to have in it.
But then... if you do an unzip from the command line everything is unzipped from
it just fine.
Is that basically what you are seeing?
I saw this at my previous employer and never could figure
out what was causing it... I can't remember for certain but I think it
happened when we were using the ant tasks zip, jar, and war (they all had the
problem).
Right now we are using the jar command to build our war.
Probably because we have the web.xml in the director we are warring and don't
appreciate the warning that ant spits out (maybe there is a way to disable
that...).
Are you
using Ant to build your war? What version? What JDK are you
using?
We were using jdk
1.3.1 from IBM with ant 1.4 (I think) when we saw this
problem...
I can't say that I
have seen this problem when using a sun JDK... (also now using ant
1.6).
Hope this
helps...
Abraham Fathman
I thought I’d toss this out in case
anyone has any thoughts or experience. I’ve found that with some WAR files
(produced in a way that I’m still investigating), there are not entries in the
WAR’s table for directories; whereas with WARs I create with jar and winzip and
my command-line zip, there are directory entries. For example, in the
output below from a normal war, you can see an entry for WEB-INF/
itself.
Why does this matter? Well it
comes up when we use ServletContext.getResourcePaths. On Tomcat,
WebSphere, WebLogic 8.1 SP2, etc. we are able to get a list of the files in the
dir WEB-INF/bob by calling getResourcePaths and passing in
“/WEB-INF/bob/”. Works fine. However, with WLS SP4, they made a
“fix” and now for the abnormal WARs (those without dir entries), this doesn’t
work!
The workaround is to unjar/zip, then
rejar/zip the war, or even just update the files in the bob dir using jar,
winzip, zip. But who is at fault here? Is it a WAR/jar requirement
to have directory entries in the WAR? In which case the problem is with the
creator of these abnormal WARs. Or is this a regression in
WLS?
> jar tf Bob_bad.war | grep
WEB-INF
WEB-INF/
WEB-INF/classes/
WEB-INF/classes/Message.properties
…
WEB-INF/bob/
WEB-INF/bob/Bob1.xml
WEB-INF/bob/Bob2.xml
WEB-INF/web.xml
http://e-docs.bea.com/wls/docs81/notes/new.html#1202654
Thanks,
Joe
|