Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 150922

Summary: [build path] Internal Error when creating new Java project
Product: [Eclipse Project] JDT Reporter: Dani Megert <daniel_megert>
Component: UIAssignee: Benno Baumgartner <benno.baumgartner>
Status: CLOSED FIXED QA Contact:
Severity: major    
Priority: P3    
Version: 3.2   
Target Milestone: 3.3 M1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
remove ResetAllAction
none
fix none

Description Dani Megert CLA 2006-07-18 06:40:54 EDT
I20060711-1100 + smoke plug-in export (works using plain I20060711-1100)

1. start fresh workspace
2. click tool bar button to create new Java project
3. enter 'P' as name
4. click 'Finish'
==>
eclipse.buildId=I20060711-1100
java.version=1.5.0_06
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=de_CH
Framework arguments:  -update -keyring c:\eclipse\.keyring -application org.eclipse.ui.ide.workbench -showlocation
Command-line arguments:  -update -keyring c:\eclipse\.keyring -application org.eclipse.ui.ide.workbench -showlocation -data c:\eclipse\workspaces\tmp

Error
Tue Jul 18 12:42:22 CEST 2006
Internal Error

Java Model Exception: Java Model Status [P does not exist]
at org.eclipse.jdt.internal.core.JavaElement.newNotPresentException(JavaElement.java:485)
at org.eclipse.jdt.internal.core.JavaModelManager.getPerProjectInfoCheckExistence(JavaModelManager.java:1577)
at org.eclipse.jdt.internal.core.JavaProject.getPerProjectInfo(JavaProject.java:1779)
at org.eclipse.jdt.internal.core.JavaProject.getRawClasspath(JavaProject.java:1821)
at org.eclipse.jdt.internal.corext.buildpath.ClasspathModifier.getExistingEntries(ClasspathModifier.java:838)
at org.eclipse.jdt.internal.ui.wizards.buildpaths.newsourcepage.ResetAllAction.setBreakPoint(ResetAllAction.java:73)
at org.eclipse.jdt.internal.ui.wizards.buildpaths.newsourcepage.HintTextGroup.setJavaProject(HintTextGroup.java:155)
at org.eclipse.jdt.internal.ui.wizards.buildpaths.newsourcepage.NewSourceContainerWorkbookPage.init(NewSourceContainerWorkbookPage.java:111)
at org.eclipse.jdt.internal.ui.wizards.buildpaths.BuildPathsBlock.doUpdateUI(BuildPathsBlock.java:354)
at org.eclipse.jdt.internal.ui.wizards.buildpaths.BuildPathsBlock$2.run(BuildPathsBlock.java:343)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:123)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3352)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2998)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.block(ModalContext.java:158)
at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:326)
at org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java:854)
at org.eclipse.jdt.internal.ui.wizards.NewElementWizard.performFinish(NewElementWizard.java:133)
at org.eclipse.jdt.internal.ui.wizards.JavaProjectWizard.performFinish(JavaProjectWizard.java:66)
at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:683)
at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:355)
at org.eclipse.jface.dialogs.Dialog$3.widgetSelected(Dialog.java:660)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:90)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3375)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2995)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:820)
at org.eclipse.jface.window.Window.open(Window.java:796)
at org.eclipse.jdt.ui.actions.AbstractOpenWizardAction.run(AbstractOpenWizardAction.java:83)
at org.eclipse.jdt.internal.ui.wizards.OpenJavaProjectWizardToolbarAction.run(OpenJavaProjectWizardToolbarAction.java:45)
at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:254)
at org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPluginAction.java:229)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:539)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:488)
at org.eclipse.jface.action.ActionContributionItem$6.handleEvent(ActionContributionItem.java:441)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3375)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2995)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1914)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:419)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
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:585)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
at org.eclipse.core.launcher.Main.run(Main.java:977)
at org.eclipse.core.launcher.Main.main(Main.java:952)
Comment 1 Benno Baumgartner CLA 2006-07-18 07:25:37 EDT
Created attachment 46427 [details]
remove ResetAllAction

Fix for this weeks integration build: Remove the action.
Comment 2 Benno Baumgartner CLA 2006-07-18 07:30:32 EDT
Problem is that org.eclipse.jdt.internal.ui.wizards.buildpaths.BuildPathsBlock.doUpdateUI() calles  init on the NewSourceContainerWorkbookPage with a potentialy (doUpdateUI is an async exec!) not yet created IJavaProject as parameter.

Solution: Need a protocol for BuildPathsBlock:
1. new BuildPathsBlock()
2. createControl()
3. init(IJavaProject project)
or
1. new BuildPathsBlock()
2. init(IJavaProject project)
3. createControl()

with init requires: project != null && project.exists()

Comment 3 Benno Baumgartner CLA 2006-07-18 07:33:50 EDT
Second problem is, that the Action is initialized on finishing the first wizard page: The action shouldn't even exist.
Third problem is, that ResetAllAction should use some sort of history. The history should be initialized, instead of the action itself.
Comment 4 Benno Baumgartner CLA 2006-07-21 08:52:16 EDT
Can't specify such a protocol, since it would lead to breaking API changes in org.eclipse.jdt.ui.wizards.JavaCapabilityConfigurationPage. Best fix I can think of is to register an IElementChangeListener if the project does not exist and wait until it does. (And of course don't init the BuildPathBasePages in a async ui thread)
Comment 5 Benno Baumgartner CLA 2006-07-21 08:53:29 EDT
Created attachment 46630 [details]
fix
Comment 6 Benno Baumgartner CLA 2006-07-21 08:54:04 EDT
fixed > I20060718-0800
Comment 7 Benno Baumgartner CLA 2006-07-21 09:01:32 EDT
For second problem see Bug 151400

Third problem is an enhancement and minor, for later.