From OpenNMS
There may be cases where it is not possible to run Tomcat on port 8080. The official documentation provides little help for a user in this situation. This wiki attempts to address both how to to configure Tomcat for these cases and what pitfalls result from this action. These instructions are for Tomcat 4.1.
To configure Tomcat4 to run on port 8081, for example, all that is needed is a small change to Tomcat's server.xml (TOMCAT_HOME/conf/server.xml). Find the Connector tag with a className of "org.apache.coyote.tomcat4.CoyoteConnector". The easiest way to do this might be to search for the string "8080". This tag will have a modifier called "port" whose value is "8080". Simply change the value to "8081". It doesn't hurt to change any comments in this file referring to port 8080 as well. Once this change is made, restart Tomcat and you will find it listening on 8081 rather than 8080.
The most confounding pitfall, and one for which the author was unable to find a solution after considerable searching, is that the OpenNMS RTC daemon (Rtcd) insists on trying to connect to Tomcat on port 8080 to post category information. Symptoms of this problem seem to start with the webUI thinking that OpenNMS is down even when "OPENNMS_HOME/bin/opennms status" reports that all components are running. Clicking on any of the category links on the webUI front page will result in a traceback starting with a CategoryNotFoundException. Looking in OPENNMS_HOME/logs/rtc.log, you may see messages like this:
2006-01-19 17:08:19,549 WARN [RTC Updater Pool-fiber1] DataSender: DataSender: Unable to send category 'Network Interfaces' to URL 'http://localhost:8080/opennms/rtc/post/Network+Interfaces':
java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
at java.net.Socket.connect(Socket.java:452)
at java.net.Socket.connect(Socket.java:402)
at sun.net.NetworkClient.doConnect(NetworkClient.java:139)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:402)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:618)
at sun.net.www.http.HttpClient.<init>(HttpClient.java:306)
at sun.net.www.http.HttpClient.<init>(HttpClient.java:267)
at sun.net.www.http.HttpClient.New(HttpClient.java:339)
at sun.net.www.http.HttpClient.New(HttpClient.java:320)
at sun.net.www.http.HttpClient.New(HttpClient.java:315)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:521)
at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:498)
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:569)
at org.opennms.core.utils.HttpUtils.post(HttpUtils.java:225)
at org.opennms.netmgt.rtc.DataSender.subscribe(DataSender.java:294)
at org.opennms.netmgt.rtc.DataUpdater.handleRtcSubscribe(DataUpdater.java:334)
at org.opennms.netmgt.rtc.DataUpdater.processEvent(DataUpdater.java:483)
at org.opennms.netmgt.rtc.DataUpdater.run(DataUpdater.java:511)
at org.opennms.core.concurrent.RunnableConsumerThreadPool$FiberThreadImpl.run(RunnableConsumerThreadPool.java:412)
at java.lang.Thread.run(Thread.java:534)
The solution to this problem is to edit the file OPENNMS_HOME/webapps/opennms/WEB-INF/web.xml. Find the context-param entity whose param-name is "opennms.rtc-client.http-post.base-url". This entity will have a param-value of "http://localhost:8080/opennms/rtc/post". Change this param-value so that it reads "http://localhost:8081/opennms/rtc/post". Restart Tomcat (this step may not be strictly necessary) and Rtcd should start to work, though it may take some time to come up.






