Bug 33684 - [Wizards] Error when trying to create a new project
Summary: [Wizards] Error when trying to create a new project
Status: CLOSED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows 2000
: P3 major (vote)
Target Milestone: 2.1.1   Edit
Assignee: Tod Creasey CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 33749 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-03-03 12:34 EST by David Freels CLA
Modified: 2005-05-10 14:53 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Freels CLA 2003-03-03 12:34:45 EST
Trying to create a new project. I use the wizard and point to a folder with 
three source folders which contain java files with no package folders. Here is 
the log entry:

!MESSAGE Invalid project description.
!SUBENTRY 1 org.eclipse.core.resources 0 0 Mar 03, 2003 07:42:12.922
!MESSAGE OK.
!SUBENTRY 1 org.eclipse.core.resources 4 77 Mar 03, 2003 07:42:12.922
!MESSAGE C:/Projects/FOBO/prototypes and C:/projects overlap.
!ENTRY org.eclipse.jdt.ui 4 10001 Mar 03, 2003 11:23:12.569
!MESSAGE Internal Error
!STACK 1
org.eclipse.core.internal.resources.ResourceException: Invalid project 
description.
	at org.eclipse.core.internal.resources.Project.checkDescription
(Project.java:131)
	at org.eclipse.core.internal.resources.Project.create(Project.java:220)
	at 
org.eclipse.jdt.internal.ui.wizards.buildpaths.BuildPathsBlock.createProject
(BuildPathsBlock.java:548)
	at 
org.eclipse.jdt.ui.wizards.JavaCapabilityConfigurationPage.createProject
(JavaCapabilityConfigurationPage.java:180)
	at 
org.eclipse.jdt.internal.ui.wizards.NewProjectCreationWizardPage.updateProject
(NewProjectCreationWizardPage.java:109)
	at 
org.eclipse.jdt.internal.ui.wizards.NewProjectCreationWizardPage$1.run
(NewProjectCreationWizardPage.java:80)
	at org.eclipse.jface.operation.ModalContext.runInCurrentThread
(ModalContext.java:296)
	at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:246)
	at org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java:752)
	at 
org.eclipse.jdt.internal.ui.wizards.NewProjectCreationWizardPage.changeToNewProj
ect(NewProjectCreationWizardPage.java:88)
	at 
org.eclipse.jdt.internal.ui.wizards.NewProjectCreationWizardPage.setVisible
(NewProjectCreationWizardPage.java:58)
	at org.eclipse.jface.wizard.WizardDialog.updateForPage
(WizardDialog.java:953)
	at org.eclipse.jface.wizard.WizardDialog.access$1(WizardDialog.java:934)
	at org.eclipse.jface.wizard.WizardDialog$3.run(WizardDialog.java:923)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:65)
	at org.eclipse.jface.wizard.WizardDialog.showPage(WizardDialog.java:921)
	at org.eclipse.jface.wizard.WizardDialog.nextPressed
(WizardDialog.java:678)
	at org.eclipse.jface.wizard.WizardDialog.buttonPressed
(WizardDialog.java:310)
	at org.eclipse.jface.dialogs.Dialog$1.widgetSelected(Dialog.java:417)
	at org.eclipse.swt.widgets.TypedListener.handleEvent
(TypedListener.java:87)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:77)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:836)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1775)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1483)
	at org.eclipse.jface.window.Window.runEventLoop(Window.java:577)
	at org.eclipse.jface.window.Window.open(Window.java:557)
	at org.eclipse.ui.actions.NewWizardAction.run(NewWizardAction.java:123)
	at org.eclipse.ui.internal.NewWizardDropDownAction.run
(NewWizardDropDownAction.java:83)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:841)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection
(ActionContributionItem.java:456)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent
(ActionContributionItem.java:403)
	at org.eclipse.jface.action.ActionContributionItem.access$0
(ActionContributionItem.java:397)
	at 
org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent
(ActionContributionItem.java:72)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:77)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:836)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1775)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1483)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1271)
	at org.eclipse.ui.internal.Workbench.run(Workbench.java:1254)
	at org.eclipse.core.internal.boot.InternalBootLoader.run
(InternalBootLoader.java:845)
	at org.eclipse.core.boot.BootLoader.run(BootLoader.java:461)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:324)
	at org.eclipse.core.launcher.Main.basicRun(Main.java:247)
	at org.eclipse.core.launcher.Main.run(Main.java:703)
	at org.eclipse.core.launcher.Main.main(Main.java:539)
