Ant Tomcat 7 Reboot FileNotFoundException

I am trying to reload a web application from ant. but I did not get the error:

D:\project\triplelands\ocbcfilesending\src\com.ocbcmcd.monitoring\build.xml:90: java.io.FileNotFoundException: http://localhost:8080/manager/reload?path=%2Fhello 

I will also try direct access: http: // localhost: 8080 / manager / reload? Path = / hello I got a 404 error code from my browser:

My configuration:

My Ant Script

 <target name="deploy-realod" depends="deploy" description="Reload application in Tomcat"> <reload url="${tomcat.manager.url}" username="${tomcat.manager.username}" password="${tomcat.manager.password}" path="/${name}" /> </target> 

build.properties

 appserver.home=C:/appserv/apache6 #for Tomcat 5 use $appserver.home}/server/lib #for Tomcat 6 use $appserver.home}/lib appserver.lib=${appserver.home}/lib deploy.path=${appserver.home}/webapps tomcat.manager.url=http://localhost:8080/manager tomcat.manager.username=root tomcat.manager.password=root 

Tomcat user configuration

 <user name="root" password="root" roles="admin-gui,manager-gui,tomcat,role1" /> 

thanks for the advice

+4
source share
3 answers

I also ran into this problem, moving a project that I worked on from Tomcat 6 to Tomcat 7. In fact, there were changes in the manager's URL, where it was divided into several, the use of each dependency on how you interact with it :

 * /manager/html for the HTML GUI * /manager/text for the text interface * /manager/jmxproxy for the JMX proxy * /manager/status for the status pages 

In the case of ant, you want to use / manager / text. So, you will need to edit the build.properties file, for example:

 tomcat.manager.url=http://localhost:8080/manager/text 

Hope this helps!

+12
source

To make it work with Tomcat 7, you need the following:

build.xml

 <path id="catalina-ant-classpath"> <!-- We need the Catalina jars for Tomcat --> <!-- * for other app servers - check the docs --> <fileset dir="${appserver.lib}"> <include name="catalina-ant.jar"/> <include name="tomcat-coyote.jar"/> <include name="tomcat-util.jar"/> <include name="tomcat-juli.jar"/> </fileset> </path> 

build.properties

 tomcat.manager.url=http://localhost:8080/manager/text tomcat.manager.username=tomcat tomcat.manager.password=s3cret 

cat-users.xml

 <user name="tomcat" password="s3cret" roles="manager-script"/> 

greetings, alexi

+5
source

The tomcat user configuration in tomcat 7.0 should be like this:

 <role rolename="tomcat"/> <role rolename="manager"/> <role rolename="manager-script"/> <role rolename="manager-gui"/> <role rolename="standard"/> <user username="admin" password="admin" roles="tomcat,manager,standard,manager-script,manager-gui"/> </tomcat-users> 
+1
source

Source: https://habr.com/ru/post/1341925/


All Articles