D'oh!
Turns out that the ant script (which I inherited - a minor excuse) was
importing a properties file that set the very same properties I tried to
define in the script, e.g., "tomcat.manager.username". Great minds name
alike, I guess. Properties being immutable, my changes were ignored. I
finally noticed the "Override ignored" messages when I ran ant in
verbose mode.
The script works a lot better now that it's actually using the values I set!
Anne
Anne Wilson wrote:
Hi,
I am trying to manage my tomcat webapp via ant, that is, start it, stop
it, list apps, etc. But I keep bumping up against an authentication
problem.
I have read this:
http://tomcat.apache.org/tomcat-5.0-doc/manager-howto.html#Configuring%20Manager%20Application%20Access
and several other similar documents and related FAQs, etc., but am
finding nothing that ties the error to this particular situation.
I have these and some other similar snippets in my build.xml:
<property name="tomcat.home" location="/opt/tomcat"/>
<property name="tomcat.manager.url"
value="http://localhost:8080/manager"/>
<property name="tomcat.manager.username" value="xxxx"/>
<property name="tomcat.manager.password" value="yyyyy"/>
<taskdef name="list" classname="org.apache.catalina.ant.ListTask">
<classpath>
<path location="${tomcat.home}/server/lib/catalina-ant.jar"/>
</classpath>
</taskdef>
<target name="list" description="List Tomcat applications">
<list url="${tomcat.manager.url}"
username="${tomcat.manager.username}"
password="${tomcat.manager.password}"/>
</target>
Ant's [tidied] output is this (I may have munged the html):
list:
[list] <html><head><title>Apache Tomcat/5.0.30 - Error
report</title><style> <h1>HTTP Status 401 - </h1> <b>type</b> Status
report</p><p><b>message</b> <u></u></p><p><b>description</b> <u>This
request requires HTTP authentication ().</u>
BUILD SUCCESSFUL
Total time: 1 second
I've checked the username and password multiple times against
tomcat-users.xml so I believe they are correct. (I didn't have it right
at first, and the error then was "Connection refused". That error went
away after I corrected them, so I think they are right now.)
I'm using java 1.5, tomcat 5.0.30, and ant 1.6.5 on Linux Fedora Core 5.
Any insights, suggestions or tips would be greatly appreciated!
TIA!
Anne
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]