Mega Matt 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
SocketAddress socketAddress) at
Socket s4, Socket s6, Socket& socket, IPAddress& address,
ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout,
— 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.
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.
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.