Bug 150223 - NullPointerException at org.netbeans.modules.server.ui.wizard.ServerWizardVisual.isServerValid
NullPointerException at org.netbeans.modules.server.ui.wizard.ServerWizardVis...
Status: RESOLVED FIXED
Product: serverplugins
Classification: Unclassified
Component: Infrastructure
6.x
All All
: P2 (vote)
: 6.x
Assigned To: Petr Hejl
issues@serverplugins
http://statistics.netbeans.org/except...
EXCEPTIONS_REPORT, 65fixes3-fixed
:
: 156374 158158 158942 158960 159390 159393 159885 159964 160115 160217 160240 161962 162130 170285 171530 173217 175174 175730 212155 217117 (view as bug list)
Depends on:
Blocks: 154624
  Show dependency treegraph
 
Reported: 2008-10-15 13:56 UTC by pearl21304
Modified: 2012-08-21 06:30 UTC (History)
99 users (show)

See Also:
Issue Type: DEFECT
:


Attachments
stacktrace (4.07 KB, text/plain)
2008-10-15 13:56 UTC, pearl21304
Details
stacktrace (7.25 KB, text/plain)
2008-10-28 21:55 UTC, nerdknight
Details
stacktrace (4.07 KB, text/plain)
2009-03-25 00:59 UTC, Chary Kanaparthi
Details
java.lang.NullPointerException (22.57 KB, application/octet-stream)
2010-05-18 02:23 UTC, salala
Details

Note You need to log in before you can comment on or make changes to this bug.
Description pearl21304 2008-10-15 13:56:36 UTC
Build: NetBeans IDE 6.1 (Build 200805300101)
VM: Java HotSpot(TM) Client VM, 14.0-b05, Java(TM) SE Runtime Environment, 1.7.0-ea-b36
OS: Linux, 2.6.23.1-42.fc8, i386

Stacktrace: 
java.lang.NullPointerException
        at org.netbeans.modules.server.ui.wizard.ServerWizardVisual.isServerValid(ServerWizardVisual.java:155)
        at org.netbeans.modules.server.ui.wizard.ServerWizardVisual.isValid(ServerWizardVisual.java:146)
        at java.awt.Component.invalidateIfValid(Component.java:2711)
        at java.awt.Component.setLocale(Component.java:1780)
        at javax.swing.JComponent.<init>(JComponent.java:599)
        at javax.swing.JPanel.<init>(JPanel.java:82)
Comment 1 pearl21304 2008-10-15 13:56:43 UTC
Created attachment 71855 [details]
stacktrace
Comment 2 nerdknight 2008-10-28 21:54:54 UTC
Build: NetBeans IDE 6.1 (Build 200805300101)
VM: Java HotSpot(TM) Client VM, 14.0-b05, Java(TM) SE Runtime Environment, 1.7.0-ea-b38
OS: Linux, 2.6.24-21-generic, i386

User Comments: 


Stacktrace: 
java.lang.NullPointerException
        at org.netbeans.modules.server.ui.wizard.ServerWizardVisual.isServerValid(ServerWizardVisual.java:155)
        at org.netbeans.modules.server.ui.wizard.ServerWizardVisual.isValid(ServerWizardVisual.java:146)
        at java.awt.Component.invalidateIfValid(Component.java:2711)
        at java.awt.Component.setLocale(Component.java:1780)
        at javax.swing.JComponent.<init>(JComponent.java:600)
        at javax.swing.JPanel.<init>(JPanel.java:82)
Comment 3 nerdknight 2008-10-28 21:55:03 UTC
Created attachment 72801 [details]
stacktrace
Comment 4 Vince Kraemer 2008-12-01 23:27:45 UTC
it looks like this is an issue when the IDE is running in jdk 7....

we may be able to fix this by changing the name of the method isValid, to avoid overriding the java.awt.Component
isValid method... which appears to have become a problem.

PterH: did you override isValid purpose or was it just coincidental?

please comment and re-assign....
Comment 5 Vince Kraemer 2008-12-01 23:31:21 UTC
this search finds lots of hits that imply that the coding pattern used in ServerWizardVisual.java is error-prone.

http://www.google.com/search?q=java+virtual+method+in+constructor
Comment 6 _ tboudreau 2008-12-02 20:32:44 UTC
Posting my comments from nbdev here in case they are missed:

