| Summary: | [ActivityMgmt] Activity code relies on deprecated core code | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | G. Zsombor <zombi> | ||||||||||||
| Component: | Runtime | Assignee: | Rafael Chaves <eclipse> | ||||||||||||
| Status: | RESOLVED DUPLICATE | QA Contact: | |||||||||||||
| Severity: | blocker | ||||||||||||||
| Priority: | P3 | CC: | birsan, dejan, eclipse, Kevin_Haaland, michaelvanmeekeren, n.a.edgar | ||||||||||||
| Version: | 3.0 | ||||||||||||||
| Target Milestone: | --- | ||||||||||||||
| Hardware: | PC | ||||||||||||||
| OS: | Windows XP | ||||||||||||||
| Whiteboard: | |||||||||||||||
| Attachments: |
|
||||||||||||||
|
Description
G. Zsombor
Are you running a standard install of eclipse or do you have additional plugins installed? The problem is that the activity code is using deprecated code in core. (IExtension.getDeclaringPluginDescriptor()). If the compatability plugin is not loaded this returns null. We should not be using this code. Mvm, I think this is definitly a 3.0.1 candidate. Created attachment 13817 [details]
Patch for org.eclipse.ui.ide
This patch changes the call to .getNamespace(). It's one line.
Fix in HEAD. If we resubmit for the 3.1 M1 build then this will be included. No, I use some external plugins also. For example, VE, JFaceDBC, Lomboz, Weblogic, JBoss IDE, the strange thing that this error is only occur from today, and I don't remember that what I've done with the plugins more than one weak ago. Did you happen to delete the org.eclipse.core.runtime.compatibility plugin? No, I have that plugin. Hrm...I'm going to pass this along for core for comment. That method shouldn't return null if that plugin is present. Created attachment 13831 [details]
patched runtime.jar
Created attachment 13832 [details]
debug options file
Zsombor, please replace the JAR for the runtime plug-in with the attached runtime.jar (do not replace, first rename the original one to something else). Then, put the runtime.options file in the Eclipse install dir. Finally, run Eclipse from the command-line: cd <eclipse install dir> eclipse.exe [<any args you use to pass to Eclipse>] -consolelog -debug runtime.options [-vmargs <args you pass to the VM, if any>] > output.txt This would not prevent the crash, but may be helpful to show what the problem is. Please attach the resulting file (output.txt) to this PR. After you got the output in a file, a workaround should be running with -clean. Created attachment 13843 [details]
The result output.txt file
Created attachment 13844 [details]
Eclipse log file
I'm not sure, that this patched runtime makes any differences, but i followed your adviced and put that runtime.jar to plugins\org.eclipse.core.runtime_3.0.0. Anyway I installed eclipse to a separate directory so I can work again, for me now this error is not so critical, if you have any further patches i will happily test it. Can you try running the broken workspace with the -clean option as Rafael suggested? If that fixes it we can chalk this up to a busted configuration directory... With the clean option it works as expected. Thanks :-) My bad... if one needs to get the console output into a file, the Eclipse native launcher (eclipse.exe) cannot be used. But know it is too late, since your configuration area has been cleaned. D'oh! Kim, do you want to keep this PR for you? Otherwise, I can unassign it from you and change the summary line to better reflect the problem. Assigning back to Rafael - we have Bug 71640 to track the use of deprecated code at this end. We don't have any clues to look at. I will have to close this one. If it happens again, please try to obtain the information requested according to comment 11 and comment 17. Thanks. MVM, this seems to be popping up in the 3.0.1 stream. Should we fix this for RC3? Could the PMC consider this one for 3.0.1 RC3 please? It is a one line change from a deprecated to new API, Kim anything possibly different in the two API calls? I dont believe so, but I should note that the replacement is still earmarked with an "early access" tag... Just wanted to make clear that this is a bug in Core, not in UI code. You sure can avoid it by using the non-deprecated API. But how far could we go when Plugin.getPluginDescriptor returns null? You say this is happening often... we would love to see a reproducible case, or a install/workspace that seems to cause it systematically. Once we have that, the actual problem can be investigated and hopefully fixed. I have to agree with Rafael: we need to understand the underlying core problem. The IDE should be able to assume that the compatibility methods are there, and it makes this assumption in more places than in the activity manager. It would be a different issue if the generic workbench had the call to getPluginDescriptor(), since we want to allow RCP apps to run without o.e.core.runtime.compatibility. Here is a reproducible case: - Start a fresh 3.0.1 eclipse SDK - Add an update site http://update.eclipse.org/testUpdates using Help > Software Updates>Find and Install > search for new features - expand the site and select the last category (which is the 3.0.1.yesterday's date) - click next and wait until the features are found. Select the eclipse SDK to install and follow the wizard to the end, click finish and, after the download (which takes 5-6 minutes here) restart when prompted. The restart does not happen and the log is included below: !SESSION Sep 09, 2004 17:03:37.657 -------------------------------------------- - eclipse.buildId=M200409081421 java.version=1.4.2_03 java.vendor=Sun Microsystems Inc. BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US !ENTRY org.eclipse.ui 4 4 Sep 09, 2004 17:03:37.657 !MESSAGE Unhandled event loop exception !ENTRY org.eclipse.ui 4 0 Sep 09, 2004 17:03:37.667 !MESSAGE java.lang.NullPointerException !STACK 0 java.lang.NullPointerException at org.eclipse.ui.internal.ide.IDEWorkbenchActivityHelper.loadNatures (IDEWorkbenchActivityHelper.java:110) at org.eclipse.ui.internal.ide.IDEWorkbenchActivityHelper.<init> (IDEWorkbenchActivityHelper.java:85) at org.eclipse.ui.internal.ide.IDEWorkbenchActivityHelper.getInstance (IDEWorkbenchActivityHelper.java:68) at org.eclipse.ui.internal.ide.IDEWorkbenchAdvisor.initialize (IDEWorkbenchAdvisor.java:173) at org.eclipse.ui.application.WorkbenchAdvisor.internalBasicInitialize (WorkbenchAdvisor.java:165) at org.eclipse.ui.internal.Workbench.init(Workbench.java:789) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1325) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:254) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:141) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:96) at org.eclipse.core.internal.runtime.PlatformActivator$1.run (PlatformActivator.java:335) at org.eclipse.core.runtime.adaptor.EclipseStarter.run (EclipseStarter.java:273) at org.eclipse.core.runtime.adaptor.EclipseStarter.run (EclipseStarter.java:129) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.core.launcher.Main.basicRun(Main.java:185) at org.eclipse.core.launcher.Main.run(Main.java:704) at org.eclipse.core.launcher.Main.main(Main.java:688) !ENTRY org.eclipse.osgi Sep 09, 2004 17:03:37.687 !MESSAGE Error while stopping "org.eclipse.ui.ide_3.0.1.v200409080800". !STACK 0 org.osgi.framework.BundleException: Exception in org.eclipse.core.internal.compatibility.PluginActivator.stop() of bundle org.eclipse.ui.ide. at org.eclipse.osgi.framework.internal.core.BundleContextImpl.stop (BundleContextImpl.java:1010) at org.eclipse.osgi.framework.internal.core.BundleHost.stopWorker (BundleHost.java:502) at org.eclipse.osgi.framework.internal.core.AbstractBundle.stop (AbstractBundle.java:437) at org.eclipse.core.runtime.adaptor.BundleStopper.basicStopBundles (BundleStopper.java:73) at org.eclipse.core.runtime.adaptor.BundleStopper.stopBundles (BundleStopper.java:62) at org.eclipse.core.runtime.adaptor.EclipseAdaptor.frameworkStopping (EclipseAdaptor.java:551) at org.eclipse.osgi.framework.internal.core.Framework.shutdown (Framework.java:457) at org.eclipse.osgi.framework.internal.core.SystemBundle$1.run (SystemBundle.java:182) at java.lang.Thread.run(Unknown Source) Caused by: java.lang.NullPointerException at org.eclipse.core.runtime.Plugin.shutdown(Plugin.java:523) at org.eclipse.ui.plugin.AbstractUIPlugin.shutdown(AbstractUIPlugin.java:893) at org.eclipse.core.internal.compatibility.PluginActivator.stop (PluginActivator.java:74) at org.eclipse.osgi.framework.internal.core.BundleContextImpl$2.run (BundleContextImpl.java:994) at java.security.AccessController.doPrivileged(Native Method) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.stop (BundleContextImpl.java:990) ... 8 more Root exception: java.lang.NullPointerException at org.eclipse.core.runtime.Plugin.shutdown(Plugin.java:523) at org.eclipse.ui.plugin.AbstractUIPlugin.shutdown(AbstractUIPlugin.java:893) at org.eclipse.core.internal.compatibility.PluginActivator.stop (PluginActivator.java:74) at org.eclipse.osgi.framework.internal.core.BundleContextImpl$2.run (BundleContextImpl.java:994) at java.security.AccessController.doPrivileged(Native Method) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.stop (BundleContextImpl.java:990) at org.eclipse.osgi.framework.internal.core.BundleHost.stopWorker (BundleHost.java:502) at org.eclipse.osgi.framework.internal.core.AbstractBundle.stop (AbstractBundle.java:437) at org.eclipse.core.runtime.adaptor.BundleStopper.basicStopBundles (BundleStopper.java:73) at org.eclipse.core.runtime.adaptor.BundleStopper.stopBundles (BundleStopper.java:62) at org.eclipse.core.runtime.adaptor.EclipseAdaptor.frameworkStopping (EclipseAdaptor.java:551) at org.eclipse.osgi.framework.internal.core.Framework.shutdown (Framework.java:457) at org.eclipse.osgi.framework.internal.core.SystemBundle$1.run (SystemBundle.java:182) at java.lang.Thread.run(Unknown Source) !ENTRY org.eclipse.osgi Sep 09, 2004 17:03:37.697 !MESSAGE Error while stopping "org.eclipse.core.resources_3.0.1.r30x- v20040908". !STACK 0 org.osgi.framework.BundleException: Exception in org.eclipse.core.internal.compatibility.PluginActivator.stop() of bundle org.eclipse.core.resources. at org.eclipse.osgi.framework.internal.core.BundleContextImpl.stop (BundleContextImpl.java:1010) at org.eclipse.osgi.framework.internal.core.BundleHost.stopWorker (BundleHost.java:502) at org.eclipse.osgi.framework.internal.core.AbstractBundle.stop (AbstractBundle.java:437) at org.eclipse.core.runtime.adaptor.BundleStopper.basicStopBundles (BundleStopper.java:73) at org.eclipse.core.runtime.adaptor.BundleStopper.stopBundles (BundleStopper.java:62) at org.eclipse.core.runtime.adaptor.EclipseAdaptor.frameworkStopping (EclipseAdaptor.java:551) at org.eclipse.osgi.framework.internal.core.Framework.shutdown (Framework.java:457) at org.eclipse.osgi.framework.internal.core.SystemBundle$1.run (SystemBundle.java:182) at java.lang.Thread.run(Unknown Source) Caused by: java.lang.NullPointerException at org.eclipse.core.internal.compatibility.PluginActivator.stop (PluginActivator.java:76) at org.eclipse.osgi.framework.internal.core.BundleContextImpl$2.run (BundleContextImpl.java:994) at java.security.AccessController.doPrivileged(Native Method) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.stop (BundleContextImpl.java:990) ... 8 more Root exception: java.lang.NullPointerException at org.eclipse.core.internal.compatibility.PluginActivator.stop (PluginActivator.java:76) at org.eclipse.osgi.framework.internal.core.BundleContextImpl$2.run (BundleContextImpl.java:994) at java.security.AccessController.doPrivileged(Native Method) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.stop (BundleContextImpl.java:990) at org.eclipse.osgi.framework.internal.core.BundleHost.stopWorker (BundleHost.java:502) at org.eclipse.osgi.framework.internal.core.AbstractBundle.stop (AbstractBundle.java:437) at org.eclipse.core.runtime.adaptor.BundleStopper.basicStopBundles (BundleStopper.java:73) at org.eclipse.core.runtime.adaptor.BundleStopper.stopBundles (BundleStopper.java:62) at org.eclipse.core.runtime.adaptor.EclipseAdaptor.frameworkStopping (EclipseAdaptor.java:551) at org.eclipse.osgi.framework.internal.core.Framework.shutdown (Framework.java:457) at org.eclipse.osgi.framework.internal.core.SystemBundle$1.run (SystemBundle.java:182) at java.lang.Thread.run(Unknown Source) Great, Dorian. Will be investigated. The problem in this scenario is caused by runtime loading the compatibility support too eagerly (Plugin.initializeDescriptor is called from PlatformActivator.start). In the second run (after Eclipse was updated), runtime tries to initialize the compatibility support, and ends up finding the old compatibility. Only after runtime is started, the Update configurator will have a chance to ensure the configuration built by the update manager is made effective. The outcome: after an update, Eclipse will have to be started twice (the first startup will always fail). The update scenario is a variation of bug 70454. Marking as duplicate. It only happens if one updates org.eclipse.core.runtime.compatibility. This should not be common since this plug-in is still the same as shipped in 3.0. The workaround is to start Eclipse again. *** This bug has been marked as a duplicate of 70454 *** |