Monday, March 25, 2013

[Solution] java.net.ConnectException when using JUnit and KIS 2013

The problem is a blocking firewall in most cases.

But if you have Kaspersky Internet Security 2013 (KIS 2013) installed and though Java is already set as a trusted program, JUnit won't work!
There's a post from cicmildjordje which describes the workaround:
Open kasperky settings/application control and click on "Applications" and find folder "Oracle America". Right click on every file in that folder (one by one), choose "Application rules", click on "Exclusions" and check "Do not scan network traffic". 

SORRY FOR MY BAD ENGLISH
Here's a more detailed step-by-step solution:


  1. Open KIS control panel
  2. Click on "Settings" in the top right corner
  3. Select "Program control" in the left panel and click on the "Programs" button on the right.
  4. Then select "All programs" in the combobox and search for "java". Expand the "Trustful [Programs]/ORACLE" group:

  5. Then right-click for each Java entry and choose "Application rules". If the path which you'll see in the appearing dialog, isn't c:\program files (x86)\java\jre7\bin\java.exe or c:\program files\java\jre7\bin\java.exe, skip to the next entry.
  6. For each "valid" Java entry, go to Exclusions and choose "Do not scan network traffic".