Community
Participate
Working Groups
Build ID: I20090605-1444 Steps To Reproduce: 1. Create project, save and exit (some files have read only attribute setted). 2. When open project, panels don't load appropiately, with error Unable to create view ID org.eclipse.jdt.ui.MembersView: Plug-in org.eclipse.jdt.ui was unable to load class org.eclipse.jdt.internal.ui.browsing.MembersView. 3. Try start with -clean fail again More information: eclipse.buildId=I20090605-1444 java.version=1.6.0_14 java.vendor=Sun Microsystems Inc. BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=es_CL Command-line arguments: -os win32 -ws win32 -arch x86 Error Wed Jun 17 15:52:28 CLT 2009 Unable to create view ID org.eclipse.jdt.ui.MembersView: Plug-in org.eclipse.jdt.ui was unable to load class org.eclipse.jdt.internal.ui.browsing.MembersView. org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter$TerminatingClassNotFoundException: An error occurred while automatically activating bundle org.eclipse.jdt.ui (118). at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:125) at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:449) at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:211) at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:376) at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:452) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:405) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:393) at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:105) at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at org.eclipse.osgi.internal.loader.BundleLoader.loadClass(BundleLoader.java:321) at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:231) at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1193) at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:160) at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:874) at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243) at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:51) at org.eclipse.ui.internal.WorkbenchPlugin$1.run(WorkbenchPlugin.java:267) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) at org.eclipse.ui.internal.WorkbenchPlugin.createExtension(WorkbenchPlugin.java:263) at org.eclipse.ui.internal.registry.EditorDescriptor.createEditor(EditorDescriptor.java:235) at org.eclipse.ui.internal.EditorManager.createPart(EditorManager.java:845) at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:606) at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:462) at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:595) at org.eclipse.ui.internal.EditorAreaHelper.setVisibleEditor(EditorAreaHelper.java:271) at org.eclipse.ui.internal.EditorManager.setVisibleEditor(EditorManager.java:1417) at org.eclipse.ui.internal.EditorManager$5.runWithException(EditorManager.java:942) at org.eclipse.ui.internal.StartupThreading$StartupRunnable.run(StartupThreading.java:31) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3855) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3476) at org.eclipse.ui.application.WorkbenchAdvisor.openWindows(WorkbenchAdvisor.java:803) at org.eclipse.ui.internal.Workbench$28.runWithException(Workbench.java:1384) at org.eclipse.ui.internal.StartupThreading$StartupRunnable.run(StartupThreading.java:31) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3855) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3476) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2316) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2221) at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:493) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:368) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) 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:597) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514) at org.eclipse.equinox.launcher.Main.run(Main.java:1311) at org.eclipse.equinox.launcher.Main.main(Main.java:1287) Caused by: org.osgi.framework.BundleException: The activator org.eclipse.jdt.internal.ui.JavaPlugin for bundle org.eclipse.jdt.ui is invalid at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadBundleActivator(AbstractBundle.java:157) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:750) at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:352) at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:280) at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:408) at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:111) ... 58 more Caused by: java.lang.NoClassDefFoundError: org/eclipse/jdt/core/WorkingCopyOwner at java.lang.Class.getDeclaredConstructors0(Native Method) at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389) at java.lang.Class.getConstructor0(Class.java:2699) at java.lang.Class.newInstance0(Class.java:326) at java.lang.Class.newInstance(Class.java:308) at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadBundleActivator(AbstractBundle.java:152) ... 63 more Caused by: org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter$TerminatingClassNotFoundException: An error occurred while automatically activating bundle org.eclipse.jdt.core (108). at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:125) at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:449) at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:211) at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:376) at org.eclipse.osgi.internal.loader.SingleSourcePackage.loadClass(SingleSourcePackage.java:33) at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:449) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:405) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:393) at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:105) at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) ... 69 more Caused by: org.osgi.framework.BundleException: Exception in org.eclipse.jdt.core.JavaCore.start() of bundle org.eclipse.jdt.core. at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:805) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:754) at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:352) at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:280) at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:408) at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:111) ... 79 more Caused by: java.lang.NullPointerException at org.eclipse.jdt.internal.core.JavaModelManager.containersReset(JavaModelManager.java:748) at org.eclipse.jdt.internal.core.JavaModelManager.loadVariablesAndContainers(JavaModelManager.java:3001) at org.eclipse.jdt.internal.core.JavaModelManager.startup(JavaModelManager.java:4589) at org.eclipse.jdt.core.JavaCore.start(JavaCore.java:4965) at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:782) at java.security.AccessController.doPrivileged(Native Method) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:773) ... 84 more
I suspect an install issue/incompatibility. Cannot reproduce using 3.5 RC4. Please reopen with more detailed steps if you can still reproduce using a build from http://download.eclipse.org/eclipse/downloads/drops/S-3.5RC4-200906051444/index.php
This boils down to an NPE in JavaModelManager.containersReset(..), see the very end of the stack trace. This prevents the jdt.core plug-in (and thus also jdt.ui) from being activated: Caused by: java.lang.NullPointerException at org.eclipse.jdt.internal.core.JavaModelManager.containersReset(JavaModelManager.java:748) at org.eclipse.jdt.internal.core.JavaModelManager.loadVariablesAndContainers(JavaModelManager.java:3001) at org.eclipse.jdt.internal.core.JavaModelManager.startup(JavaModelManager.java:4589) at org.eclipse.jdt.core.JavaCore.start(JavaCore.java:4965)
Moving to JDT/Core. Krimarck, could you please attach the affected project here if it's not too big or secret? Or at least the .classpath file in the project? We need to know what's on the build path of that project.
*** Bug 277305 has been marked as a duplicate of this bug. ***
It looks like Eclipse sometimes reaches an inconsistent state in the classloading process. In my case, adding the mysql-connector jar file to a project caused the problem, although it only complained after restarting Eclipse. It did not matter whether the file was added as an "External JAR" or as a "Connectivity driver definition", the result was the same. The workaround is to make a full reinstall, but in order to fix the underlying cause it would help if Eclipse had a more benign reaction to the issue.
Jay, Please investigate.
Created attachment 139547 [details] project .classpath attach solicited file.
Created attachment 139550 [details] Screenshot If is useful
Created attachment 139551 [details] log in metadata folder That is in .metadata folder. i tried atach metadata, but fails because is too big.
I suspect the null containerPath that is getting passed from DriverClasspathContainerPage#update is causing the NPE. --- try { oldContainer = JavaCore.getClasspathContainer(container.getPath(), fProject); } catch (JavaModelException e) { // ignore oldContainer = null; } IClasspathEntry entry = null; if (oldContainer != null) { try { JavaCore.setClasspathContainer(null, new IJavaProject[]{fProject}, new IClasspathContainer[] {oldContainer}, null); } catch (JavaModelException e) { --- Here, JavaCore#getClassContainer is invoked with a non-null path and JavaCore#setClasspathContainer is invoked with a null path. This results in two entries for the same container. Even when the library is removed from the project, the null-keyed container remains and causes a NPE later. I am moving the bug to Data Tools. Can someone from Data Tools confirm the above, please? Krimarck, I don't see the same problem with an external JAR file. I guess this could be because of the existing driver library. As a workaround, you can delete the .metadata/.plugins/org.eclipse.jdt.core/variablesAndContainers.dat (after taking backup) and try using an external jar file. Of course, this at the risk of loosing your previous variables and library definitions. This will be quicker and easier than a new install.
Interesting. I found little (read: no) documentation on how to expose something along these lines, but I'm not shocked that a bug is appearing now. I can certainly look into fixing this for 1.7.1, but we're too late in the Galileo cycle to really take care of it.
(In reply to comment #10) > I suspect the null containerPath that is getting passed from > DriverClasspathContainerPage#update is causing the NPE. Do you have any suggestions on how to fix this? The lack of documentation made getting this far like fumbling around in the dark with a match for light...
>The lack of documentation made >getting this far like fumbling around in the dark with a match for light... To what part/API do you refer exactly? org.eclipse.jdt.core.JavaCore.setClasspathContainer(IPath, IJavaProject[], IClasspathContainer[], IProgressMonitor) is very clear about not allowing 'null' hence passing it in is definitely illegal no matter how unclear the API would be in other parts.
Hey Dani... So if you look at the snippet in comment #10, what's the better way to do this so we don't break the legal inputs for the setClasspathContainer call? --Fitz
>So if you look at the snippet in comment #10, what's the better way to do this I'm not quite sure what you want to do with that code.
Basically all I'm trying to update the classpath container with an updated jar reference. For example, the user uses a Driver Definition (basically a collection of one or more jar paths for the jars of a JDBC driver) to do some development work in a Java project. He adds a "Driver Jar Classpath" container, which references one of the DTP driver definitions. We add the jars of the driver definition to the project classpath. Later on, the user updates the paths of the referenced driver definition (possibly to point to a different/newer version of the driver) or changes to a different driver definition. We need to 1) remove the old driver jars from the classpath and 2) add the new ones back in. So the code basically looks for an old driver classpath container. If it finds one, I want to remove the old classpath container. So I'm trying to see if the project HAS an old container - if it does, I want to set it to remove it, clear it, set it to null, or something... and add a new one back in... The comment is indicating that somehow we're not removing the old classpath container I think... Here's the full method... private void update(DriverInstance di) { if (di != null) { IClasspathContainer container = new DriverClasspathContainer(di.getName()); IClasspathContainer oldContainer; try { oldContainer = JavaCore.getClasspathContainer(container.getPath(), fProject); } catch (JavaModelException e) { // ignore oldContainer = null; } IClasspathEntry entry = null; if (oldContainer != null) { try { JavaCore.setClasspathContainer(null, new IJavaProject[]{fProject}, new IClasspathContainer[] {oldContainer}, null); } catch (JavaModelException e) { e.printStackTrace(); } entry = JavaCore.newContainerEntry(container.getPath()); } else { entry = JavaCore.newContainerEntry(container.getPath()); } fEditResult = entry; } else { fEditResult = null; }
I think you only need to set the new actual container. This should do the trick, assuming DriverClasspathContainer is that container: private void update(DriverInstance di) { if (di != null) { IClasspathContainer container= new DriverClasspathContainer(di.getName()); JavaCore.setClasspathContainer(container.getPath(), new IJavaProject[]{fProject}, container, null); Note that you cannot remove/unregister a container but just replace it. Also, JavaCore.newContainerEntry(...) will only give you a placeholder for the project which points to the actual container. I don't think you need to recreate them for your use case.
Thanks for the suggestion... The only problem with your JavaCore.setClasspathContainer call is that the 3rd argument is an array... public static void setClasspathContainer(IPath containerPath, IJavaProject[] affectedProjects, IClasspathContainer[] respectiveContainers, IProgressMonitor monitor) throws JavaModelException Should it simply be "new IClassPathContainer[] {container}"?
>Should it simply be "new IClassPathContainer[] {container}"? Yes, of course.
Created attachment 145859 [details] Possible patch This should fix it based on Dani's suggestions. Cristian, can you take a look to see if it fixes the issues you were seeing?
Created attachment 145860 [details] mylyn/context/zip
unless we hear something in the next day or so, I'm going to bump this to 1.7.2
Is there a nightly snapshot build I can test? Thanks.
I haven't checked it in. I just have the patch. I'd rather not check it in until it's tested. Sounds like that may be a catch-22?
>sounds like that may be a catch-22? Brian, you could export the plug-in and attach it here for testing. In order to make it work you must use the exact same bundle version and JAR name as the one that Christian currently uses in his install.
Ok. Let's give that a shot. Christian... In your installation, what is the jar name for the org.eclipse.datatools.enablement.jdt.classpath? I'm guessing it's "org.eclipse.datatools.enablement.jdt.classpath_1.0.1.v200906020900.jar" I'm going to attach a gzip with the jar in it.
Created attachment 146417 [details] Zipped jar to test with Try this jar to see if it fixes the issue.
Since I haven't heard anything else, this is a bit late to get into the 1.7.1 stream for us. We'll push it off to 1.7.2 and get it in early in the release.
Setting to 1.7.2
*** Bug 289503 has been marked as a duplicate of this bug. ***
I'd still like to have someone test this before I check it in... Any takers?
I am having a similar issue that I have described in Bug 289639. I tried using the provided jar file to test and my issue was still present.
Ugh. Dani, any other suggestions we can try here?
Read through this bug and the bug I submitted to understand the root problem a little more. Realized what was being fixed with the jar file and noticed that my test of the jar was only once the problem existed. My testing was that once the problem showed itself to go and change the jar out and try to load up Eclipse. This would still show the error as there is something with the classpath definition. I just ran another test with the new jar from a functioning version of my workspace and can not reproduce the problem so it looks like the jar does fix the issue.
Whew. :) Thanks for testing Shawn. I'll try and get this fix delivered this week so it'll show up in early 1.7.2 builds of DTP and we can verify once again that things are fixed and working correctly.
Delivered fix to o.e.d.e.jdt.classpath as tag v200909240342 Was accidentally delivered under bug 278285, so my apologies. That will remain open and this one will be closed.
Any chance we could get a new jar file compiled against the SR1 of Galileo as it looks like this issue didn't make it into SR1? Thanks
It didn't make it into SR1, but should appear in any SR2 build (our DTP 1.7.2 builds).
*** Bug 294185 has been marked as a duplicate of this bug. ***