Strange behaviour: war files corrupted during upload

W

werner55

Hello folks,

maybe someone can help me, I am facing a strange tomcat behaviour. I
work on a servlet, compiling it with ant as a war file. The output war
file contains

/META-INF
- MANIFEST.MF
/WEB-INF
- classes
- lib
- ~ config files
- etc

There seems nothing to be unusual, I can unpack the war file by hand
with no problems. Then I want to deploy it with the tomcat manager, do
the file upload, wait... nothing happens. I look up the logs and find
the following stack trace (just the upper half):

2004-08-23 17:05:35 StandardContext[/manager]HTMLManager:
managerServlet.extract[null.war]
java.util.zip.ZipException: No such file or directory
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:112)
at java.util.jar.JarFile.<init>(JarFile.java:117)
at java.util.jar.JarFile.<init>(JarFile.java:82)
at org.apache.catalina.manager.ManagerServlet.extractXml(ManagerServlet.java:1509)
at org.apache.catalina.manager.HTMLManagerServlet.doPost(HTMLManagerServlet.java:234)

OK, it seems to have problems unpacking the war file. So I change into
the webapps directory, find the recently uploaded .war file and try to
unpack it by hand - nothing happens, jar tvf shows no contents. Diff
tells me there a differences, I open the file in Emacs and see a
strange header in the uploaded file. I cannot read binaries but after
deleting it, the file could be unpacked, the servlet works fine.

I don't know why this happens, I currently run a Mac OS X machine and
tried Safari and IE 5 for uploading, I also try my Win XP machine with
IE 6, but the same results. Does anyone have a clue how this can
happen? It doesn't seem to be the browser and the input file is
correct (btw: I tried two tomcats on different machines as well, each
is a tomcat 5.0.27).

The problem is no lethal as I have access to the webapps directory on
the server, but war deployment is much nicer...

Thanks in advance for any help!
Werner
 
M

micromuncher

werner55 said:
Hello folks,

maybe someone can help me, I am facing a strange tomcat behaviour. I
work on a servlet, compiling it with ant as a war file. The output war
file contains

Are you using an ant filter to copy jars before the war? It is likely
that copy is corrupting the jars. Only use filter on text files.
 
Joined
Mar 14, 2007
Messages
1
Reaction score
0
Just for information, I got a very similar error with Tomcat 5 (on openSuSE 10.2). It was my own fault, I had been zipping up my own web contents and renaming the zip file to a war file. As with repeated operations, I got a bit confused at one point and renamed my file to .jar instead of .war (without realising it) - then I got the null.war error when trying to deploy with the manager app. There was no clue as to my actual mistake on the Tomcat log file, just the error message given above.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top