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 131061 - NullPointerException at org.netbeans.modules.visualweb.project.jsf.api.JsfProjectUtils.getProjectLibraryDirectory
Summary: NullPointerException at org.netbeans.modules.visualweb.project.jsf.api.JsfPro...
Status: VERIFIED FIXED
Alias: None
Product: obsolete
Classification: Unclassified
Component: visualweb (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Quy Nguyen
URL: http://statistics.netbeans.org/except...
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-25 16:15 UTC by Roman Mostyka
Modified: 2008-03-26 17:04 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter: 40291


Attachments
stacktrace (2.32 KB, text/plain)
2008-03-25 16:15 UTC, Roman Mostyka
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Roman Mostyka 2008-03-25 16:15:04 UTC
Build: NetBeans IDE Dev (Build 200803250006)
VM: Java HotSpot(TM) Client VM, 10.0-b19, Java(TM) SE Runtime Environment, 1.6.0_05-b13
OS: Windows XP, 5.1, x86

User Comments: 
1. Add EJB to the IDE.
2. Create web application with "Visual Web JSF" framework.
3. Add Button component to the page.
4. Add EJB to the page.
5. Doubleclick Button component.

Result: NullPointerException arises.
Not sure that this issue is constantly reproducible.
Comment 1 Roman Mostyka 2008-03-25 16:15:09 UTC
Created attachment 59039 [details]
stacktrace
Comment 2 _ potingwu 2008-03-25 18:20:46 UTC
Quy, please evaluate it, coming from EJB calls. Thanks!
Comment 3 Quy Nguyen 2008-03-25 21:41:59 UTC
Changeset: 28b3e3a84dac

It looks like there was a race condition due to the ordering of the following UI events:

1) The addition of the jars to the classpath, which is triggered by the dragging of the mouse over the designer canvas.
 This is needed to provide the correct mouse cursor state when dragging through the designer.
2) The actual drop, which again tries to add the jars (because it uses the same mechanism as step #1) and instantiates
the bean.
3) The switch from design view to the java view from double-clicking the button component.

The Designtime API does not handle the use case of webservices/ejbs that need to extend the classpath before the bean
can be created, so the hack in steps #1 and #2 is needed.  Since the DnD mechanism does not allow the client direct
access to the drop target, another hack is in place to obtain the current designer's project before the jars are added.
 If steps 2 and 3 are reversed due to the race condition, there will not be a selected designer so the project search
will fail.

In any case, an additional check has been added to do nothing if no project could be found.  This should not affect any
other use cases.
Comment 4 Roman Mostyka 2008-03-26 17:04:47 UTC
Verified with build 080326.