问题
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!
回答1:
As per above:
SOLUTION: Remove the files with "|" in the file name and voila the WAR file deploys successfully!
回答2:
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
回答3:
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
来源:https://stackoverflow.com/questions/14599507/error-deploying-java-war-file-severe-exception-fixing-docbase-for-context