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 243061 - NullPointerException at java.net.NetworkInterface.getInterfaceAddresses
Summary: NullPointerException at java.net.NetworkInterface.getInterfaceAddresses
Status: RESOLVED FIXED
Alias: None
Product: serverplugins
Classification: Unclassified
Component: GlassFish (show other bugs)
Version: 8.0
Hardware: All All
: P3 normal (vote)
Assignee: TomasKraus
URL:
Keywords:
: 245310 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-03-19 15:33 UTC by pns
Modified: 2015-04-29 02:31 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 208521


Attachments
stacktrace (8.87 KB, text/plain)
2014-03-19 15:33 UTC, pns
Details
stacktrace (12.15 KB, text/plain)
2015-01-09 17:42 UTC, padma
Details

Note You need to log in before you can comment on or make changes to this bug.
Description pns 2014-03-19 15:33:33 UTC
Build: NetBeans IDE 8.0 (Build 201403101706)
VM: Java HotSpot(TM) 64-Bit Server VM, 24.51-b03, Java(TM) SE Runtime Environment, 1.7.0_51-b13
OS: Windows 8

User Comments:
pns: Was trying to add the latest promoted glassfish version (4.0.1 m4), after selecting the folder where I have the glassfish server installed, I got this exception.

The glassfish server is in "C:\Program Files\glassfish-4.0.1" and it's working with NetBeans 7.4




Stacktrace: 
java.lang.NullPointerException
   at java.net.NetworkInterface.getInterfaceAddresses(NetworkInterface.java:168)
   at org.glassfish.tools.ide.utils.NetUtils.getHostIP4s(NetUtils.java:418)
   at org.netbeans.modules.glassfish.common.wizards.AddDomainLocationVisualPanel.<init>(AddDomainLocationVisualPanel.java:94)
   at org.netbeans.modules.glassfish.common.wizards.AddDomainLocationPanel.getComponent(AddDomainLocationPanel.java:155)
   at org.netbeans.modules.glassfish.common.wizards.ServerWizardIterator.current(ServerWizardIterator.java:235)
   at org.netbeans.modules.server.ui.wizard.AddServerInstanceWizard$AddServerInstanceWizardIterator.current(AddServerInstanceWizard.java:346)
Comment 1 pns 2014-03-19 15:33:34 UTC
Created attachment 146152 [details]
stacktrace
Comment 2 TomasKraus 2014-03-19 16:11:27 UTC
This code should try to detect all IP4 addresses on machine where netbeans are running. Looks like it msy have some issues on Windows.
Were you able to register it or is wisard not working at all for you?

Unfortunately java.net.NetworkInterface.getInterfaceAddresses(NetworkInterface.java:168) is JDK so I can't do much with NPE there. But I'll add somethng to handle it in org.glassfish.tools.ide.utils.NetUtils where method can respond with empty list + some log message instead of throwing an exception.
Comment 3 pns 2014-03-19 17:44:50 UTC
Just ran a quick test and it seems the problem is the JVM argument "-J-Djava.net.preferIPv4Stack=true", If I ommit it I no longer get the exception (and yes with that argument I get the exception everytime and cannot finish the wizard).

Nevertheless, I run 7.4 with the same JDK and with that argument and have no problems with there.
Comment 4 TomasKraus 2014-03-19 17:51:17 UTC
Well, GF plugin was not touched since 7.4 so I would expect the same issues in both 7.4 and 8.0. I'll update affected jar tomorrow and it will be attached here to let you test it.
Comment 5 padma 2015-01-09 17:42:26 UTC
Created attachment 151428 [details]
stacktrace

ADD SERVER INSTANCE->DOWNLOAD AND INSTALL GLASSFISH SERVER-> CLICK NEXT the next button is not working.....
Comment 6 Petr Hejl 2015-04-28 09:25:03 UTC
*** Bug 245310 has been marked as a duplicate of this bug. ***
Comment 7 Petr Hejl 2015-04-28 13:22:52 UTC
Can you share some information about your network interfaces setup?
Comment 8 Petr Hejl 2015-04-28 13:34:51 UTC
This is blind fix as I was not able to reproduce the issue. Feel free to reopen.
web-main 527dd3496329.
Comment 9 Quality Engineering 2015-04-29 02:31:32 UTC
Integrated into 'main-silver', will be available in build *201504290001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/527dd3496329
User: Petr Hejl <phejl@netbeans.org>
Log: #243061 - NullPointerException at java.net.NetworkInterface.getInterfaceAddresses