Connection refused: connect

By: Ramlak  

If you are seeing this ' Connection refused: connect' error in your tomcat stdout log file then I am sure it keeps repeating quite frequently and your log file grows tremendously due to this error.

This error may not be affecting the functionality of your webapps but it will affect the performance of the tomcat and slow it down. The main cause of this error is due to some sort of http monitor setting in your tomcat web.xml file. The complete error looks like this. Connection refused: connect
at Method)
at Source)
at Source)
at Source)
at Source)
at Source)
at Source)
at Source)
at Source)
at<init>(Unknown Source)
at Source)
at Source)
at Source)
at Source)
at Source)
at Source)
at org.netbeans.modules.web.monitor.server.NotifyUtil$

This happens as soon as you add an external server to Netbeans, and tell it to monitor the HTTP traffic, it will install a Filter to apply to all HTTP requests, to pass directly to Netbeans, so that it may show it in the Monitor. This is a good thing, when Netbeans is running. However, as soon as Netbeans isn't running, your performance will fall dramatically, as the Tomcat server tries to connect to a non existing Netbeans, and pay the penalty of waiting to find that out, for every single HTTP request.

Now you may tell me, I never did anything like that. I dont even know what netbeans is etc. etc. Whatever is the case, just follow the steps I have listed here and this problem will be resolved.

  1. Stop the Tomcat if it is running.
  2. Second goto the Tomcat Install Directory, and into the common directory, and then into libs. Inside here you will see a file called "org-netbeans-modules-web-httpmonitor.jar". Delete this or move it. It should not be in this directory.
  3. Third you need to edit the web.xml file inside the conf directory in the Tomcat Install Directory. You are looking for a block of XML that says something very similar to

    </filter-mapping>Delete that block from the file, and save it.
  4. Finally, you can restart Tomcat, and you will no longer see that error again.

Archived Comments

1. ChrisFem
View Tutorial          By: ChrisFem at 2017-08-18 04:23:59

2. I am getting this error with Minecraft; Feed the Beast Launcher. I do not have TomCat, and do not kn
View Tutorial          By: LadyKianna at 2013-03-11 05:52:54

3. Thanks, I've been looking for this answer for months, and you give me a nice solutions. Thanks again
View Tutorial          By: Harun at 2011-11-08 07:26:12

4. I faced an exception " Connection refused", and the fix to my pr
View Tutorial          By: Sandhya Rani Vellanki at 2010-11-15 00:39:24

5. I deploy a project in apache tomcat and backend to project is when i tried to retrive t
View Tutorial          By: satish at 2010-08-04 05:31:59

6. Check this article (
View Tutorial          By: Shahriar Nour Khondokar at 2010-07-07 06:28:59

View Tutorial          By: MAEN ZIAD HUDAIB at 2009-07-01 01:55:28

8. I am facing the same problem but org-netbeans-modules-web-httpmonitor.jar\". is already not ad
View Tutorial          By: Anonymous at 2009-05-08 07:59:09

Most Viewed Articles (in JSP )

Latest Articles (in JSP)

Comment on this tutorial