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

    /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
     
    werner55, Aug 24, 2004
    #1
    1. Advertising

  2. werner55

    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

    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.
     
    micromuncher, Jan 11, 2005
    #2
    1. Advertising

  3. werner55

    markw

    Joined:
    Mar 14, 2007
    Messages:
    1
    Location:
    Hampshire
    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
    #3
    1. Advertising

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
    Replies:
    2
    Views:
    405
    Miguel De Anda
    Aug 15, 2003
  2. Andy Fish
    Replies:
    0
    Views:
    302
    Andy Fish
    Jun 23, 2004
  3. Stephan Koser
    Replies:
    3
    Views:
    687
    Juha Laiho
    Dec 7, 2004
  4. Replies:
    3
    Views:
    744
  5. Replies:
    1
    Views:
    852
Loading...

Share This Page