When using ColdFusion MX's web server configuration utility wsconfig on Linux servers, you may encounter a situation where wsconfig fails with a reference to could not connect to port 2901 as shown here:

Found port 2901 on host localhost
could not connect to port 2901 on host
javax.naming.ServiceUnavailableException: The connection to the remote
JNDI server on host at port 2901 has failed (as have all
backup hosts listed, if any) - please verify that the server is running
and the NamingService is available [Root exception is java.net.ConnectException: Connection refused]
{ java stack trace here }
Could not connect to any JRun/ColdFusion servers on host localhost.
Possible causes:
o Server not running
-Start Macromedia JRun4 or ColdFusion MX server
o Server running
-JNDI listen port in jndi.properties blocked by TCP/IP filtering or firewall on server
-host restriction in security.properties blocking communication with server

Following on some of the hints in the error message, some diagnostic questions include:

  • Is the ColdFusion MX server running?
  • Does the command netstat -a | grep 2901 list the open port?
  • Can you connect to the port using "telnet localhost 2901" ?
  • If not, is a firewall blocking the port? Try running the command lokkit to launch a program which can temporarily disable the firewall. Does wsconfig still fail when the firewall is off?
  • Is there any other program that might have been running and listening on port 2901?
  • Finally, check the HOST configuration files, including on Red Hat: /etc/hosts and /etc/sysconfig/network. Are there any mis-configurations in either one of these files? If so, try correcting it, then restart the network

Typically, when wsconfig fails with this error, one of these diagnostic steps will show up to be true. If you know of any other cause or resolution, please add a comment.