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 160262

Summary: Opening of projects that cannot be opened is not handled correctly
Product: ide Reporter: Vladimir Voskresensky <vv159170>
Component: Features On DemandAssignee: Jaroslav Tulach <jtulach>
Status: RESOLVED FIXED    
Severity: blocker CC: joshis, jtulach
Priority: P2 Keywords: ERGONOMICS
Version: 6.x   
Hardware: All   
OS: All   
URL: http://statistics.netbeans.org/exceptions/detail.do?id=147433
Issue Type: DEFECT Exception Reporter: 147433
Bug Depends on: 160265    
Bug Blocks:    
Attachments: stacktrace
stacktrace

Description Vladimir Voskresensky 2009-03-13 15:20:33 UTC
Build: NetBeans IDE Dev (Build 090313)
VM: Java HotSpot(TM) Server VM, 11.0-b16, Java(TM) SE Runtime Environment, 1.6.0_11-b03
OS: SunOS, 5.10, x86

User Comments:
GUEST: Closing projects.

vv159170: hovered mouse over some folders in Favorites window



Stacktrace: 
java.lang.IllegalArgumentException
        at org.netbeans.modules.project.ant.AntBasedGenericType.createProject(AntBasedGenericType.java:126)
        at org.netbeans.modules.project.ant.AntBasedProjectFactorySingleton.loadProject(AntBasedProjectFactorySingleton.java:238)
        at org.netbeans.api.project.ProjectManager.createProject(ProjectManager.java:355)
        at org.netbeans.api.project.ProjectManager.access$300(ProjectManager.java:81)
        at org.netbeans.api.project.ProjectManager$2.run(ProjectManager.java:276)
        at org.netbeans.api.project.ProjectManager$2.run(ProjectManager.java:228)
Comment 1 Vladimir Voskresensky 2009-03-13 15:20:45 UTC
Created attachment 78147 [details]
stacktrace
Comment 2 Jesse Glick 2009-03-13 15:53:18 UTC
As the message says - you cannot check out just the cnd module, you need to have the nb.org build infrastructure and
required modules in the same tree. Probably INVALID. See however

http://wiki.netbeans.org/DevFaqOrphanedNetBeansOrgModules
Comment 3 Jesse Glick 2009-03-13 15:56:45 UTC
...though the IOException should very likely link to that wiki page using Exceptions.attachLocalizedMessage.
Comment 4 Vladimir Voskresensky 2009-03-13 15:59:20 UTC
jesse,
In my development IDE I opened Favorites window and just browsed my home folder, I didn't try to do anything VCS
related. I think it is bad to have such noise message with popup dialog when user browsing folders
Comment 5 Jesse Glick 2009-03-13 16:18:33 UTC
Nothing to do with VCS. You apparently have the cnd module project in a tree structure without the rest of the main
repo. Selecting a node from a project tries to load the project. In this case the project was unloadable because an
orphaned nb.org module cannot be loaded (without special steps as given in the wiki).

Regarding the dialog popping up unprompted, there is also apparently a real bug which I have filed as issue #160265.
Comment 6 Petr Dvorak 2009-03-31 15:15:12 UTC
Build: NetBeans IDE Dev (Build 200903291205)
VM: Java HotSpot(TM) Client VM, 11.0-b15, Java(TM) SE Runtime Environment, 1.6.0_10-b33
OS: Linux, 2.6.27-14-generic, i386

User Comments: 
I opened a "csl.api" module in M3 build.

Stacktrace: 
java.io.IOException: netbeans.org-type module requires at least nbbuild: /home/tester/nbsrc/main/dlight
        at org.netbeans.modules.apisupport.project.NbModuleProject.<init>(NbModuleProject.java:168)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(NativeConstructorAccessorImpl.java:0)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at org.netbeans.modules.project.ant.AntBasedGenericType.createProject(AntBasedGenericType.java:122)
