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.
Summary: | invalid context menu when Web Module node is deleted. | ||
---|---|---|---|
Product: | javaee | Reporter: | Marian Mirilovic <mmirilovic> |
Component: | Code | Assignee: | _ rkubacki <rkubacki> |
Status: | VERIFIED FIXED | ||
Severity: | blocker | CC: | dkonecny, jrechtacek, rmatous, vgorr |
Priority: | P1 | ||
Version: | 3.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: | |
Attachments: |
simple test to check nature of displayed objects
hint for patch NPE from WebContextObject$FSRemover cause of NPE |
Description
Marian Mirilovic
2003-03-04 13:16:18 UTC
Bug is transfered from BugTraq: http://developer.java.sun.com/developer/bugParade/bugs/4826858.html 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. I am sorry, but I cannot reproduce exception. Can you send us stack-trace and exact steps to reproduce? Thanks in advance. 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 Thanks, it seems like web module isn't responsible for exception , maybe j2ee ? Does it have something to do w/ deprecated org.openide.execution.ExecInfo? See Issue 28534 No, this is not related to deprecated ExecInfo. It looks like some important objects (WebContextObject etc.) are not updated when they should be. 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. 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. Reverting works for me: http://web.netbeans.org/source/browse/web/core/src/org/netbeans/modules/web/context/WebInfObject.java.diff?r1=1.12&r2=1.13 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. Created attachment 9375 [details]
simple test to check nature of displayed objects
Changed owner David S. -> David K. 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? 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. Created attachment 9428 [details]
hint for patch
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 Created attachment 9446 [details]
NPE from WebContextObject$FSRemover
Created attachment 9447 [details]
cause of NPE
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 Currently fixed in trunk together with issue #32166 raising priority to P1 - this causes really unpleasant behaviuor and is related to couple of other high priority bugs fixed in 3.5 too (commited together with fix for #31266) verified in [s1s5](030331) |