Community
Participate
Working Groups
Eclipse 3.2 M4 If you try to start a workbench with no Mylar views visible the MylarUuPlugin fails to activate. The activation attempt is coming from the lightweight decorator. This activation attempt is being run in a non UI thread which is causing the creation of the ColorMap instance variable to fail as it requires TaskListImages which creates an image registry which assumes it is being run in a UI thread. The color map is used in initializeHighlighters, so the map can't just be lazily created. I have only noticed this with 3.2, so perhaps it is a JFace regression? Still, the plugin shouldn't make assumptions about the thread it is running on. Moving the creation of the ColorMap into the constructor and wrapping it in a syncExec call does work, but locks up the UI for a good 10-20 seconds. org.osgi.framework.BundleException: The activator org.eclipse.mylar.ui.MylarUiPlugin for bundle org.eclipse.mylar.ui is invalid at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadBundleActivator(AbstractBundle.java:140) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:965) at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:316) at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:255) at org.eclipse.core.runtime.adaptor.EclipseClassLoader.findLocalClass(EclipseClassLoader.java:116) at org.eclipse.osgi.framework.internal.core.BundleLoader.findLocalClass(BundleLoader.java:337) at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:389) at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:350) at org.eclipse.osgi.framework.adaptor.core.AbstractClassLoader.loadClass(AbstractClassLoader.java:78) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at org.eclipse.osgi.framework.internal.core.BundleLoader.loadClass(BundleLoader.java:275) at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:227) at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1235) at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:218) at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:211) at org.eclipse.core.internal.registry.ExtensionRegistry.processExecutableExtension(ExtensionRegistry.java:801) at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:246) at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:53) at org.eclipse.core.internal.registry.eclipse.LegacyConfigurationElementHandle.createExecutableExtension(LegacyConfigurationElementHandle.java:60) at org.eclipse.ui.internal.WorkbenchPlugin$1.run(WorkbenchPlugin.java:243) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:51) at org.eclipse.ui.internal.WorkbenchPlugin.createExtension(WorkbenchPlugin.java:239) at org.eclipse.ui.internal.decorators.LightweightDecoratorDefinition$1.run(LightweightDecoratorDefinition.java:116) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37) at org.eclipse.core.runtime.Platform.run(Platform.java:785) at org.eclipse.ui.internal.decorators.LightweightDecoratorDefinition.internalGetDecorator(LightweightDecoratorDefinition.java:112) at org.eclipse.ui.internal.decorators.LightweightDecoratorDefinition.decorate(LightweightDecoratorDefinition.java:233) at org.eclipse.ui.internal.decorators.LightweightDecoratorManager$LightweightRunnable.run(LightweightDecoratorManager.java:66) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37) at org.eclipse.core.runtime.Platform.run(Platform.java:785) at org.eclipse.ui.internal.decorators.LightweightDecoratorManager.decorate(LightweightDecoratorManager.java:323) at org.eclipse.ui.internal.decorators.LightweightDecoratorManager.getDecorations(LightweightDecoratorManager.java:309) at org.eclipse.ui.internal.decorators.DecorationScheduler$1.run(DecorationScheduler.java:292) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58) Caused by: java.lang.ExceptionInInitializerError at org.eclipse.mylar.ui.internal.ColorMap.<init>(ColorMap.java:25) at org.eclipse.mylar.ui.MylarUiPlugin.<init>(MylarUiPlugin.java:75) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:494) at java.lang.Class.newInstance0(Class.java:350) at java.lang.Class.newInstance(Class.java:303) at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadBundleActivator(AbstractBundle.java:135) ... 33 more Caused by: java.lang.NullPointerException at org.eclipse.jface.resource.JFaceResources.getResources(JFaceResources.java:183) at org.eclipse.jface.resource.ImageRegistry.<init>(ImageRegistry.java:145) at org.eclipse.jface.resource.ImageRegistry.<init>(ImageRegistry.java:117) at org.eclipse.mylar.tasklist.ui.TaskListImages.<clinit>(TaskListImages.java:37) ... 42 more Root exception: java.lang.ExceptionInInitializerError at org.eclipse.mylar.ui.internal.ColorMap.<init>(ColorMap.java:25) at org.eclipse.mylar.ui.MylarUiPlugin.<init>(MylarUiPlugin.java:75) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:494) at java.lang.Class.newInstance0(Class.java:350) at java.lang.Class.newInstance(Class.java:303) at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadBundleActivator(AbstractBundle.java:135) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:965) at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:316) at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:255) at org.eclipse.core.runtime.adaptor.EclipseClassLoader.findLocalClass(EclipseClassLoader.java:116) at org.eclipse.osgi.framework.internal.core.BundleLoader.findLocalClass(BundleLoader.java:337) at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:389) at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:350) at org.eclipse.osgi.framework.adaptor.core.AbstractClassLoader.loadClass(AbstractClassLoader.java:78) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at org.eclipse.osgi.framework.internal.core.BundleLoader.loadClass(BundleLoader.java:275) at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:227) at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1235) at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:218) at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:211) at org.eclipse.core.internal.registry.ExtensionRegistry.processExecutableExtension(ExtensionRegistry.java:801) at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:246) at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:53) at org.eclipse.core.internal.registry.eclipse.LegacyConfigurationElementHandle.createExecutableExtension(LegacyConfigurationElementHandle.java:60) at org.eclipse.ui.internal.WorkbenchPlugin$1.run(WorkbenchPlugin.java:243) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:51) at org.eclipse.ui.internal.WorkbenchPlugin.createExtension(WorkbenchPlugin.java:239) at org.eclipse.ui.internal.decorators.LightweightDecoratorDefinition$1.run(LightweightDecoratorDefinition.java:116) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37) at org.eclipse.core.runtime.Platform.run(Platform.java:785) at org.eclipse.ui.internal.decorators.LightweightDecoratorDefinition.internalGetDecorator(LightweightDecoratorDefinition.java:112) at org.eclipse.ui.internal.decorators.LightweightDecoratorDefinition.decorate(LightweightDecoratorDefinition.java:233) at org.eclipse.ui.internal.decorators.LightweightDecoratorManager$LightweightRunnable.run(LightweightDecoratorManager.java:66) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37) at org.eclipse.core.runtime.Platform.run(Platform.java:785) at org.eclipse.ui.internal.decorators.LightweightDecoratorManager.decorate(LightweightDecoratorManager.java:323) at org.eclipse.ui.internal.decorators.LightweightDecoratorManager.getDecorations(LightweightDecoratorManager.java:309) at org.eclipse.ui.internal.decorators.DecorationScheduler$1.run(DecorationScheduler.java:292) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58) Caused by: java.lang.NullPointerException at org.eclipse.jface.resource.JFaceResources.getResources(JFaceResources.java:183) at org.eclipse.jface.resource.ImageRegistry.<init>(ImageRegistry.java:145) at org.eclipse.jface.resource.ImageRegistry.<init>(ImageRegistry.java:117) at org.eclipse.mylar.tasklist.ui.TaskListImages.<clinit>(TaskListImages.java:37) ... 42 more
Thanks for identifying these problems Brock! I'm plan on putting out a service build tomorrow or Monday morning.
Created attachment 31908 [details] patch to org.eclipse.mylar.tasklist Lazily load the ImageRegistry in TaskListImages. Images should only be requested on the UI thread, so there should be no need to synchronize getImageRegistry. It is also guarantees that Display.getCurrent will return a valid object.
Excellent Brock--very elegant solution for the sort of problem that can be really annoying to track down (startup issues have been a pain in the past). We have 3 image registries (ui, tasklist, and bugzilla) so I introduced this idiom to the other two as well, although they wouldn't have caused a problem because they don't require early startup. When you make any substatial patch of an existing class, could you add yourself to a new @author line with a short description? It's not necessary for minor stuff, but I like to ensure that credit goes where it's due, e.g.: @author Mik Kersten @author Brock Janiczak (lazy loading of image registry)
This was resolved by Brock, so reassigning.
Resolved.
*** Bug 121436 has been marked as a duplicate of this bug. ***
*** Bug 121381 has been marked as a duplicate of this bug. ***