Bug 200826 - Newly installed NetBeans won't connect to network
Newly installed NetBeans won't connect to network
Status: RESOLVED WONTFIX
Product: platform
Classification: Unclassified
Component: -- Other --
7.2.1
PC Windows 7 x64
: P2 (vote)
: 7.2
Assigned To: Jiri Rechtacek
issues@platform
http://bugs.sun.com/bugdatabase/view_...
: RELNOTE, UMBRELLA
Depends on: 206912
Blocks:
  Show dependency treegraph
 
Reported: 2011-08-10 10:23 UTC by ptoye
Modified: 2014-04-15 23:01 UTC (History)
8 users (show)

See Also:
Issue Type: DEFECT
:


Attachments
Log file (49.24 KB, text/plain)
2011-08-21 13:23 UTC, ptoye
Details
a proposed change of netbeans.conf (1.13 KB, text/plain)
2011-11-11 11:42 UTC, Jiri Rechtacek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ptoye 2011-08-10 10:23:12 UTC
I've just downloaded & installed NB 7.0.1. When first started it wanted to download Junit. But said that it couldn't connect to the network and told me to check the proxy settings (which I don't have). 

It also won't connect when I try Help|Check for updates (see screenshot).

It's fine in NB 6.9.1. And there's no network problem (or I wouldn't be sending this!).

I've run TCPView and it seems that javaw is trying to connect to dlc.oracle.com and plugins.netbeans .org, and has sent the SYN but is timing out on the reply (it's happened many times so isn't just a congestion problem).

I've uninstalled and reinstalled NB and JDK but it persists.

Oddly, my firewall (which accepts javaw as a trusted program so doesn't ask me if it's OK to connect), has set up a rule to allow outbound traffic to address c012:6e0b:: which is an IP6 address. I don't have IP6 enabled on my network!

Any idea what's going wrong please? I can attach screenshots of TCPview if it helps.
Comment 1 Marian Mirilovic 2011-08-14 11:43:10 UTC
Could you please attach messages.log file and reopen this issue ? Thanks in advance. 
http://wiki.netbeans.org/FaqLogMessagesFile
Comment 2 ptoye 2011-08-21 13:23:57 UTC
Created attachment 110121 [details]
Log file
Comment 3 ptoye 2011-08-21 13:24:41 UTC
OK. Here's the log file. Doubt if it's of much use as all it seems to say is that the connection timed out.
Comment 4 Yulia Novozhilova 2011-08-22 10:13:12 UTC
See also #136036, cc-ing Jirka
Comment 5 ptoye 2011-08-23 09:54:11 UTC
I've done some more tests. It seems that if I add      -J-Djava.net.preferIPv4Stack=true to the netbeans_default_options in netbeans.conf it allows NB to connect to the servert and download updates, libraries etc.

Comments in the thread http://forums.netbeans.org/viewtopic.php?p=112270#112270 on the NB user forum imply that this sort of problem exists only in Java 7 64-bit. It might be worth while investigating this in a bit of detail.

There are other problems associated with Java 7 64-bit - I wrote a quick program to try a network connection and it failed when running outside NB, so it's not really your problem. But a workaround in needed (if only to maintain credibility in the Java development world) until Oracle remove the bug.
Comment 6 ptoye 2011-08-23 11:01:27 UTC
I think that if you add -Djava.net.preferIPv4Stack=true to the run|VM Options box for any project which connects to the Internet it will work OK. At least it does for me.

S there is a workaround for both the Netbeans non-connection issue and the user program non-connection issue.

But it's still up to Oracle to mend the bug in the first place! How does one get them off their backsides?
Comment 7 hcq 2011-08-26 03:37:13 UTC
Have had same problem. Many thanks to ptoye and Bob McConnell for time spent investigating and for Bob’s “-J-Djava.net.preferIPv4Stack=true” work-around  (Comment 5), which worked in my case, too.

Here are the results of my investigations into several scenarios.

Scenario 1:
• Win 7 Home Premium (64 bit)
• Java 1.7.0 (64 bit)
• NB 7.0.1
• McAfee Antivirus Plus Firewall

Netbeans cannot access internet for plugin updater (Tools->Plugins->Reload catalog failed) nor for Help->Check for updates. Note: Giving javaw.exe, java.exe, and netbeans.exe full access rights through firewall did not help.

However, shutting down the firewall entirely did fix the problem.

Conclusion: The problem has something to do with the firewall.

*************************************************************
Scenario 2:
• Different machine but same as Scenario 1, except that win 7 and Java 1.7.0 were both 32 bit.

Results were exactly the same.

Conclusion: 64-bit vs. 32-bit is not the problem.

*************************************************************
Scenario 3:
• Third machine, but same OS/Java/NB configuration as Scenario 1 (i.e., 64 bit). (But with Win 7 Professional, not Home Premium.)
• Windows Firewall

No problem!

Conclusion: The problem is related either to differences in firewall settings or operations between the two brands of firewalls.

*************************************************************
Scenario 4:
• Same machine, OS, and firewall as Scenario 2 (32 bit)
• Java 1.6.0_14 and NB 6.7.1 (32 bit)

No problem.

Conclusion: The problem lies in the interaction between some feature that changed in Java and/or NB between the “6” and “7” versions and something in the difference between the firewalls.

Note:  I also have had problems accessing the Javadoc for Java 7 from within NB7.  That Javadoc has been moved online.  I suspect it must be the same problem.
Hope this helps. For now, I’m going to use the netbeans.conf fix and go back to the work I have to do for my job.
Comment 8 ptoye 2011-10-14 18:09:22 UTC
(In reply to comment #7)
> Have had same problem. Many thanks to ptoye and Bob McConnell for time spent
> investigating and for Bob’s “-J-Djava.net.preferIPv4Stack=true” work-around 
> (Comment 5), which worked in my case, too.
> 
> Here are the results of my investigations into several scenarios.
> 
> Scenario 1:
> • Win 7 Home Premium (64 bit)
> • Java 1.7.0 (64 bit)
> • NB 7.0.1
> • McAfee Antivirus Plus Firewall
> 
> Netbeans cannot access internet for plugin updater (Tools->Plugins->Reload
> catalog failed) nor for Help->Check for updates. Note: Giving javaw.exe,
> java.exe, and netbeans.exe full access rights through firewall did not help.
> 
> However, shutting down the firewall entirely did fix the problem.
> 
> Conclusion: The problem has something to do with the firewall.
> 
> *************************************************************
> Scenario 2:
> • Different machine but same as Scenario 1, except that win 7 and Java 1.7.0
> were both 32 bit.
> 
> Results were exactly the same.
> 
> Conclusion: 64-bit vs. 32-bit is not the problem.
> 
> *************************************************************
> Scenario 3:
> • Third machine, but same OS/Java/NB configuration as Scenario 1 (i.e., 64
> bit). (But with Win 7 Professional, not Home Premium.)
> • Windows Firewall
> 
> No problem!
> 
> Conclusion: The problem is related either to differences in firewall settings
> or operations between the two brands of firewalls.
> 
> *************************************************************
> Scenario 4:
> • Same machine, OS, and firewall as Scenario 2 (32 bit)
> • Java 1.6.0_14 and NB 6.7.1 (32 bit)
> 
> No problem.
> 
> Conclusion: The problem lies in the interaction between some feature that
> changed in Java and/or NB between the “6” and “7” versions and something in the
> difference between the firewalls.
> 
> Note:  I also have had problems accessing the Javadoc for Java 7 from within
> NB7.  That Javadoc has been moved online.  I suspect it must be the same
> problem.
> Hope this helps. For now, I’m going to use the netbeans.conf fix and go back to
> the work I have to do for my job.

I've found that this problem occurs only when my firewall (Agnitum Outpost) is activated. I've informed Agnitum and they're looking into it. I'll report back when I hear.

Meanwhile, this problem is not unique to Netbeans - any Java program which makes a connection fails, so it's really some sort of interaction between Java and the firewall.

There s (probably better) workaround: if you set the _JAVA_OPTIONS environment variable to -Djava.net.preferIPv4Stack=true (or add this to the end if you've already got something there), this is picked up by Java whenever is start, and it uses the IP4 stack rather than the IP6 one - which seems to be something to do with the problem. And of course this work for all programs.
Comment 9 Jiri Rechtacek 2011-11-11 11:42:05 UTC
Created attachment 113119 [details]
a proposed change of netbeans.conf
Comment 10 Jiri Rechtacek 2011-11-11 11:44:45 UTC
Tondo, could you modify netbeans.conf by proposed patch? It can help to connect to the Internet from IDE. Thanks
Comment 11 ptoye 2011-11-11 12:40:51 UTC
There might be a problem here. My machine doesn't have IPv6 so I imagine this patch would work. But for people who have IPv6 it's probably not the best thing to prefer IPv4. I don't know enough about the operation of these switches (not well documented by Oracle) for a seriously informed comment.

I've still heard nothing back from the firewall manufacturer. I've prodded them.
Comment 12 Michel Graciano 2012-01-06 10:39:55 UTC
It happens to me just with JDK 7 u2. I have to pass this parameter for every Java application that need to connect to the internet, including Java Web Start.
Comment 13 Marian Mirilovic 2012-01-09 09:14:30 UTC
reproducible with NB 7.1 as well...
Comment 14 ptoye 2012-01-09 12:22:07 UTC
Still haven't heard anything from the firewall - to be honest I'd forgotten all about it but will give them another kick.

The problem isn't with NB but with Java. Programs which connect to the Internet in any way fail. I've found that the best way is to add an environment variable to the PC setup. The variable is _JAVA_OPTIONS and the value to set it to is Djava.net.preferIPv4Stack=true (this is not documented, as far as I can see) by the Java team at all.

To set an environment variable in Windows 7, right-click on the "Computer" icon and select "Properties". Go to "Advanced System Settings" (you'll need the Admin password for this) and click the "Environment variables" button. It's probably best to add it as a system variable, unless you want Java to work for only yourself. Click the "New..." button and paste the name and value in from above.
Comment 15 Jiri Rechtacek 2012-01-11 15:44:55 UTC
Thanks for your information, it was reported as JDK bug http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7095419 but it's evaluation doesn't confirmed as jdk bug but a problem with Windows firewall.
More information found also in similar issue:  http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7077696 (see the Evaluation part).
Comment 16 ptoye 2012-01-11 16:21:45 UTC
(In reply to comment #15)
> Thanks for your information, it was reported as JDK bug
> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7095419 but it's evaluation
> doesn't confirmed as jdk bug but a problem with Windows firewall.
> More information found also in similar issue: 
> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7077696 (see the Evaluation
> part).

Thanks. Not sure what happened to my previous comment (which I'm sure I made in this thread) which said that  my firewall manufacturer has found the issue and hopes for a solution by the end of the month.

I'm not convinced that it's entirely a firewall issue, or why would a simple program which just does a connect fail? It's certainly not as complex as http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7077696 as there's no FTP involved at all. But at the moment the Java database login server isn't responding so I can't put a message up there....

But it's certainly NOT a NetBeans issue. It was just that NB was the first Java program I ran under Java 7 which connected to the Internet. So this can definitely be closed off here.
Comment 17 Jiri Rechtacek 2012-01-24 08:44:29 UTC
Conclusion: The reported problems come from firewall that probably filters some answers from network while connecting on a remote host. If a machine tries connect a host, JDK tries use IPv6 first, if failed then it's trying IPv4. The filtering on side of firewall can swallow a negative response from the host and then JDK won't try use IPv4 more.
The proposed workaround in that case is to run IDE with
-J-Djava.net.preferIPv4Stack=true in <netbeans-install-dir>/etc/netbeans.conf

Ken, could you please add this item into NB7.1 Release Notes? Thanks
Comment 18 Petr Jiricka 2012-01-24 10:02:19 UTC
I still don't understand why the JDK team does not see this as a bug, when the same scenario worked in JDK 6.
Comment 19 ptoye 2012-01-24 10:08:18 UTC
(In reply to comment #17)
> Conclusion: The reported problems come from firewall that probably filters some
> answers from network while connecting on a remote host. If a machine tries
> connect a host, JDK tries use IPv6 first, if failed then it's trying IPv4. The
> filtering on side of firewall can swallow a negative response from the host and
> then JDK won't try use IPv4 more.
> The proposed workaround in that case is to run IDE with
> -J-Djava.net.preferIPv4Stack=true in <netbeans-install-dir>/etc/netbeans.conf
> 
> Ken, could you please add this item into NB7.1 Release Notes? Thanks

Jiri,

I suggest that the workaround should be the one I proposed in comment 14:

I've found that the best way is to add an environment variable to the PC setup. The variable is _JAVA_OPTIONS and the value to set it to is
Djava.net.preferIPv4Stack=true (this is not documented, as far as I can see) by
the Java team at all. 

This works for all Java programs, not just NetBeans.

Or suggest both in the release notes and leave it for the user to decide which works best in his/her configuration.

Peter
Comment 20 Kenneth Ganfield 2012-01-24 15:40:26 UTC
Added to release notes. Please let me know if the workaround should be changed.
Comment 21 ptoye 2012-02-05 12:56:16 UTC
(In reply to comment #20)
> Added to release notes. Please let me know if the workaround should be changed.

Sorry this is a bit late. I'd suggest something like the following, to let the user make their own decision as to which to apply:

Certain configurations of Windows OS and firewalls result in Java programs (not just Netbeans) not being able to communicate over the Internet. The obvious symptom is that Netbeans will not update itself or download libraries. There are two possible workarounds. The first allows Netbeans to communicate, the second allows all Java programs to communicate. 

1) (the netbeans_default_options fix)

2) (the environment variable option)
Comment 22 ptoye 2012-02-05 13:53:00 UTC
Oops - should mention also that this only seems to happen in Java 7.
Comment 23 Jackie_Rosen 2014-02-16 11:23:20 UTC
SPAM - Removed by Administrator
Comment 24 WadeColson 2014-04-15 23:01:21 UTC
*** Bug 260998 has been marked as a duplicate of this bug. ***
Seen from the domain http://volichat.com
Page where seen: http://volichat.com/adult-chat-rooms
Marked for reference. Resolved as fixed @bugzilla.


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo