Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 228875 - NullPointerException at org.netbeans.modules.glassfish.common.utils.JavaUtils.findSupportedPlatforms
NullPointerException at org.netbeans.modules.glassfish.common.utils.JavaUtils...
Product: serverplugins
Classification: Unclassified
Component: GlassFish
All All
: P3 (vote)
: 7.3.1
Assigned To: TomasKraus
: 228355 (view as bug list)
Depends on:
  Show dependency treegraph
Reported: 2013-04-23 06:13 UTC by lehel
Modified: 2013-04-26 02:46 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT

stacktrace (10.13 KB, text/plain)
2013-04-23 06:13 UTC, lehel

Note You need to log in before you can comment on or make changes to this bug.
Description lehel 2013-04-23 06:13:29 UTC
Build: NetBeans IDE 7.3.1 (Build 201304162201)
VM: Java HotSpot(TM) Client VM, 23.21-b01, Java(TM) SE Runtime Environment, 1.7.0_21-b11
OS: Windows XP

User Comments:
lehel: From Netbeans menu I opened Tools-Servers, and was clicking on the existing servers (Apache Tomcat 7.0.34, Glassfish 4.0)

   at org.netbeans.modules.glassfish.common.utils.JavaUtils.findSupportedPlatforms(
   at org.netbeans.modules.glassfish.common.ui.VmCustomizer.<init>(
   at org.netbeans.modules.glassfish.common.ui.GlassFishPropertiesCustomizer.<init>(
   at org.netbeans.modules.glassfish.common.GlassfishInstance.getCustomizer(
   at org.netbeans.api.server.ServerInstance.getCustomizer(
   at org.netbeans.modules.server.ui.manager.ServerManagerPanel.selectServer(
Comment 1 lehel 2013-04-23 06:13:32 UTC
Created attachment 133693 [details]
Comment 2 TomasKraus 2013-04-23 09:56:33 UTC
This is not first time I see this NPE. Line 197 in .JavaUtils contains following code:

                if (supportedPlatforms.contains(JavaSEPlatform.toValue(
                    platform.getSpecification().getVersion().toString()))) {

Value of supportedPlatforms should not be null. It's initialized as empty set.
Value of platformsList is initialized as empty LinkedList in the method itself.
The only possible NPE is in platform.getSpecification().getVersion().toString()

Unfortunately I have no chance to reprodice this issue.
Comment 3 TomasKraus 2013-04-23 11:59:33 UTC
I modified this piece of code to locate source of NPE. It will still show warning and an exception but also there will sole log messages in NetBeans log:

    } catch (NullPointerException npe) {
                "NullPointerException caught in findSupportedPlatforms.", npe);
        if (supportedPlatforms == null) {
                    "Value of supportedPlatforms is null.");
        } else if (platform.getSpecification() == null) {
                    "Value of platform.getSpecification() is null.");
        } else if (
                platform.getSpecification().getVersion() == null) {
                    "Value of platform.getSpecification().getVersion() is null.");

At this point I need some help from you. I would like to ask you to reproduce this issue with this extended logging when next dev build will be available.
Log will tell us which value caused NPE and I'll take care of it.
Comment 4 TomasKraus 2013-04-23 12:08:15 UTC
Checked into web-main:
changeset:   251198:167e3b51cf27
branch:      javaee7
summary:     #228875 - Instrumented build to find NPE cause
Comment 5 Tomas Zezula 2013-04-23 14:37:15 UTC
To get just the j2se platforms the following method can be used:

JavaPlatformManager.getPlatforms (null, new Specification("j2se", null))
Comment 6 TomasKraus 2013-04-24 10:12:59 UTC
I made final fix in 2 steps to keep NPE handling code in repository history.
But it should not be there because getSpecification() and getVersion() for Java SE platform won't return null in any case. Verified this with Tomas Zezula.

Checked into web-main:
changeset:   251277:9d9c1cdd032e
branch:      javaee7
summary:     #228875 - Only Java SE platforms are returned from default
             platform manager. NPE handling included.

changeset:   251278:6ccc2c51e3d7
branch:      javaee7
summary:     #228875 - Removed NPE handling because Java SE platforms cannot 
             throw NPE in getSpecification() and getVersion() methods.
Comment 7 TomasKraus 2013-04-24 11:47:13 UTC
*** Bug 228355 has been marked as a duplicate of this bug. ***
Comment 8 Quality Engineering 2013-04-25 00:18:38 UTC
Integrated into 'releases', will be available in build *201304242201* or newer. Wait for official and publicly available build.
User: Tomas Kraus <>
Log: #228875 - Instrumented build to find NPE cause
Comment 9 Quality Engineering 2013-04-26 02:46:00 UTC
Integrated into 'main-golden', will be available in build *201304252301* on (upload may still be in progress)
User: Tomas Kraus <>
Log: #228875 - Instrumented build to find NPE cause

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