Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error Deploying Java WAR File: SEVERE: Exception fixing docBase for context

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!

like image 209
Simon K Avatar asked Jan 30 '13 08:01

Simon K


2 Answers

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

like image 139
Simon K Avatar answered Nov 08 '22 15:11

Simon K


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

like image 42
Michael Fritzsche Avatar answered Nov 08 '22 16:11

Michael Fritzsche