9

I have already resolved this one but it may help someone out there who stumbles across this problem. Stackoverflow has saved me countless hours on seemingly obscure and mysterious IT issues in the past.

Here is the error I was getting when deploying a WAR file to Tomcat on Windows. The WAR file was built on a Mac using JRuby & Warbler.

SEVERE: Exception fixing docBase for context [/XYZ] java.io.IOException: 
The filename, directory name, or volume label syntax is incorrect

According to others on SO the WAR file is corrupt and should not open via any of the Zip tools. This was not the case.

Instead, after many hours of investigation it turns out that I had a file in the Warbler path that had in the file name the pipe "|" character. This file name was not assigned intentionally While this is fine on a Mac, Windows does not like it.

SOLUTION: Remove the files with "|" in the file name and voila the WAR file deploys successfully!

Stephen C
  • 698,415
  • 94
  • 811
  • 1,216
Simon K
  • 111
  • 1
  • 1
  • 5
  • 1
    Thanks for the contribution, I think you should add the solution as an answer, and accept it. – ppeterka Jan 30 '13 at 08:26
  • You should provide this answer to a question that already exists on SO. At least, make the question and answer separate and accept it. – asgs Jan 30 '13 at 08:26
  • `According to others on SO the WAR file is corrupt and should not open via any of the Zip tools` - could you please point to any links or explain why they mentioned this? – Kevin Meredith Aug 29 '14 at 13:29
  • Great! I developed it on a mac and deployed it to a centOS server. My problem was there was a "-" in the war file name. I removed the "-" and the war file extracted successfully! :) – Robbie Oct 13 '14 at 09:56
  • @KevinMeredith because at least in my case the second line of the exception was: "java.utils.zip.ZipException: invalid block type" – SMSk Jul 15 '15 at 12:55

4 Answers4

2

As per above:
SOLUTION: Remove the files with "|" in the file name and voila the WAR file deploys successfully!

Stephen C
  • 698,415
  • 94
  • 811
  • 1,216
Simon K
  • 111
  • 1
  • 1
  • 5
1

I had a similar issue, but in my case is had some files ending with ":Zone.identifier" in the WAR. The files came as I copied some files from a Windows server directly to the project resources on a mapped folder of my Mac while I was in an rdp session. These files caused no problems on the mac and the WAR also deployed with no problems on the machine where these files came from. On all other windows machines the war was somehow corrupt due to the ":" in the filenames.

So don't only search for files with "|", also other chars can make this kind of trouble

Vivek Mishra
  • 5,669
  • 9
  • 46
  • 84
  • I encountered similar -- copying directly from Windows to Windows using RDP caused the error mentioned in the title. Copying to another folder on the target RDP desktop and then moving from that folder to the webapps directory fixed the issue. – Jake Jordan Oct 04 '18 at 16:53
1

In Windows 10 run as an administrator mode solve the issue for me

Bawantha
  • 3,644
  • 4
  • 24
  • 36
0

I had a similar issue,My problem was just the same as Robbie

so I think we should not add some strange character like "|" "-" to our war file name

lishuang
  • 81
  • 1