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 47611 - [40cat] New project from existing code wizard throws exception if project is created twice
Summary: [40cat] New project from existing code wizard throws exception if project is ...
Status: RESOLVED DUPLICATE of bug 42422
Alias: None
Product: java
Classification: Unclassified
Component: Project (show other bugs)
Version: 4.x
Hardware: PC Windows ME/2000
: P3 blocker (vote)
Assignee: Tomas Zezula
Depends on:
Blocks: 41537
  Show dependency tree
Reported: 2004-08-20 23:36 UTC by pasek
Modified: 2004-08-23 22:09 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description pasek 2004-08-20 23:36:45 UTC
[ BUILD # : Beta1 ]
[ JDK VERSION : J2SE 1.5.0 ]

Setup for problem:

Project Dir: D:\Temp\ProjectYZ
Src Dir: D:\Temp\ProjectYZ/src
Test Src Dir: D:\Temp\ProjectYZ/test

If I try to create a project for this setup for a second time (after I deleted all files of the first project creation inside these directories) the following Exception is thrown:

java.lang.IllegalArgumentException: Already a project in MasterFileObject@10ac5e8[file:/D:/Temp/ProjectYZ/]
	at org.openide.util.Mutex.writeAccess(
	at org.openide.loaders.TemplateWizard$Brigde2Iterator.instantiate(
	at org.openide.loaders.TemplateWizard.handleInstantiate(
	at org.openide.loaders.TemplateWizard.instantiateImpl(
	at org.openide.loaders.TemplateWizard.instantiate(
	at org.netbeans.modules.project.ui.actions.NewProject.actionPerformed(
	at javax.swing.AbstractButton.fireActionPerformed(
	at javax.swing.AbstractButton$Handler.actionPerformed(
	at javax.swing.DefaultButtonModel.fireActionPerformed(
	at javax.swing.DefaultButtonModel.setPressed(
	at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(
	at java.awt.AWTEventMulticaster.mouseReleased(
	at java.awt.Component.processMouseEvent(
	at javax.swing.JComponent.processMouseEvent(
	at java.awt.Component.processEvent(
	at java.awt.Container.processEvent(
	at java.awt.Component.dispatchEventImpl(
	at java.awt.Container.dispatchEventImpl(
	at java.awt.Component.dispatchEvent(
	at java.awt.LightweightDispatcher.retargetMouseEvent(
	at java.awt.LightweightDispatcher.processMouseEvent(
	at java.awt.LightweightDispatcher.dispatchEvent(
	at java.awt.Container.dispatchEventImpl(
	at java.awt.Window.dispatchEventImpl(
	at java.awt.Component.dispatchEvent(
[catch] at java.awt.EventQueue.dispatchEvent(
	at java.awt.EventDispatchThread.pumpOneEventForHierarchy(
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(
	at java.awt.EventDispatchThread.pumpEvents(
	at java.awt.EventDispatchThread.pumpEvents(
Comment 1 Jesse Glick 2004-08-21 00:54:39 UTC
Tomas can you look at it? I thought this category of problem was long
since fixed, but maybe not...
Comment 2 Jesse Glick 2004-08-21 00:58:14 UTC
Reproducible for me. The question is what to do about it. The project
manager thinks there is still a project there because the project
directory still exists. It does listen for deletions of the project
directory, but not just deletion of project metadata (since only the
project factory knows what the project metadata actually is).

Not solvable for 4.0, I think - would require API changes.

Reporter: either delete entire project directory (if it has nothing
valuable), or restart IDE between attempts.

*** This issue has been marked as a duplicate of 42422 ***
Comment 3 pasek 2004-08-21 09:57:47 UTC
Maybe you should just catch the exception and present a more pleasant
error message.
Comment 4 Jesse Glick 2004-08-21 17:46:14 UTC
Good idea. Even better, I will put in a fix to make the New Project
wizard prevent you from even finishing under this circumstance. It
will display a brief error message advising you to restart the IDE if
you wish to reuse that project folder. (Only applies if the folder is
really clear of metadata from the previous project such as nbproject/
and build.xml; otherwise a different message is shown.)
Comment 5 Jesse Glick 2004-08-23 22:09:14 UTC
Prevent user from completing dialog under such circumstances, with a

committed   * Up-To-Date  1.33       
committed   * Up-To-Date  1.23