Reputation: 341
I just started learning Java EE and came across this error when attempting to deploy a WAR file on my tomcat server.
This error happens every time I use the manager application to deploy a WAR. When I select the file located at C:\Users\julex_000\workspace\application\target\application-0.0.1-SNAPSHOT, Tomcat sets it's name as /C:Usersjulex_000workspaceapplicationtargetapplication-0.0.1-SNAPSHOT. It then creates a file called C in the Tomcat8.0\webapps folder and when I try to start the application it fails every time. The invalid ':' seems to be the colon after C in the path C:\Users\... I also get an IOException about this:
This error only occurs when using the manager application. When I copy and paste the WAR into the webapps directory it works just fine.
Upvotes: 0
Views: 3356
Reputation: 4296
It is simply not allowed to have a :
in the context path.
At the deployment you have to pass a valid context path.
For example if you are using the tomcat manager ui: You have to set the field Context Path and the WAR or Directory URL (the lokal path on the application server where tomcat can find the war file; If you tomcat is not on your localhost you have to move the war file manually and use the path on the server).
If you are using the form with the upload field in the ui, there is no input field where you can pass the context path, but tomcat will use the filename of the war (not the complete path) as context path.
At last but not least if you are using the non-ui-api you can just send your war file with a http put request and pass the url parameter path
. You can find more information about this in the Documentation.
Upvotes: 1