Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java.net.ConnectException: Connection refused: connect

 
Mike McMahon
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm getting a bit out of my league here, so please forgive me if it comes out a bit jumbled.

I am running a service that spans 2 servers. Requests come into the webserver (through servlet exec), and then depending on the request, data is returned from my dataserver, and dropped into a mapped drive on the webserver. This mapped drive is also accessible to the internet, and it's content can then be accessed by a browser.

That is what is supposed to happen. The servlet I'm running has worked for numerous other organizations (so I can rule problems associated with the application itself), but most other organization are 1)using Tomcat rather than servletexec, and 2)not having their service reach across 2 servers.

The error I get is:
java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:295)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:161)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:148)
at java.net.Socket.connect(Socket.java:425)
at java.net.Socket.connect(Socket.java:375)
at sun.net.NetworkClient.doConnect(NetworkClient.java:139)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:366)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:582)
at sun.net.www.http.HttpClient.<init>(HttpClient.java:292)
at sun.net.www.http.HttpClient.<init>(HttpClient.java:253)
at sun.net.www.http.HttpClient.New(HttpClient.java:321)
at sun.net.www.http.HttpClient.New(HttpClient.java:306)
at sun.net.www.http.HttpClient.New(HttpClient.java:301)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:463)
at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:454)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:556)
at GetMap.write(GetMap.java:144)
at OGCConnector.doPost(OGCConnector.java:95)
at OGCConnector.doGet(OGCConnector.java:144)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.newatlanta.servletexec.ServletExec.CallServletService(ServletExec.java:1672)
at com.newatlanta.servletexec.SERequestDispatcher.forwardServlet(SERequestDispatcher.java:274)
at com.newatlanta.servletexec.SERequestDispatcher.forward(SERequestDispatcher.java:191)
at com.newatlanta.servletexec.ApplicationInfo.processApplRequest(ApplicationInfo.java:1172)
at com.newatlanta.servletexec.ServerHostInfo.processApplRequest(ServerHostInfo.java:940)
at com.newatlanta.servletexec.ServletExec.ProcessRequest(ServletExec.java:1206)
at com.newatlanta.servletexec.ServletExec.ProcessRequest(ServletExec.java:1085)

Now I know that this probably isn't even a java problem, but I can barely understand the error enough to help me understand what the problem is. My gut feeling is that there is either a permissions problem across the 2 servers, or perhaps servlet exec is trying to send via a firewall-blocked port.

Does this error suggest any next steps to anyone?

Thanks for any help,

Mike
 
Jack Wiesenthaler
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It just means there is no listener (server) on the other end or perhaps a firewall blocked the outgoing request.
 
Naren Chivukula
Ranch Hand
Posts: 577
Java Notepad Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

May be some factors affect connectin to be not invoked.

1. If the other server is down
2. If the application requires some authentication


Regards,
Narendranath
 
Mike McMahon
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks to you both for your help!

Looks like I'm back to wrestling with firewalls and permissions. blech.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic