I'm going through the step by step Spring MVC introduction tutorial at
http://www.springframework.org/docs/MVC-step-by-step/Spring-MVC-step-by-step-Part-1.html
I am able to build and deploy the application successfully but when I attempt to list the running applications I get the following exception
C:\JavaProjects\springapp>
ant list
Buildfile: C:\JavaProjects\springapp\build.xml
list:
BUILD FAILED
C:\JavaProjects\springapp\build.xml:123: java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:529)
at java.net.Socket.connect(Socket.java:478)....
I have seen other topics similar to this on this forum but none have been able to resolve my issue. Some of the other threads include
https://coderanch.com/t/108375/tools/Failed-build-InstallTask-cannot-found
https://coderanch.com/t/428039/tools/Occuring-during-interacting-Tomcat-server
https://coderanch.com/t/109089/tools/ant-list-error
and on other forums
http://forum.springsource.org/showthread.php?t=25882&highlight=connection+refused
http://forum.springsource.org/showthread.php?t=19767&highlight=connection+refused
On researching this issue, I found that a possible issue is to do with
Tomcat Manager not running properly. However, I've verified that it is running i.e.
"http://localhost:8080/manager/html" takes me to the tomcat manager webpage and from there I can check e.g. server status and list applications
I can list the applications using:
"http://localhost:8080/manager/list" lists my running applications
OK - Listed applications for virtual host localhost
/springapp:running:0:springapp
/:running:0:ROOT
/manager:running:0:C:/apache-tomcat-5.5.31/server/webapps/manager
/webdav:running:0:webdav
/servlets-examples:running:0:servlets-examples
/tomcat-docs:running:0:tomcat-docs
/host-manager:running:0:C:/apache-tomcat-5.5.31/server/webapps/host-manager
/jsp-examples:running:0:jsp-examples
/balancer:running:0:balancer
My tomcat-users.xml file is:
<tomcat-users>
<role rolename="manager"/>
<role rolename="tomcat"/>
<role rolename="admin"/>
<role rolename="role1"/>
<user username="both" password="tomcat" roles="tomcat,role1"/>
<user username="tomcat" password="tomcat" roles="admin,manager"/>
<user username="springtomcat" password="s3cret" roles="admin,manager"/>
<user username="role1" password="tomcat" roles="role1"/>
</tomcat-users>
The relevant sections in the build.xml are:
<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" />
</fileset>
</path>
<taskdef name="list" classname="org.apache.catalina.ant.ListTask">
<classpath refid="catalina-ant-classpath" />
</taskdef>
<target name="list" description="List Tomcat applications">
<list url="${tomcat.manager.url}" username="${tomcat.manager.username}"
password="${tomcat.manager.password}" />
</target>
and the build.properties file is:
appserver.home=C:/apache-tomcat-5.5.31
# for Tomcat 5 use $appserver.home}/server/lib
# for Tomcat 6 use $appserver.home}/lib
appserver.lib=${appserver.home}/server/lib
deploy.path=${appserver.home}/webapps
tomcat.manager.url=http://localhost:8080/manager
tomcat.manager.username=tomcat
tomcat.manager.password=tomcat
As far as I can see, everything is configured correctly but I'm new to this so maybe you guys might see something. The only thing that I can think that may be the issue is that I'm behind a firewall, but I added the following lines to the 'catalina.properties' file and I'm still seeing the same problem.
http.proxyHost=
servername
http.proxyPort=
8080
http.proxyUser=
myusername
http.proxyPassword=
mypassword
Does it matter that the proxy port is the same as the port that Tomcat is running on?
Any help would be greatly appreciated. Tearing my hair out here!
Cheers