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 31647 - invalid context menu when Web Module node is deleted.
Summary: invalid context menu when Web Module node is deleted.
Status: VERIFIED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: Code (show other bugs)
Version: 3.x
Hardware: All All
: P1 blocker (vote)
Assignee: _ rkubacki
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-03-04 13:16 UTC by Marian Mirilovic
Modified: 2003-04-01 08:22 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
simple test to check nature of displayed objects (1.09 KB, text/plain)
2003-03-12 16:34 UTC, _ rkubacki
Details
hint for patch (1.51 KB, patch)
2003-03-17 14:37 UTC, Jiri Rechtacek
Details | Diff
NPE from WebContextObject$FSRemover (442 bytes, text/plain)
2003-03-18 15:17 UTC, rmatous
Details
cause of NPE (1.92 KB, text/plain)
2003-03-18 15:20 UTC, rmatous
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marian Mirilovic 2003-03-04 13:16:18 UTC
Description: 


Name: vgR10179			Date: 03/04/2003


NetBeans Version  =  Number:   030302 Date:     March 2 2003
java version "1.4.1" Java(TM) 2 Runtime Environment, Standard Edition (build
1.4.1-b21)
                              Java HotSpot(TM) Client VM (build 1.4.1-b21, mixed
mode)

Steps to reproduce are:
1) create a new directory and mount it in the Explorer;
2) look at the context menu for this directory and remember it;
3) create new Web Module using the corresponding template;
4) delete this node using the Delete key;
5) look at the context menu for local directory.
   This menu differs from one for 2) step. IMHO this behavior is incorrect. 

======================================================================




I am not sure it's issue, in my opinion it's as design. Maybe will be nice to
know why reporter says "this behaviour is incorrect".A comment.
Comment 1 Marian Mirilovic 2003-03-04 13:21:26 UTC
Bug is transfered from BugTraq:
http://developer.java.sun.com/developer/bugParade/bugs/4826858.html
Comment 2 vgorr 2003-03-05 08:37:52 UTC
My comment is very simple. Please try to push any menu item from this
menu.
The unexpected exception will be thrown in this case. I don't think
this is correct behavior.
Comment 3 Marian Mirilovic 2003-03-05 09:38:17 UTC
I am sorry, but I cannot reproduce exception. Can you send us
stack-trace and exact steps to reproduce? Thanks in advance.
Comment 4 vgorr 2003-03-05 09:58:05 UTC
No problems. Please run all steps from the issue description and push,
say, the Execute or Deploy menu items. You should get the following
exception (it's very important to use the build030302):

Annotation: Exception occurred in Request Processor
java.lang.NullPointerException
        at
org.netbeans.modules.j2ee.impl.WebExecInfo.<init>(WebExecInfo.java:43)
        at
org.netbeans.modules.web.execution.WebAppExecPerformer$Factory.createExecPerformer(WebAppExecPerformer.java:41)
        at
org.netbeans.modules.j2ee.impl.ExecPerformersStorage.getExecPerformer(ExecPerformersStorage.java:91)
        at
org.netbeans.modules.j2ee.impl.ServerExecutor.execute(ServerExecutor.java:68)
        at
org.netbeans.modules.j2ee.impl.ServerExecutor.execute(ServerExecutor.java:64)
        at
org.netbeans.modules.j2ee.impl.ExecSupport.start(ExecSupport.java:122)
        at
org.netbeans.modules.j2ee.impl.ServerExecSupport.start(ServerExecSupport.java:140)
        at
org.openide.actions.ExecuteAction.execute(ExecuteAction.java:140)
        at
org.openide.actions.ExecuteAction.execute(ExecuteAction.java:217)
        at
org.openide.actions.ExecuteAction.performAction(ExecuteAction.java:102)
        at
org.netbeans.modules.j2ee.impl.DeployAction.performAction(DeployAction.java:42)
        at
org.openide.util.actions.NodeAction$DelegateAction.actionPerformed(NodeAction.java:431)
        at org.openide.util.Task.run(Task.java:136)
        at
org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:328)
[catch] at
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:668)Annotation::
Too many arguments
Comment 5 Marian Mirilovic 2003-03-05 10:00:14 UTC
Thanks, it seems like web module isn't responsible for exception ,
maybe j2ee ? 
Comment 6 psuk 2003-03-05 15:30:36 UTC
Does it have something to do w/ deprecated org.openide.execution.ExecInfo?

See Issue 28534
Comment 7 Petr Jiricka 2003-03-06 09:46:43 UTC
No, this is not related to deprecated ExecInfo. It looks 
like some important objects (WebContextObject etc.) are 
not updated when they should be.
Comment 8 Petr Jiricka 2003-03-06 16:14:59 UTC
Vladimir, one clarification, please:

