Community
Participate
Working Groups
I20060922-0010 - new workspace - open Plug-ins view, select all plugins, context menu > Add to Java Search - Run > Debug... - create a new 'Remote Java Application' launch configuration and select 'External Plug-in Libraries' as project; save, but do not debug - go to Debug perspective, Breakpoints view, and press 'Add Java Breakpoint' button java.lang.reflect.InvocationTargetException at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:350) at org.eclipse.jface.dialogs.ProgressMonitorDialog.run(ProgressMonitorDialog.java:479) at org.eclipse.ui.internal.progress.ProgressMonitorJobsDialog.run(ProgressMonitorJobsDialog.java:265) at org.eclipse.ui.internal.progress.ProgressManager$3.run(ProgressManager.java:890) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67) at org.eclipse.ui.internal.progress.ProgressManager.busyCursorWhile(ProgressManager.java:925) at org.eclipse.ui.internal.progress.ProgressManager.busyCursorWhile(ProgressManager.java:900) at org.eclipse.ui.internal.progress.ProgressManager.run(ProgressManager.java:1108) at org.eclipse.jdt.internal.ui.dialogs.TypeSelectionDialog2.ensureConsistency(TypeSelectionDialog2.java:341) at org.eclipse.jdt.internal.ui.dialogs.TypeSelectionDialog2.open(TypeSelectionDialog2.java:208) at org.eclipse.jdt.internal.debug.ui.breakpoints.AddExceptionAction.run(AddExceptionAction.java:85) at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:254) 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:3390) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3009) 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:104) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:74) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:348) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:165) 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:341) at org.eclipse.core.launcher.Main.basicRun(Main.java:285) at org.eclipse.core.launcher.Main.run(Main.java:987) at org.eclipse.core.launcher.Main.main(Main.java:962) Caused by: java.lang.NullPointerException at org.eclipse.jdt.internal.core.search.JavaSearchScope.addEnclosingProjectOrJar(JavaSearchScope.java:60) at org.eclipse.jdt.internal.core.search.JavaSearchScope.add(JavaSearchScope.java:141) at org.eclipse.jdt.internal.core.search.JavaWorkspaceScope.initialize(JavaWorkspaceScope.java:84) at org.eclipse.jdt.internal.core.search.JavaWorkspaceScope.enclosingProjectsAndJars(JavaWorkspaceScope.java:63) at org.eclipse.jdt.internal.core.search.IndexSelector.initializeIndexLocations(IndexSelector.java:123) at org.eclipse.jdt.internal.core.search.IndexSelector.getIndexLocations(IndexSelector.java:204) at org.eclipse.jdt.internal.core.search.JavaSearchParticipant.selectIndexes(JavaSearchParticipant.java:112) at org.eclipse.jdt.internal.core.search.PatternSearchJob.getIndexes(PatternSearchJob.java:80) at org.eclipse.jdt.internal.core.search.PatternSearchJob.ensureReadyToRun(PatternSearchJob.java:51) at org.eclipse.jdt.internal.core.search.processing.JobManager.performConcurrentJob(JobManager.java:177) at org.eclipse.jdt.internal.core.search.BasicSearchEngine.searchAllTypeNames(BasicSearchEngine.java:770) at org.eclipse.jdt.core.search.SearchEngine.searchAllTypeNames(SearchEngine.java:603) at org.eclipse.jdt.internal.ui.dialogs.TypeSelectionDialog2$1$ConsistencyRunnable.refreshSearchIndices(TypeSelectionDialog2.java:320) at org.eclipse.jdt.internal.ui.dialogs.TypeSelectionDialog2$1$ConsistencyRunnable.run(TypeSelectionDialog2.java:306) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:113)
If you wait a bit (until indexing is done?) before pressing the 'Add Java Breakpoint' button, the following exception is thrown: java.lang.ArrayIndexOutOfBoundsException: 24 at org.eclipse.jdt.internal.core.search.JavaSearchScope.addEnclosingProjectOrJar(JavaSearchScope.java:60) at org.eclipse.jdt.internal.core.search.JavaSearchScope.add(JavaSearchScope.java:141) at org.eclipse.jdt.internal.core.search.JavaWorkspaceScope.initialize(JavaWorkspaceScope.java:84) at org.eclipse.jdt.internal.core.search.JavaWorkspaceScope.enclosingProjectsAndJars(JavaWorkspaceScope.java:63) at org.eclipse.jdt.internal.core.search.IndexSelector.initializeIndexLocations(IndexSelector.java:123) at org.eclipse.jdt.internal.core.search.IndexSelector.getIndexLocations(IndexSelector.java:204) at org.eclipse.jdt.internal.core.search.JavaSearchParticipant.selectIndexes(JavaSearchParticipant.java:112) at org.eclipse.jdt.internal.core.search.PatternSearchJob.getIndexes(PatternSearchJob.java:80) at org.eclipse.jdt.internal.core.search.PatternSearchJob.ensureReadyToRun(PatternSearchJob.java:51) at org.eclipse.jdt.internal.core.search.processing.JobManager.performConcurrentJob(JobManager.java:177) at org.eclipse.jdt.internal.core.search.BasicSearchEngine.searchAllTypeNames(BasicSearchEngine.java:770) at org.eclipse.jdt.core.search.SearchEngine.searchAllTypeNames(SearchEngine.java:680) at org.eclipse.jdt.internal.ui.dialogs.TypeInfoViewer$SearchEngineJob.getSearchResult(TypeInfoViewer.java:649) at org.eclipse.jdt.internal.ui.dialogs.TypeInfoViewer$AbstractSearchJob.internalRun(TypeInfoViewer.java:556) at org.eclipse.jdt.internal.ui.dialogs.TypeInfoViewer$AbstractSearchJob.doRun(TypeInfoViewer.java:503) at org.eclipse.jdt.internal.ui.dialogs.TypeInfoViewer$AbstractJob.run(TypeInfoViewer.java:469) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)
I guess you talked about 'Add Java Exception Breakpoint' as I cannot find any 'Add Java Breakpoint' button. However, I cannot reproduce the exception, even waiting a long time... I did a test using 3.3 M2 runtime session or in self-hosting environment. I also used both VM 1.4.2 and 1.5.0, all these tests succeeded. Any other hints to help me to reproduce?
Yes, I meant 'Add Java Exception Breakpoint'. I could also reproduce with steps from comment 0 in a runtime workspace running on JDK 1.5.0_08. Have you tried reproducing with a fresh install and a new workspace, starting with 'eclipse.exe -data newWorkspace -consolelog'?
(In reply to comment #3) > Yes, I meant 'Add Java Exception Breakpoint'. > > I could also reproduce with steps from comment 0 in a runtime workspace running > on JDK 1.5.0_08. Have you tried reproducing with a fresh install and a new > workspace, starting with 'eclipse.exe -data newWorkspace -consolelog'? > Yes, I did this test with same config: JDK 1.5.0_08 + 3.3 M2 fresh install + new wksp + run: eclipse.exe -data d:\tmp\wksp -consoleLog -vm d:\a\JDKs\sun\1.5.0\jre\bin\java + comment 0 steps And I didn't get any exception in console...!? Could you reproduce it on an other box?
I could also reproduce on our Linux-GTK box (dual core, like my machine). I could *not* reproduce on Martin's single-core machine. Refined steps: - new workspace - close Welcome view - Alt+Shift+Q, Q - open Plug-ins view --- the following steps should be executed without breaks: --- - Ctrl+A - context menu > Add to Java Search - main menu Run > Debug... - doubleclick 'Remote Java Application' - click 'Browse', click 'OK' - click 'Close', click 'Yes' - open Debug perspective - click on tab of 'Breakpoints' view - click 'Add Java Exception Breakpoint' button I did not manage to get the trace from comment 0 any more. When I execute the steps with normal speed, I always get comment 1 now. When I waited very long between steps (to write up this list), I did not get any log entries any more.
Steps to reproduce the NPE in I20070222-0951 (3.3M5a candidate): - new workspace - create new Java project "J" - import org.eclipse.pde.ui and all required plug-ins as binary - while the (non-modal) progress dialog is up, select "J" - open New Class wizard - repeat the following around the time when the plug-in import completes: - click Browse... for superclass - click Cancel eclipse.buildId=I20070222-0951 java.version=1.5.0_11 java.vendor=Sun Microsystems Inc. BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=de_CH Framework arguments: -showlocation Command-line arguments: -data cl1 -clean -consolelog -console -showlocation Error Fri Feb 23 14:50:26 CET 2007 An internal error occurred during: "Items filtering". java.lang.NullPointerException at org.eclipse.jdt.internal.core.search.JavaSearchScope.addEnclosingProjectOrJar(JavaSearchScope.java:77) at org.eclipse.jdt.internal.core.search.JavaSearchScope.add(JavaSearchScope.java:145) at org.eclipse.jdt.internal.core.search.JavaWorkspaceScope.initialize(JavaWorkspaceScope.java:84) at org.eclipse.jdt.internal.core.search.JavaWorkspaceScope.enclosingProjectsAndJars(JavaWorkspaceScope.java:63) at org.eclipse.jdt.internal.core.search.IndexSelector.initializeIndexLocations(IndexSelector.java:122) at org.eclipse.jdt.internal.core.search.IndexSelector.getIndexLocations(IndexSelector.java:203) at org.eclipse.jdt.internal.core.search.JavaSearchParticipant.selectIndexes(JavaSearchParticipant.java:112) at org.eclipse.jdt.internal.core.search.PatternSearchJob.getIndexes(PatternSearchJob.java:80) at org.eclipse.jdt.internal.core.search.PatternSearchJob.ensureReadyToRun(PatternSearchJob.java:51) at org.eclipse.jdt.internal.core.search.processing.JobManager.performConcurrentJob(JobManager.java:177) at org.eclipse.jdt.internal.core.search.BasicSearchEngine.searchAllTypeNames(BasicSearchEngine.java:777) at org.eclipse.jdt.core.search.SearchEngine.searchAllTypeNames(SearchEngine.java:780) at org.eclipse.jdt.internal.ui.dialogs.FilteredTypesSelectionDialog.fillContentProvider(FilteredTypesSelectionDialog.java:467) at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog$FilterJob.filterContent(FilteredItemsSelectionDialog.java:2055) at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog$AbstractFilterJob.internalRun(FilteredItemsSelectionDialog.java:1940) at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog$AbstractFilterJob.doRun(FilteredItemsSelectionDialog.java:1901) at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog$AbstractFilterJob.run(FilteredItemsSelectionDialog.java:1881) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)
Unfortunately, strictly following your scenario, I'm not again able to reproduce... :-( Looking at the code, this strongly looks like a multi-thread issue. I'm pretty sure that synchronizing the addEnclosingPorjectOrJar method would solve the problem: private synchronized void addEnclosingProjectOrJar(IPath path) { ... } If you have some times to try this fix, please let me know if my assumption is correct or not. TIA
Darn! I got the NPE by accident and then I could reproduce it a few times. But now, don't get it any more, however hard I try :-(. I'll look at it again if I get the NPE again.
I guess we can close this bug as WORKSFORME now. Please reopen if you get it again, thanks
I got another exception when trying to reproduce the bug with build I20080204-0010. Unfortunately i am unable to reproduce it another time. The exception was: java.lang.ArrayIndexOutOfBoundsException: 45 at org.eclipse.jdt.internal.core.search.JavaSearchScope.addEnclosingProjectOrJar(JavaSearchScope.java:77) at org.eclipse.jdt.internal.core.search.JavaSearchScope.add(JavaSearchScope.java:177) at org.eclipse.jdt.internal.core.search.JavaWorkspaceScope.initialize(JavaWorkspaceScope.java:84) at org.eclipse.jdt.internal.core.search.JavaWorkspaceScope.enclosingProjectsAndJars(JavaWorkspaceScope.java:63) at org.eclipse.jdt.internal.core.search.IndexSelector.initializeIndexLocations(IndexSelector.java:120) at org.eclipse.jdt.internal.core.search.IndexSelector.getIndexLocations(IndexSelector.java:201) at org.eclipse.jdt.internal.core.search.JavaSearchParticipant.selectIndexes(JavaSearchParticipant.java:107) at org.eclipse.jdt.internal.core.search.PatternSearchJob.getIndexes(PatternSearchJob.java:80) at org.eclipse.jdt.internal.core.search.PatternSearchJob.ensureReadyToRun(PatternSearchJob.java:51) at org.eclipse.jdt.internal.core.search.processing.JobManager.performConcurrentJob(JobManager.java:174) at org.eclipse.jdt.internal.core.search.BasicSearchEngine.searchAllTypeNames(BasicSearchEngine.java:784) at org.eclipse.jdt.core.search.SearchEngine.searchAllTypeNames(SearchEngine.java:712) at org.eclipse.jdt.internal.ui.dialogs.FilteredTypesSelectionDialog$ConsistencyRunnable.refreshSearchIndices(FilteredTypesSelectionDialog.java:703) at org.eclipse.jdt.internal.ui.dialogs.FilteredTypesSelectionDialog$ConsistencyRunnable.run(FilteredTypesSelectionDialog.java:689) at org.eclipse.jdt.internal.ui.dialogs.FilteredTypesSelectionDialog.reloadCache(FilteredTypesSelectionDialog.java:729) at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog$RefreshCacheJob.run(FilteredItemsSelectionDialog.java:1476) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55) I reopen the bug.
*** Bug 216939 has been marked as a duplicate of this bug. ***
It seems to be a potential problem from the beginning with the initialization of the JavaWorkspaceScope global variable stored in the JavaModelManager. I cannot see any synchronization which would make it thread safe and I guess that 2 threads trying to get a java workspace scope concurrently on the first place may fall into such problematic situation...
*** Bug 220519 has been marked as a duplicate of this bug. ***
I think this must be fixed for 3.4
Should be fixed by the patch proposed on bug 182738: https://bugs.eclipse.org/bugs/attachment.cgi?id=91131
See new proposed patch on bug 182738: https://bugs.eclipse.org/bugs/attachment.cgi?id=91211
*** Bug 211485 has been marked as a duplicate of this bug. ***
*** Bug 223124 has been marked as a duplicate of this bug. ***
Jerome, I hoped that this one could be fixed with the patch I proposed on bug 182738. Please reassign it to me if you think this assumption was not correct. Thanks
Fix for bug 182738 actually fixed this problem. The enclosingProjectsAndJars() method is now thread safe (it computes the list in a local variable, and it is assigned only at the end of the method). Marking this bug as fixed for 3.4M7
Verified for 3.4 M7 by code inspection of v_856.