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 81332 - Entity Classes from DB: NPE at ModuleDDSupport.propertyChange()
Summary: Entity Classes from DB: NPE at ModuleDDSupport.propertyChange()
Status: RESOLVED FIXED
Alias: None
Product: serverplugins
Classification: Unclassified
Component: Sun Appserver 9 (show other bugs)
Version: 5.x
Hardware: All All
: P2 blocker (vote)
Assignee: _ pcw
URL:
Keywords:
: 75156 86742 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-07-28 13:34 UTC by Andrei Badea
Modified: 2007-03-08 09:41 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Stack trace (4.44 KB, text/plain)
2006-07-28 13:35 UTC, Andrei Badea
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrei Badea 2006-07-28 13:34:44 UTC
[ self-compiled build from Jul 26 ]

Just after pressing Finish in the Entity Classes from Database wizard I got the
attached NPE. I can't reproduce it again.
Comment 1 Andrei Badea 2006-07-28 13:35:28 UTC
Created attachment 32296 [details]
Stack trace
Comment 2 _ pcw 2006-07-29 02:07:48 UTC
This is odd, I suspect it is related to the latest changes in how dd events for
JavaEE5 projects are sent to the connected server plugin (e.g. us) since the
exception just started happening in the past day or so.

What is happening is an old ModuleDDSupport instance is receiving a property
change event after it has removed it's change listener and sent itself off to be
garbage collected.  I suspect this will most likely happen only with new
projects (related to how sun-ejb-jar.xml is created, don't ask :))

I will put in some code to ignore events under these circumstances, which will
alleviate the exception message.  I will also see if I can understand what
change allowed this sequence of events to occur in the first place.  It seems
someone is caching something somewhere or maybe there is a synchronization issue.
Comment 3 _ pcw 2006-07-29 09:02:27 UTC
See issue 75156 - same trace (different line number due to age difference).  So
this has been around for a longer than I thought but recently became much less
rare because I have seen a flurry of them myself today as well.

For now, the NPE is fixed and in it's place a trace will be logged along with
the event information.  The event will be ignored, since it's been sent to a
deleted but not yet garbage collected listener.
Comment 4 _ pcw 2006-07-29 09:03:05 UTC
*** Issue 75156 has been marked as a duplicate of this issue. ***
Comment 5 _ pcw 2006-08-02 23:18:52 UTC
Downgrading to P4, but keeping open so maybe I can later investigate the change
in event flow that caused this anomaly.  It should not cause any problems for
users in the current state though.
Comment 6 _ pcw 2006-08-09 02:42:51 UTC
Raising to P2.  I stumbled upon an easily reproducible case last night my slow
2-cpu box at home.

This turned out to be a very subtle and insidious bug in the DDBean->DConfigBean
event code inherited from j2eeserver.  For J2EE modules w/ two DDBeanRoots (web
& ejb due to webservices.xml), two listeners were being created, one for each
root, but saved to a single variable reference so only one could be removed. 
The one that remained was on the DDBeanRoot for the standard descriptor where
the majority of the events come from.  This also explains some other odd event
behavior I'd observed in recent weeks.

The fix is pretty easy, fortunately.
Comment 8 _ pcw 2007-03-08 09:41:25 UTC
*** Issue 86742 has been marked as a duplicate of this issue. ***