0

January 12

Connection refused

Posted by Ajay

Have you ever encountered a “Connection Refused” error and beaten your head around to figure out what in the world was happening? Well I found myself sailing in the same boat, just 6 hours before a client demo, a day after I had an outpatient surgery.

What was the issue?

Our application was a web based GIS decision support system. We have a web mapping server that renders out WMS and WFS responses. We have a caching layer, a servlet that caches responses from the web mapping server and connects to it through a URLConnection. Our application is SSL based i.e. we use https. We had a demo scheduled for a client when lo and behold Mr murphy strikes.

We were able to access our application, login to it and perform most of the task. But when accessing a particular cachable GIS layer, bada bing!! … we got the notorious

java.net.ConnectException: Connection refused

So how did we tame the beast ?

So we followed the myriads of steps described in tons of forums:

1. Check apache’s httpd.conf (or ssl.conf if you have SSL configured) configuration and check if the VirtualHost matches the Listen address and port

2. Check if the JkWorkers is defined correctly

3. Check if JkMount mounts the addresses correctly matching the right URL to the right Runner that is defined in the workers file.

Finally we hit jackpot when we found out the real reason for the issue - our hosts table was screwy with incorrect IP address settings

THis leads us to another mystery — how did everything else work and the failure happened only when URLCOnnection was invoked ?? , Sherlock Holmes wanna take the case??

Copyright © 2010 “An Image of My Life” blog series All rights reserved. Theme by Laptop Geek.

Total hits: 38485