Strange behaviour: war files corrupted during upload

Discussion in 'Java' started by werner55, Aug 24, 2004.

  1. werner55

    werner55 Guest

    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

    - 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] No such file or directory
    at Method)
    at java.util.jar.JarFile.<init>(
    at java.util.jar.JarFile.<init>(
    at org.apache.catalina.manager.ManagerServlet.extractXml(
    at org.apache.catalina.manager.HTMLManagerServlet.doPost(

    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!
    werner55, Aug 24, 2004
    1. Advertisements

  2. micromuncher

    micromuncher Guest

    werner55 wrote:
    > 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

    > 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.
    micromuncher, Jan 11, 2005
    1. Advertisements

  3. markw


    Mar 14, 2007
    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.
    markw, Mar 14, 2007
    1. Advertisements

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Miguel De Anda

    Config files in .war files?

    Miguel De Anda, Aug 14, 2003, in forum: Java
    Miguel De Anda
    Aug 15, 2003
  2. Andy Fish
    Andy Fish
    Jun 23, 2004
  3. Stephan Koser
    Juha Laiho
    Dec 7, 2004
  4. Replies:
  5. Replies:

Share This Page