You don't need to file a JDK issue.  What's happening is you are implementing WizardDescriptor.Panel over a Component. 
So your implementation of WizardDescriptor.Panel.isValid() is accidentally overriding Component.isValid().  Depending on
the look and feel or JDK it can easily be called from the superclass constructor, before your instance fields are
initialized.  

The fix is not to ever implement WizardDescriptor.Panel directly on a component.  I've seen this one enough times that
we should probably throw an exception if a wizard ever encounters a panel that *is* a component.  It's fairly
non-obvious what is wrong, and will appear pretty randomly depending on JDK, etc. 
Comment 7 Vince Kraemer 2008-12-03 19:50:38 UTC
this is actually a p2 issue when someone uses jdk 7 builds
Comment 8 Vince Kraemer 2008-12-03 23:10:37 UTC
http://hg.netbeans.org/main/rev/22651c94d707
Comment 9 Quality Engineering 2008-12-05 06:09:49 UTC
Integrated into 'main-golden', will be available in build *200812050201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/22651c94d707
User: Vince Kraemer <vkraemer@netbeans.org>
Log: #150223: improper override of Component.isValid triggers NPE during panel initialization.
Comment 10 ievans 2009-01-28 20:10:54 UTC
I'm disappointed this fix wasn't integrated in the 6.5 Patch2 release. I'm unable to add any server instances in 6.5.
So, this is a blocking bug for the Java EE tutorial team (we're targeting 6.5 for the first release of the Java EE 6
Tutorial).
Comment 11 Vince Kraemer 2009-01-29 00:01:47 UTC
This has become a larger problem... it looks like folks using JDK 6 are also running into this.

Please consider this for a 6.5 patch 3... if there is one.
Comment 12 bsrikanth 2009-02-04 06:19:19 UTC
Please solve this issue.
Comment 13 Petr Hejl 2009-02-04 10:49:03 UTC
Issue has been already fixed. If you can reproduce it with latest daily build please provide the steps to reproduce.

Fix will be part of 65patch3.
Comment 14 Vince Kraemer 2009-02-06 05:31:32 UTC
To the folks that have been bitten by this issue....

try running the IDE under JDK 6 update 10....  It looks like this bug bites those running JDK 7 builds and JDK 6 update
12...

HTH
Comment 15 mrelac 2009-02-06 14:07:10 UTC
To those interested in a workaround of this bug that simply want to add a server:

I needed to add the JBoss server to an existing project. In trying to work around this bug, I tried various flavors of
JDK 6 and netbeans 6 - all to no avail. I was able to add the server in the latest 20090205 netbeans build; however,
when I invoked the latest released netbeans client I have (20081111), the JBoss server was not there, and the 'add
server' functionality was, of course, still broken.

In order to work around this, I installed netbeans 5.5 and jdk 1.5. I successfully added my JBoss server using netbeans
5.5. Then I ran netbeans 6.5 (20081111), and the JBoss server was there. NOTE: My netbeans 6.5 is currently using the
1.5 jdk (as a result of earlier attempts to work around this bug).

Mike Relac
Comment 16 mrelac 2009-02-06 15:07:22 UTC
A much simpler workaround: Took vkraemer's suggestion, installed JDK 1.6.11 and reinstalled netbeans 6.5, and now the
server links and buttons work. Thanks, vkraemer!
Comment 17 Vince Kraemer 2009-02-06 15:36:01 UTC
One more additional note:  you should not need to reinstall NetBeans to work-around the issue...

You can use the command-line flag --jdkhome to specify the JDK to use for running the IDE...

If you want to make that 'permanent', you can change the value of the netbeans_jdkhome variable, which is defined in
%NBINSTALL%\etc\netbeans.conf
Comment 18 Vince Kraemer 2009-02-07 17:19:49 UTC
See http://blogs.sun.com/vkraemer/entry/netbeans_jdk_update_12_and for a bit more info.
Comment 19 jkind 2009-02-08 19:03:57 UTC
*** Issue 158158 has been marked as a duplicate of this issue. ***
Comment 20 Petr Jiricka 2009-02-11 15:26:30 UTC
*** Issue 158340 has been marked as a duplicate of this issue. ***
Comment 21 Vince Kraemer 2009-02-11 16:12:02 UTC
alexandrerocha: why have you marked this issue as closed... did you mean to mark it as  verified?
Comment 22 Petr Hejl 2009-02-12 13:46:53 UTC
Same fix done for j2eeserver itself - main 3caf7410e83f.
Comment 23 giorgio42 2009-02-13 09:36:23 UTC
If I try to add a new server in NB6.5 and then submit the exception, the analytics site tells me, that the bug is 
fixed. Which is not true for NB6.5, because no patch containing this fix has been released yet.
Comment 24 giorgio42 2009-02-13 10:20:21 UTC
I am working in manufacturing, and whenever something breaks and causes significant impact (which is true for this
issue, as it really affects a lot of users in the field, just wait a bit until users really start to notice 1.6.0_12 and
install it in masses), we do a "lesson learned". 

