Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

403 error while deploying with tomcat client deployer

I have some trouble using Tomcat Client Deployer (TCD) with a local Tomcat installation. Specifically, I get a 403 error while trying to deploy a simple helloworld web application which leads me to the conclusion that something is not quite right with my tomcat-users.xml.

I just cannot see what it is.

here's the relevant build.xml snippet:

<!-- Configure the folder and context path for this application -->
<property name="webapp"   value="helloworld"/>
<property name="path"     value="/helloworld"/>
<!-- Configure properties to access the Manager application -->
<property name="url"      value="http://localhost:8080/manager/text"/>
<property name="username" value="deploymgr"/>
<property name="password" value="s3cret"/>

tomcat-users.xml:

</tomcat-users>
  <role rolename="manager-gui"/>
  <role rolename="manager-script"/>
  <role rolename="manager-jmx"/>
  <role rolename="manager-status"/>
  <role rolename="tomcat"/>
  <user username="deploymgr" password="s3cret" roles="manager-script"/>
  <user username="tomcat" password="tomcat" roles="tomcat, manager-gui, manager-jmx, manager-status"/>
</tomcat-users>

deployer.properties:

build=D:/apache-tomcat-7.0.16-deployer/work
webapp=D:/apache-tomcat-7.0.16-deployer/helloworld/
path=/helloworld
url=http://localhost:8080/manager
username=deploymgr
password=s3cret

and when I try to deploy the application, I get the following error message:

D:\apache-tomcat-7.0.16-deployer>ant deploy
Buildfile: D:\apache-tomcat-7.0.16-deployer\build.xml
Trying to override old definition of datatype resources

deploy:
     [echo] name: deploymgr, pass: s3cret, url: http://localhost:8080/manager

BUILD FAILED
D:\apache-tomcat-7.0.16-deployer\build.xml:92: java.io.IOException: Server returned HTTP response code: 403 for URL: http://localhost:8080/manager/deploy?path=%2Fhelloworld&update=true

only thing I find weird is that the error message URL contains a "%2F" instead of a forward slash... could it be that the user configuration is actually correct, I get the 403 simply because of the URL escape code? (I'm working under Windows Vista)

Can someone help me out on this? Oh, and of course the application deploys flawlessly through the user interface :-1

Thanks very much in advance.

like image 296
sphere Avatar asked Nov 13 '22 19:11

sphere


1 Answers

perhaps an update on this issue... I've made a mistake in the deployer.properties file. The parameter "url" has to be the same as in build.xml above.

deployer.properties correctly:

build=D:/apache-tomcat-7.0.16-deployer/work
webapp=D:/apache-tomcat-7.0.16-deployer/helloworld/
path=/helloworld
url=http://localhost:8080/manager/text
username=deploymgr
password=s3cret

now it works!

like image 167
sphere Avatar answered Dec 06 '22 03:12

sphere