4) delete this node using the Delete key;

Which node do you mean here ? Are you talking about the 
WEB-INF node, or some other node ?

Also, can you reproduce this behavior consistently, or 
just sometimes ?

Also, what exactly is the difference between the two 
menus ?

-------
Today I noticed a problem which looks related. It only 
happens sometimes.

1) Create a new directory and mount it in the Explorer
2) Create a web module rooted in the directory mounted in 
step 1)
3) Open the popup menu of the root node of the web module

The popup menu does not contain the Web Module-specific 
actions, e.g. exporting a WAR file, or deployment.
Comment 9 Petr Jiricka 2003-03-07 14:07:18 UTC
This is reproducible in trunk even after the fix of 29675.

The problem there is that after the deletion of WEB-INF, 
the filesystem root is still represented by 
WebContextObject (instead of DataFolder). 

There is an obvious flaw in the code of 
WebInfObject.handleDelete(...), which first invalidates 
the WebContextObject, and then does the deletion. The 
order should be reversed. However, reverting the order 
does not help, so there must be another flaw.
Comment 11 _ rkubacki 2003-03-12 16:26:36 UTC
A short summary:
1) mount empty dir into IDE - DataFolder's node is shown in explorer
for this directory.

2) convert this dir to web module - DataFolder is changed to
WebContextObject and its node shown (there is a different set of
actions in context menu.

3) delete WEB-INF node to cancel treating as web module -
WebContextObject is invalidated and root of filesystem is represented
by DataFolder again but explorer is still showing the old node (with
old set of actions from 2) )

After a fix from previous comment it works rarely but in most of cases
it doesn't.
Comment 12 _ rkubacki 2003-03-12 16:34:20 UTC
Created attachment 9375 [details]
simple test to check nature of displayed objects
Comment 13 Marian Mirilovic 2003-03-13 13:43:01 UTC
Changed owner David S. -> David K.
Comment 14 David Konecny 2003-03-13 16:40:44 UTC
I tried Radim's example and if you wait for some time or force garbage
collection then the DO is correctly changed to DataFolder, but context
menu still contains old actions. Seems like actions are cached?
Comment 15 Peter Zavadsky 2003-03-16 14:37:48 UTC
contexyt actions aren't cached!! (Please read the docs) At least not
in actions-system level. Context actions are created anew according to
provided context.
 Both request for creation and supplying the context is client job
job, in this case explorer.

But it seems it isn't about context, but about that, some actions are
present while they shoudn't be, and that sounds it is another kind of
issue. Check in explorer whether the correct node is asked for
actions, and is yes whether the node supplies the correct ones.

Reassigning.
Comment 16 Jiri Rechtacek 2003-03-17 14:37:51 UTC
Created attachment 9428 [details]
hint for patch
Comment 17 Jiri Rechtacek 2003-03-17 14:50:59 UTC
There is a bug in datasystems -> reassign back to David.
The roots of filesystems are not updated by data object change. This
bug was also in previous releases, but it wasn't so visible because a
web nodes didn't change a set of own actions.

Hints: 1) the web module calls setValid(false) on DataFolder during
convert ExLocalFileSystem -> web.context.DelegatingFileSystem, and
calls setValid(false) of data object WebContextObject during convert
web.context.DelegatingFileSystem -> ExLocalFileSystem
2) the keys of children are set in core.DataSystem
Comment 18 rmatous 2003-03-18 15:17:27 UTC
Created attachment 9446 [details]
NPE from WebContextObject$FSRemover
Comment 19 rmatous 2003-03-18 15:20:02 UTC
Created attachment 9447 [details]
cause of NPE
Comment 20 rmatous 2003-03-18 15:27:03 UTC
Fixed int release35 and trunk according to attached patch, which seems
to be OK and refreshes children of DataSystem node properly.  But
there still remains problem in web module, which prevents from right
behaviour.

Web module must first invalidate appropriate WCO and then modify
Repository, which isn't done because of NPE (see attachment). 

Reassigned back. 

/cvs/core/src/org/netbeans/core/DataSystem.java,v  <--  DataSystem.java
new revision: 1.45; previous revision: 1.44
Comment 21 _ rkubacki 2003-03-25 16:59:36 UTC
Currently fixed in trunk together with issue #32166
Comment 22 _ rkubacki 2003-03-26 09:12:28 UTC
raising priority to P1 - this causes really unpleasant behaviuor and
is related to couple of other high priority bugs
Comment 23 _ rkubacki 2003-03-28 13:18:26 UTC
fixed in 3.5 too (commited together with fix for #31266)
Comment 24 Marian Mirilovic 2003-04-01 08:22:10 UTC
verified in [s1s5](030331)