Comment 7 Petr Dvorak 2009-03-31 15:15:23 UTC
Created attachment 79147 [details]
stacktrace
Comment 8 Petr Dvorak 2009-03-31 15:30:49 UTC
This is likely an ergonomics issue, to reproduce:

1. Have a clone of the "main" netbeans repository
2. Delete the nbbuild folder (or just move it elsewhere)
3. Start ergonomic IDE with a fresh userdir
4. Invoke the "Open Project" dialog and navigate to the "main" folder
-> you can see the netbeans module projects (feature is not yet active)

5. Select some project and open it
-> IOE + Projects view contains the nodes you would see in the Files view (not the node you see for the project, just
the file structure)
Comment 9 Jaroslav Tulach 2009-03-31 16:14:27 UTC
First of all: If you delete nbbuild, then it is first and foremost your bug. You created an error condition, the 
system does report an error, so what? Making P5.

Second: 2/3 of the submitted problems are not related to ergonomics. Should you pay more attention to the actual 
failures and not your silly reproducible cases, you would not even try to reassign to ergonomics. Passing back to 
apisupport. Let it be fixed or won'tfixed there.
Comment 10 Petr Dvorak 2009-03-31 17:27:34 UTC
Jardo:

- I didn't consciously delete nbbuild folder -> this is not a silly test case I just invented and I am happy of. I did
it after I normally worked with the IDE. I was developing unit tests for modules with no problem and then I was unable
to open one module due to this error.

- Yes, it is indeed an issue of ergonomics, please spend 2 minutes reproducing the issue on build with/without ergonomic
cluster. IDE without ergonomic cluster does not even allow you to open the module (it shows a message in the dialog). On
the other hand, IDE with ergonomic shows there is a Netbeans project. Than you can try to open it and then you have got
the exception (the second one of those 2 exceptions that are reported on this page = 1/2 of the problems reported here).

- System does not "report error", it produces an uncaught exception. If I deleted some files related to Netbeans IDE
itself (config, clusters, ...), I would understand your opinion about this not being a bug but I deleted files related
to a Netbeans project.

- Priority is indeed up to you - as no-one except NB developers and someone who want to build on NB Platform needs to
care about sources, this issue can remain P5...
Comment 11 Jesse Glick 2009-03-31 17:54:54 UTC
Not an apisupport issue. The project is corrupt (cannot realistically load anything without nbbuild) and
apisupport.project throws IOException as it is permitted to do. Issue #160265 requested that this be rethrown as an IOE,
not an IAE, which was fixed a couple weeks ago. If an exception dialog is still being shown, that would be an ergonomics
issue; FeatureProjectFactory.java:

                try {
                    ...
                    ... ProjectManager.getDefault().findProject(getProjectDirectory());
                    ...
                } catch (Exception ex) {
                    Exceptions.printStackTrace(ex);
                }

This should be catching IOException and either ignoring it (logging at low level), or displaying a polite error dialog
explaining that the project turned out to be unloadable.
Comment 12 Jaroslav Tulach 2009-04-01 11:31:22 UTC
OK. I'll present the problem as polite error report.
Comment 13 Jaroslav Tulach 2009-04-07 08:21:25 UTC
Simply showing a dialog instead of Exceptions.pst is not a solution. I got fourteen of such dialogs at once when I 
tried it yesterday with removed nbbuild. I guess I will let the project open somehow mark it as broken in the projects 
tab.
Comment 14 Jaroslav Tulach 2009-04-10 14:13:48 UTC
The behaviour is even "better" if you try to run on --jdkhome jre and open a Java project. This needs to be fixed.
Comment 15 Jaroslav Tulach 2009-04-14 12:25:15 UTC
ergonomics#31e0f884c4c9
Comment 16 Quality Engineering 2009-04-15 07:48:00 UTC
Integrated into 'main-golden', will be available in build *200904150201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/7001be000a6f
User: Jaroslav Tulach <jtulach@netbeans.org>
Log: #160262: Last part of the fix. Making sure the IOException from ProjectFactory produces broken project as well