So what is the NetBeans team doing to avoid such a pitfall in the future?

Testing with upcoming releases of the JDK is not a nice to have, but a bare necessity...
Comment 25 davti 2009-02-13 23:12:42 UTC
workaround: Windows and Ubuntu
The is only an issue for 6.5 with the 1.6.0_12 JDK release, if you continue to use 1.6.0_11 there is no issue. 
in <netbeans_install_dir>/etc/netbeans.conf 
change netbeans_jdkhome="<java_jdk_install>\Java\jdk1.6.0_11".

As release 7 is not going to be around until Jun/Jul 2009 a backwards compatible fix needs to be made, otherwise no JDk
updates for the next 6 months can be installed, not a good solution at all. 
Comment 26 Vince Kraemer 2009-02-13 23:23:08 UTC
I realize that you mean well, but by reopening this issue you have made it certain that the fix will not go into the
next patch of 6.5.

that is why I am going to mark the issue as fixed... since it is fixed in the trunk... 

Once QA verifies that the fix is good in the trunk, we can push it into the branch that will be used to create the next
patch for 6.5...
Comment 27 lonun 2009-02-15 16:02:16 UTC
I am very disappointed。
Because of of this exception, I can not work with netbeans now.
When i add a new server,or click the right mouse button on one project,this exception kiss me.
why you fixed it in 7.0m1?why not a patch for 6.5?
Comment 28 Petr Hejl 2009-02-16 08:58:47 UTC
See status whiteboard. By reopening the issue you prevent it to be 65 patch.
Comment 29 Quality Engineering 2009-02-18 10:28:09 UTC
Integrated into 'main-golden', will be available in build *200902180201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/3caf7410e83f
User: phejl@netbeans.org
Log: #150223 NullPointerException at org.netbeans.modules.server.ui.wizard.ServerWizardVisual.isServerValid
Comment 30 bubak 2009-02-19 09:35:37 UTC
just a note: running Netbeans 6.5 with openjdk 6 is also fine and you are able to add a server and than switch back to
sun jdk 6 build 12 (use --jdkhome as suggested above or change netbeans.conf)
Comment 31 rptmaestro 2009-02-23 16:36:25 UTC
Is there an estimate on when a patch for NB 6.5 will be available for this issue? This is major usability problem and 
should be pushed out asap.
Comment 32 Jindrich Sedek 2009-02-25 13:00:04 UTC
*** Issue 158942 has been marked as a duplicate of this issue. ***
Comment 33 Jindrich Sedek 2009-02-25 13:40:49 UTC
*** Issue 158960 has been marked as a duplicate of this issue. ***
Comment 34 Vince Kraemer 2009-03-01 17:21:25 UTC
*** Issue 159390 has been marked as a duplicate of this issue. ***
Comment 35 Petr Hejl 2009-03-01 19:43:11 UTC
*** Issue 159393 has been marked as a duplicate of this issue. ***
Comment 36 Jaroslav Pospisil 2009-03-05 16:48:28 UTC
verified in NB6.5.1 with Win Vista and JDK1.6.0_13
Comment 37 Petr Hejl 2009-03-09 07:43:29 UTC
*** Issue 159885 has been marked as a duplicate of this issue. ***
Comment 38 Vince Kraemer 2009-03-12 18:23:00 UTC
*** Issue 159964 has been marked as a duplicate of this issue. ***
Comment 39 Petr Hejl 2009-03-13 08:27:22 UTC
*** Issue 160240 has been marked as a duplicate of this issue. ***
Comment 40 Martin Schovanek 2009-03-18 16:34:35 UTC
*** Issue 160115 has been marked as a duplicate of this issue. ***
Comment 41 Martin Schovanek 2009-03-18 18:20:00 UTC
*** Issue 160217 has been marked as a duplicate of this issue. ***
Comment 42 Vince Kraemer 2009-03-18 19:31:23 UTC
*** Issue 156374 has been marked as a duplicate of this issue. ***
Comment 43 Chary Kanaparthi 2009-03-25 00:59:47 UTC
Build: NetBeans IDE 6.5 (Build 200811100001)
VM: Java HotSpot(TM) Client VM, 11.2-b01, Java(TM) SE Runtime Environment, 1.6.0_12-b04
OS: Windows XP, 5.1, x86

