Deploy to Tomcat with Ant - misleading error message
I'm using tomcat5.0.18 in my current testing of MyFaces, anyway I've recently been doing some refactoring of the build and I started getting error messages from tomcat like this
tomcat-deploy-app:
BUILD FAILED: /Users/Shared/Applications/Eclipse-3.0-M8/workspace/myfaces/build/cactus-webapp/build.xml:46:
Following error occured while executing this line
/Users/Shared/Applications/Eclipse-3.0-M8/workspace/myfaces/build/tomcat/tomcat-build.xmlf:12:
java.io.IOException: Server returned HTTP response code: 401 for URL:
http://localhost:8080/manager/deploy?path=%2Fmyfaces-cactus-tests
Total time: 5 seconds
Which made me very confused and frustrated as it took more than 30 minutes just to figure out that the login was invalid. Bone headed of me? Why of course, 401 means authentication is required so I should have picked up on it right away but I didn't. It would be great if the catalina-ant tasks would help out bone heads like me and just say 'hey idiot you did not provide a good uname/passwd combo'. Ah but alas I'm back on my soap box where it is so easy to get knocked down...
The build fragement looked like this, FYI.
<target name="tomcat-deploy-app" description="Deploy the App to Tomcat">
<deploy url="${tomcat.manager.url}"
username="${tomcat.manager.username}"
password="${tomcat.manager.password}"
path="${tomcat.context.path}"
war="file:${tomcat.war.file}"/>
</target>


I actually got the user name and password correct but set the property name in my build.xml to manager.user instead of manager.username - thanks to you it only took a few monents to fix.
Posted by Gordon Tytler on March 07, 2005 at 02:59 PM MST #