This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
In NB 7.4 a new "Test Connection" was introduced in Options Panel. When I press this button I get "connect: Address is invalid on local machine, or port is not valid on remote machine". Rather strange as I do not have a proxy between my workstation and the Internet. In fact I don't mess with these settings in NB at all since there's no need. I think the problem here is that the NB developer has been too focused on the case about testing with a Proxy that the simple case - when there's no proxy - has been kind of forgotten. The button says "Test connection" which leads me to believe that it is a GENERAL test of Internet connectivity, not one specifically for the case when there's a proxy involved. Digging further into the NB Platform source code and log file it seems the problem arises when NB tries to figure out which port to use for the test against http://netbeans.org (which is the address that NB uses for the test). NB will try to retrieve the port for the test via Preferences. As there are no Preferences the port will default to "" (empty string) which cannot be translated to integer which results in a NumberFormatException and is probably the true cause of the somewhat misleading UI error message when then "Test Connection" button is pressed. I believe the logic for figuring out the host (via Preferences) is similarly flawed. All in all I believe the problem can be fixed in org.netbeans.coreProxySettings.java, currently: public static String getTestSystemHttpHost() { return getPreferences().get(TEST_SYSTEM_PROXY_HTTP_HOST, ""); } public static String getTestSystemHttpPort() { return getPreferences().get(TEST_SYSTEM_PROXY_HTTP_PORT, ""); } could/should be replaced with: public static String getTestSystemHttpHost() { return getPreferences().get(TEST_SYSTEM_PROXY_HTTP_HOST, HTTP_CONNECTION_TEST_URL); } public static String getTestSystemHttpPort() { return getPreferences().get(TEST_SYSTEM_PROXY_HTTP_PORT, "80"); } although I cannot say for sure. Actually I first discovered the problem on an RCP application but the problem of course applies equally to the IDE.
re-assigning to module owner. Thank you for reporting.
May I ask you for the IDE log - http://wiki.netbeans.org/FaqLogMessagesFile
Created attachment 142930 [details] IDE log with stacktrace
(In reply to Libor Fischmeistr from comment #2) > May I ask you for the IDE log - http://wiki.netbeans.org/FaqLogMessagesFile Done. Attached.
Thanks for the log. Fixed in changeset: http://hg.netbeans.org/core-main/rev/95c0961b3eb2 Please verify the fix. Thank you. Now it's necessary to check if it helped to solve issue 235202
(In reply to Libor Fischmeistr from comment
(In reply to Libor Fischmeistr from comment #5) > Thanks for the log. > > Fixed in changeset: http://hg.netbeans.org/core-main/rev/95c0961b3eb2 > > Please verify the fix. > > Thank you. > > Now it's necessary to check if it helped to solve issue 235202 The fix looks ok to me although I'll verify finally tomorrow using Nightly Build. One concern though: It seems to me that there's some duplication in the sense that the testProxy() method tries to establish its own isolated proxy context, solely for the purpose of the test. This may or may not be equal to the actual ProxySelector that the NB Platform will use. All in all succeeding in the "Test Connection" is in this way no guarantee that NB can establish connections successfully. Am I seeing problems that don't exist?
Integrated into 'main-silver', will be available in build *201312090002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/95c0961b3eb2 User: Libor Fischmeistr <lfischmeistr@netbeans.org> Log: #239016: Test connection fails when no Proxy