User Comments: 


Stacktrace: 
java.lang.NullPointerException
        at org.netbeans.modules.server.ui.wizard.ServerWizardVisual.isServerValid(ServerWizardVisual.java:155)
        at org.netbeans.modules.server.ui.wizard.ServerWizardVisual.isValid(ServerWizardVisual.java:146)
        at java.awt.Component.invalidateIfValid(Component.java:2740)
        at java.awt.Component.setLocale(Component.java:1810)
        at javax.swing.JComponent.<init>(JComponent.java:595)
        at javax.swing.JPanel.<init>(JPanel.java:65)
Comment 44 Chary Kanaparthi 2009-03-25 00:59:57 UTC
Created attachment 78793 [details]
stacktrace
Comment 45 Petr Hejl 2009-04-06 14:42:48 UTC
*** Issue 161962 has been marked as a duplicate of this issue. ***
Comment 46 dprasanth 2009-04-07 05:33:50 UTC
How to fix this issue please update date me on this.
Comment 47 Vince Kraemer 2009-04-07 05:41:31 UTC
use the update center or download NB 6.5.1

reopening an issue is not an appropriate method to ask this kind of question.  Please use nbusers@netbeans.org in the
future.
Comment 48 Petr Hejl 2009-04-07 15:32:37 UTC
*** Issue 162130 has been marked as a duplicate of this issue. ***
Comment 49 Petr Hejl 2009-08-17 18:56:11 UTC
*** Issue 170285 has been marked as a duplicate of this issue. ***
Comment 50 Petr Hejl 2009-09-07 16:59:55 UTC
*** Issue 171530 has been marked as a duplicate of this issue. ***
Comment 51 emiddio 2009-09-07 19:39:35 UTC
this issue is not fixed in my view  --- i filed a bug report that was marked as a duplicate of this one; the substance
of the report is pasted below; this issue affects all netbeans versions 6.1 and earlier -- please read the rest
of my report;

you developers seem to have the luxury of not caring about backward compatability -- most real work is done with older
tools -- rather than bleeding edge ones. many times newer releases of netbeans break old features -- they should
continue to work; thats a reason to not by into unit testing -- since no one is writing unit tests for bug fixes
to validate newer code.

like i say below -- this is either a very old bug -- and apparently will not be fixed for older releases of netbeans
-- or its a JDK 1.6.05++ bug -- since the bug does not exist if using jdk1.6.05 or earlier.

if its not going to be fixed(for earlier netbeans version users) -- then it should be pointed out to reporters that 
jdk1.6.0_5 or earlier will fix the issue.



*** This issue has been marked as a duplicate of 150223 ***
------- Additional comments from emiddio Fri Sep 4 21:07:14 +0000 2009 -------
have tested with netbeans 5.0, 5.5, 5.5.1 6.0.1, 6.1, 6.5.1, 6.7.1

will not test with netbeans 4.1 -- since netbeans 4.1 will not work correctly with any jdk1.6.x.
only nb6.5.1 and nb6.7.1 will work with jdk1.6.0_16 for add server plugin
nb 5.0 thru 6.1 will fail; if i change them to jdk1.6.0_05 they all work -- execpt nb4.1 wont work with jdk6
maybe this should be a jdk bug? since the jdk breaks all the older releases of netbeans
Comment 52 Petr Hejl 2009-09-29 16:29:53 UTC
*** Issue 173217 has been marked as a duplicate of this issue. ***
Comment 53 Petr Hejl 2009-10-22 07:23:24 UTC
*** Issue 175174 has been marked as a duplicate of this issue. ***
Comment 54 Petr Hejl 2009-10-30 09:15:01 UTC
*** Issue 175730 has been marked as a duplicate of this issue. ***
Comment 55 salala 2010-05-18 02:23:40 UTC
Created attachment 99108 [details]
java.lang.NullPointerException 

An error occurs when adding a new server for NetBeans 5.5.1 is error java.lang.NullPointerException
Comment 56 Petr Hejl 2012-05-09 11:19:13 UTC
*** Bug 212155 has been marked as a duplicate of this bug. ***
Comment 57 Petr Hejl 2012-08-21 06:30:09 UTC
*** Bug 217117 has been marked as a duplicate of this bug. ***


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