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.

Bug 179113 - BindException at startup on OpenBSD
Summary: BindException at startup on OpenBSD
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Launchers&CLI (show other bugs)
Version: 6.x
Hardware: Other Unix
: P2 normal (vote)
Assignee: Jaroslav Tulach
URL:
Keywords:
: 182617 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-12-30 00:43 UTC by didickman
Modified: 2010-03-24 13:51 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Test Class (1.78 KB, text/plain)
2009-12-30 00:43 UTC, didickman
Details
Trying to fallback to 127.0.0.1 in case "lo" is not found (764 bytes, patch)
2010-02-03 00:02 UTC, Jaroslav Tulach
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description didickman 2009-12-30 00:43:19 UTC
Created attachment 92999 [details]
Test Class

When launching NetBeans 6.8 on OpenBSD I get a BindException:

java.net.BindException: Can't assign requested address
        at java.net.PlainSocketImpl.socketBind(Native Method)
        at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:359)
        at java.net.ServerSocket.bind(ServerSocket.java:319)
        at java.net.ServerSocket.<init>(ServerSocket.java:185)
        at org.netbeans.CLIHandler$Server.<init>(CLIHandler.java:966)
        at org.netbeans.CLIHandler.initialize(CLIHandler.java:518)
        at org.netbeans.CLIHandler.initialize(CLIHandler.java:343)
        at org.netbeans.MainImpl.execute(MainImpl.java:197)
        at org.netbeans.MainImpl.main(MainImpl.java:78)
        at org.netbeans.Main.main(Main.java:75)

Investigating seems to suggest that line 443 of ./o.n.bootstrap/src/org/netbeans/CLIHandler.java which is currently:
java.net.NetworkInterface net = java.net.NetworkInterface.getByName ("lo");

could work on OpenBSD if changed to:
java.net.NetworkInterface net = java.net.NetworkInterface.getByName ("lo0");

For whatever reason it seems that the instantiation of a ServerSocket on line 966 of CLIHandler in the stacktrace above doesn't work for me with a private IP address, but does work with 127.0.0.1 ...
        at org.netbeans.CLIHandler$Server.<init>(CLIHandler.java:966)

I have attached test code with some outputs on OpenBSD using JDK 1.6.0. The outputs of this code are as below on my system:

========== Attempt 1 ==========
name:lo0 (lo0) index: 4 addresses:
/127.0.0.1;

getByName worked
/127.0.0.1
========== Attempt 2 ==========
null
getByName returned null
puffy.earthlink.net/192.168.1.101
Exception in thread "main" java.net.BindException: Can't assign requested address
	at java.net.PlainSocketImpl.socketBind(Native Method)
	at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:359)
	at java.net.ServerSocket.bind(ServerSocket.java:319)
	at java.net.ServerSocket.<init>(ServerSocket.java:185)
	at OpenBSD.main(OpenBSD.java:49)
Comment 1 Stanislav Aubrecht 2010-01-18 06:03:20 UTC
reassigning, pls feel free to pick a different bugzilla component if this is not a startup related problem, thanks
Comment 2 Jaroslav Tulach 2010-02-02 23:53:51 UTC
Do you have NetBeans sources? Can I just attach a patch, will you be able to compile it and test it?
Comment 3 Jaroslav Tulach 2010-02-03 00:02:48 UTC
Created attachment 93784 [details]
Trying to fallback to 127.0.0.1 in case "lo" is not found

Try the above patch. In case you can't compile, download the platform/lib/boot.jar from:
https://netbeans.org/bugzilla/attachment.cgi?id=93783&action=edit

Let me know if things seem to improve for you, then I can apply the patch.
Comment 4 didickman 2010-02-03 09:30:23 UTC
Hi! I tried was able to drop in your boot.jar into my tree.

Although the patch does get rid of the exception at startup. I now get lots of warnings when I try to start the IDE.

For example:

Warning - Could not install some modules:
Bootstrap - The module named org.openide.util.lookup was needed and not found.
Bootstrap - The module Utilities API was requested in version >= 8.0 but only 7.31.1.1 was found.
Another module could not be installed due to the above problems.

I'm guessing it's because I'm using the released version (6.8) and maybe the boot.jar is from the latest source tree? So I think maybe your patch works okay? Let me know if you want me to test something else.
Comment 5 Jaroslav Tulach 2010-02-03 10:53:55 UTC
Thanks, that is enough. Integrated as core-main0084bdd7fbe1
Comment 6 Quality Engineering 2010-02-03 21:51:49 UTC
Integrated into 'main-golden', will be available in build *201002040200* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/0084bdd7fbe1
User: Jaroslav Tulach <jtulach@netbeans.org>
Log: #179113: More intricate way to get 'lo'
Comment 7 Jaroslav Tulach 2010-03-24 13:51:52 UTC
*** Bug 182617 has been marked as a duplicate of this bug. ***