Comment 1 Philipe Mulet CLA 2003-03-03 12:39:23 EST
Moving to platform
Comment 2 John Arthorne CLA 2003-03-03 15:40:59 EST
This is actually a problem in platform UI.

The new project wizard (WizardNewProjectNameAndLocationPage), should be calling
IWorkspace.validateProjectLocation on the location provided on the first page. 
In this case, it looks like the user has tried to specify a location that is a
parent of the default platform location.  Here is a simple test case:

1) Assume your workspace location is d:\eclipse\test
2) Try to create a simple project with location d:\eclipse

-> The wizard doesn't complain, but when you hit finish, you get an error
message ("invalid project description").

David, FYI: you aren't allowed to create a project at that location.  This is a
legitimate error message, but the problem should have been presented to you in a
nicer way.
Comment 3 David Freels CLA 2003-03-03 15:49:09 EST
Actually, it is the other way around.

My workspace location is C:\Projects.
I am trying to create a project in C:\Projects\FOBO\prototypes.

DF
Comment 4 John Arthorne CLA 2003-03-05 15:29:15 EST
That's also not allowed.  If this were allowed to proceed, and then you created
a project called "FOBO" in the default location, it would result in overlapping
projects.  Project locations can be:

a) Directly below the workspace location (in this case c:\projects)
b) Any location that does not overlap the workspace location (either as a parent
or as a child).

The code in WizardExternalProjectImportPage.validatePage should also be calling
the core IWorkspace.validateProjectLocation with the value from the location field.

The diagnosis is the same, this is a user error that should have been caught
during pre-validation (as the user types) rather than at project creation time
(when the user clicks finish).
Comment 5 John Arthorne CLA 2003-03-10 13:35:39 EST
*** Bug 33749 has been marked as a duplicate of this bug. ***
Comment 6 Knut Radloff CLA 2003-03-12 10:58:00 EST
The failing scenario does not involve linked resources. This is a problem with 
the new project wizards and the project import wizard.
Comment 7 Tod Creasey CLA 2003-04-01 11:12:39 EST
You should be getting an error message that says "project contents inside of 
workbench directory" in that case.

From the trace it is not the "Import External Project" wizard being used - it 
is the java project wizard.

I cannot replicate this case. Could you please give steps including how the 
structure you are trying to point to is created (i.e. within or outside of 
Eclipse)?

The error dialog Jon reported is not a serious issue but this trace is.
Comment 8 Tod Creasey CLA 2003-04-01 14:09:08 EST
From David Freels:

I have solved the problem since the original bug was
submitted. I will outline what I did and what was
happening below:

1) Created folder C:\Projects
2) Moved .metadata folder under projects
3) Many projects were already created, so no problems
   were apparent.
4) Source control stored a project with sub-projects.
5) Created a project C:\FOBO
6) Tried to create a project C:\FOBO\prototypes

I have created a new folder called eclipse_workspace
and moved the .metadata folder there and pointed
eclipse to that directory using the -data switch. This
has fixed my problem. I reported this because the
older versions of eclipse didn't seem to have this
problem.
Comment 9 Tod Creasey CLA 2003-04-01 14:10:50 EST
David can you submit any steps that can make this exception happen on 2.1? 
Your workaround looks fine but I hardly want that to be our official line...
Comment 10 John Arthorne CLA 2003-04-01 14:29:44 EST
Here are two sets of steps for reproducing this stack trace in 2.1:

In both cases we assume the workspace location is c:\eclipse\test

Scenario 1: project is parent of workspace

 1) Open the Java project wizard, enter a name
 2) Enter a custom location of c:\eclipse
 3) Hit next (error dialog, but next page is still shown)
 4) Hit finish (error dialog plus stack trace in log)

Scenario 2: project within another project (these are David's steps)

 1) Create a simple project with custom location d:\temp
 2) Open the Java project wizard, enter a name
 3) Enter a custom location of d:\temp\foo
 4) Hit next (error dialog, but next page is still shown)
 5) Hit finish (error dialog plus stack trace in log)

In both cases IWorkspace.validateProjectLocation can be used to check the
location and disable the "Next" button as appropriate.
Comment 11 Tod Creasey CLA 2003-04-02 09:41:41 EST
Fixed in build >20030402
Comment 12 Nick Edgar CLA 2003-04-16 15:01:30 EDT
Approved to fix in 2.1.1.
Comment 13 Tod Creasey CLA 2003-04-17 09:46:00 EDT
Fix released to 2.1.1 stream
Comment 14 Tod Creasey CLA 2005-05-10 14:53:55 EDT
Marking as closed.