Error when starting Windows Service: Connection "actively refused"

MegaMatt asked:

I have used .NET to create a service installation package (msi) that, when run, installs a Windows service designed to run an instance of Apache Solr (to aid in searching from a web application). I am running the service on the same machine where Solr is hosted. When I start it up, I get:

Service cannot be started. System.Net.WebException: Unable to connect to the remote server —> System.Net.Sockets.SocketException:
No connection could be made because the target machine actively
refused it [MachineIP]:8983 at
System.Net.Sockets.Socket.DoConnect(EndPoint endpoingSnapshot,
SocketAddress socketAddress) at
System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure,
Socket s4, Socket s6, Socket& socket, IPAddress& address,
ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout,
Exception& exception)
— End of inner exception stack trace — at System.Net.HttpWebRequest.GetResponse() at
SOLRService.SolrService.OnStart(String[] args) at

Where [MachineIP] is the IP of the box. Again, I’m attempting to start this service from the same box it’s trying to connect to. I tried pinging its own IP, just for kicks, and it came back fine. I’m just not understanding why a server would actively refuse a connection to itself. We’ve been able to get this to work in development.


My answer:

Connection refused means that nothing is listening on that port (8983 in your case). Start the service which is supposed to listen for connections on that port.

View the full question and any other answers on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.