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

Bug 71630

Summary: [ActivityMgmt] Activity code relies on deprecated core code
Product: [Eclipse Project] Platform Reporter: G. Zsombor <zombi>
Component: RuntimeAssignee: 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 Flags
Patch for org.eclipse.ui.ide
none
patched runtime.jar
none
debug options file
none
The result output.txt file
none
Eclipse log file none

Description G. Zsombor CLA 2004-08-09 05:49:02 EDT
IDE not starts, just the splash screen remains. In fact i can't see any
javaw.exe running.The only error I found in the log is the following :



!SESSION Aug 09, 2004 11:26:43.317 ---------------------------------------------
eclipse.buildId=I200406251208
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 Aug 09, 2004 11:26:43.317
!MESSAGE Unhandled event loop exception

!ENTRY org.eclipse.ui 4 0 Aug 09, 2004 11:26:43.317
!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(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:183)
	at org.eclipse.core.launcher.Main.run(Main.java:644)
	at org.eclipse.core.launcher.Main.main(Main.java:628)


Please help.
Comment 1 Kim Horne CLA 2004-08-09 08:22:22 EDT
Are you running a standard install of eclipse or do you have additional plugins
installed?
Comment 2 Kim Horne CLA 2004-08-09 08:30:04 EDT
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.
Comment 3 Kim Horne CLA 2004-08-09 08:42:05 EDT
Created attachment 13817 [details]
Patch for org.eclipse.ui.ide

This patch changes the call to .getNamespace().  It's one line.
Comment 4 Kim Horne CLA 2004-08-09 08:43:32 EDT
Fix in HEAD.  If we resubmit for the 3.1 M1 build then this will be included.
Comment 5 G. Zsombor CLA 2004-08-09 08:53:24 EDT
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.
Comment 6 Kim Horne CLA 2004-08-09 08:58:35 EDT
Did you happen to delete the org.eclipse.core.runtime.compatibility plugin?
Comment 7 G. Zsombor CLA 2004-08-09 09:22:17 EDT
No, I have that plugin. 
Comment 8 Kim Horne CLA 2004-08-09 09:23:27 EDT
Hrm...I'm going to pass this along for core for comment.  That method shouldn't
return null if that plugin is present.
Comment 9 Rafael Chaves CLA 2004-08-09 15:52:09 EDT
Created attachment 13831 [details]
patched runtime.jar
Comment 10 Rafael Chaves CLA 2004-08-09 15:52:52 EDT
Created attachment 13832 [details]
debug options file
Comment 11 Rafael Chaves CLA 2004-08-09 17:11:19 EDT
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.
Comment 12 G. Zsombor CLA 2004-08-10 05:04:20 EDT
Created attachment 13843 [details]
The result output.txt file
Comment 13 G. Zsombor CLA 2004-08-10 05:05:51 EDT
Created attachment 13844 [details]
Eclipse log file
Comment 14 G. Zsombor CLA 2004-08-10 05:11:25 EDT
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.
Comment 15 Kim Horne CLA 2004-08-10 07:59:28 EDT
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...
Comment 16 G. Zsombor CLA 2004-08-10 08:51:05 EDT
With the clean option it works as expected.
Thanks :-)
Comment 17 Rafael Chaves CLA 2004-08-10 11:13:32 EDT
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.
Comment 18 Kim Horne CLA 2004-08-11 14:27:09 EDT
Assigning back to Rafael - we have Bug 71640 to track the use of deprecated code
at this end.
Comment 19 Rafael Chaves CLA 2004-08-11 22:45:48 EDT
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.
Comment 20 Kim Horne CLA 2004-09-10 09:24:22 EDT
MVM, this seems to be popping up in the 3.0.1 stream.  Should we fix this for RC3?
Comment 21 Michael Van Meekeren CLA 2004-09-10 10:51:49 EDT
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?
Comment 22 Kim Horne CLA 2004-09-10 10:55:13 EDT
I dont believe so, but I should note that the replacement is still earmarked
with an "early access" tag...
Comment 23 Rafael Chaves CLA 2004-09-10 11:03:23 EDT
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.
Comment 24 Nick Edgar CLA 2004-09-10 11:15:06 EDT
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.
Comment 25 Dorian Birsan CLA 2004-09-10 11:15:45 EDT
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)




Comment 26 Rafael Chaves CLA 2004-09-10 11:55:05 EDT
Great, Dorian. Will be investigated.
Comment 27 Rafael Chaves CLA 2004-09-13 11:02:40 EDT
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).
Comment 28 Rafael Chaves CLA 2004-09-13 11:14:44 EDT
The update scenario is a variation of bug 70454.
Comment 29 Rafael Chaves CLA 2004-09-13 12:30:07 EDT
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 ***