This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 418859 - [Contributions] Menu bar not displayed
Summary: [Contributions] Menu bar not displayed
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.4   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 4.4 M4   Edit
Assignee: Daniel Rolka CLA
QA Contact: Daniel Rolka CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-07 14:41 EDT by Matt Schirle CLA
Modified: 2013-12-10 13:15 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Schirle CLA 2013-10-07 14:41:02 EDT
My Eclipse menu bar disappeared today. I started up the IDE this morning and the menu bar just wasn't there. After unsuccessfully trying to figure out how I managed to hide it, I checked the log file and noticed a ClassCastException (see below). 

This is only affecting one of my workspaces. I have a separate workspace that's laid-out almost identically as far as I can tell, and it's not having this problem.

!ENTRY org.eclipse.equinox.event 4 0 2013-10-07 11:17:19.077
!MESSAGE Exception while dispatching event org.osgi.service.event.Event [topic=org/eclipse/e4/ui/model/ui/Context/context/SET] to handler org.eclipse.e4.ui.services.internal.events.UIEventHandler@1fadaf2c
!STACK 0
org.eclipse.e4.core.di.InjectionException: java.lang.ClassCastException: org.eclipse.e4.ui.model.application.ui.menu.impl.OpaqueToolItemImpl cannot be cast to org.eclipse.e4.ui.model.application.ui.menu.MToolBar
	at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:63)
	at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:877)
	at org.eclipse.e4.core.internal.di.InjectorImpl.inject(InjectorImpl.java:119)
	at org.eclipse.e4.core.internal.di.InjectorImpl.inject(InjectorImpl.java:84)
	at org.eclipse.e4.core.contexts.ContextInjectionFactory.inject(ContextInjectionFactory.java:73)
	at org.eclipse.ui.internal.Workbench.createWorkbenchWindow(Workbench.java:1396)
	at org.eclipse.ui.internal.Workbench.openWorkbenchWindow(Workbench.java:2474)
	at org.eclipse.ui.internal.Workbench.getWorkbenchPage(Workbench.java:1894)
	at org.eclipse.ui.internal.Workbench.setReference(Workbench.java:1913)
	at org.eclipse.ui.internal.Workbench.access$25(Workbench.java:1910)
	at org.eclipse.ui.internal.Workbench$35.handleEvent(Workbench.java:1850)
	at org.eclipse.e4.ui.services.internal.events.UIEventHandler$1.run(UIEventHandler.java:41)
	at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:180)
	at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:150)
	at org.eclipse.swt.widgets.Display.syncExec(Display.java:4688)
	at org.eclipse.e4.ui.internal.workbench.swt.E4Application$1.syncExec(E4Application.java:205)
	at org.eclipse.e4.ui.services.internal.events.UIEventHandler.handleEvent(UIEventHandler.java:38)
	at org.eclipse.equinox.internal.event.EventHandlerWrapper.handleEvent(EventHandlerWrapper.java:197)
	at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:197)
	at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:1)
	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
	at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
	at org.eclipse.equinox.internal.event.EventAdminImpl.dispatchEvent(EventAdminImpl.java:135)
	at org.eclipse.equinox.internal.event.EventAdminImpl.sendEvent(EventAdminImpl.java:78)
	at org.eclipse.equinox.internal.event.EventComponent.sendEvent(EventComponent.java:39)
	at org.eclipse.e4.ui.services.internal.events.EventBroker.send(EventBroker.java:80)
	at org.eclipse.e4.ui.internal.workbench.UIEventPublisher.notifyChanged(UIEventPublisher.java:58)
	at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:374)
	at org.eclipse.e4.ui.model.application.ui.basic.impl.PartImpl.setContext(PartImpl.java:399)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:614)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$6.run(PartRenderingEngine.java:526)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:511)
	at org.eclipse.e4.ui.workbench.renderers.swt.ElementReferenceRenderer.createWidget(ElementReferenceRenderer.java:61)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createWidget(PartRenderingEngine.java:949)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:633)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:735)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:706)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:700)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:685)
	at org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer.showTab(StackRenderer.java:1096)
	at org.eclipse.e4.ui.workbench.renderers.swt.LazyStackRenderer.postProcess(LazyStackRenderer.java:97)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:649)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:735)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:706)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:700)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:685)
	at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:61)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:645)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:735)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:706)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:700)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:685)
	at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:61)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:645)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:735)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:706)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:700)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:685)
	at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:61)
	at org.eclipse.e4.ui.workbench.renderers.swt.PerspectiveRenderer.processContents(PerspectiveRenderer.java:59)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:645)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:735)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:706)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:700)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:685)
	at org.eclipse.e4.ui.workbench.renderers.swt.PerspectiveStackRenderer.showTab(PerspectiveStackRenderer.java:103)
	at org.eclipse.e4.ui.workbench.renderers.swt.LazyStackRenderer.postProcess(LazyStackRenderer.java:97)
	at org.eclipse.e4.ui.workbench.renderers.swt.PerspectiveStackRenderer.postProcess(PerspectiveStackRenderer.java:77)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:649)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:735)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:706)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:700)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:685)
	at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:61)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:645)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:735)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:706)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:700)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:685)
	at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:61)
	at org.eclipse.e4.ui.workbench.renderers.swt.WBWRenderer.processContents(WBWRenderer.java:676)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:645)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:735)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:706)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:700)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:685)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1042)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:997)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:138)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:610)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:567)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	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:354)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:181)
	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.equinox.launcher.Main.invokeFramework(Main.java:636)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1426)
Caused by: java.lang.ClassCastException: org.eclipse.e4.ui.model.application.ui.menu.impl.OpaqueToolItemImpl cannot be cast to org.eclipse.e4.ui.model.application.ui.menu.MToolBar
	at org.eclipse.ui.internal.CoolBarToTrimManager.add(CoolBarToTrimManager.java:169)
	at org.eclipse.ui.internal.CoolBarToTrimManager.add(CoolBarToTrimManager.java:115)
	at org.eclipse.ui.internal.ide.WorkbenchActionBuilder.fillCoolBar(WorkbenchActionBuilder.java:409)
	at org.eclipse.ui.application.ActionBarAdvisor.fillActionBars(ActionBarAdvisor.java:154)
	at org.eclipse.ui.internal.ide.WorkbenchActionBuilder.fillActionBars(WorkbenchActionBuilder.java:339)
	at org.eclipse.ui.internal.WorkbenchWindow.fillActionBars(WorkbenchWindow.java:2217)
	at org.eclipse.ui.internal.WorkbenchWindow.setup(WorkbenchWindow.java:593)
	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.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:56)
	... 116 more
Comment 1 Paul Webster CLA 2013-10-07 14:56:23 EDT
Which version of eclipse are you using?  Juno SR2?  Kepler?
Comment 2 Matt Schirle CLA 2013-10-07 15:02:15 EDT
(In reply to Paul Webster from comment #1)
> Which version of eclipse are you using?  Juno SR2?  Kepler?

Kepler
Comment 3 Paul Webster CLA 2013-10-07 15:05:51 EDT
Similar problem as Bug 391957

The add(*) has a MToolBar toolBar = (MToolBar) modelService.find(item.getId(), window); it should probably narrow the search parent *and* check for the return type.

PW
Comment 4 Matt Schirle CLA 2013-10-07 15:51:26 EDT
Any idea how I might be able to work around this besides creating a new workspace? I still have Quick Access, so don't think I'm completely blocked on anything. It's just a bit of an annoyance right now.
Comment 5 Paul Webster CLA 2013-10-07 16:24:08 EDT
First shut down eclipse and make a backup file of <workspace>/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi 


If you're feeling adventurous, you can then edit this file and remove the contents of any trim bars in the MTrimmedWindow (it's XML-ish, so editable in a text editor).

If you're not, simply delete it.

Then restart eclipse, and you'll go back to the default perspective with no specialization

PW
Comment 6 Timo Kinnunen CLA 2013-10-07 16:34:16 EDT
I just had one toolbar item (Editor Presentation) go missing and not come back. I created a copy of the workspace and unzipped a fresh Eclipse copy from eclipse-standard-luna-M2-win32.zip to pinpoint the problem. However, opening the workspace copy with the fresh Eclipse brought the missing item back, though not where it had been. After this the item showed up with the original Eclipse when opening this workspace as well, but the original Eclipse still wouldn't fix the original workspace on its own. Might be a workaround.
Comment 7 Matt Schirle CLA 2013-10-07 18:09:57 EDT
(In reply to Paul Webster from comment #5)
> First shut down eclipse and make a backup file of
> <workspace>/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi 
> 
> 
> If you're feeling adventurous, you can then edit this file and remove the
> contents of any trim bars in the MTrimmedWindow (it's XML-ish, so editable
> in a text editor).
> 
> If you're not, simply delete it.
> 
> Then restart eclipse, and you'll go back to the default perspective with no
> specialization
> 
> PW

Awesome, thank you! Deleted those trim bars and the menus are back now.
Comment 8 Daniel Rolka CLA 2013-11-25 10:58:41 EST
Could you please provide the steps how to reproduce the issue?

thanks,
Daniel
Comment 9 Matt Schirle CLA 2013-11-25 17:23:31 EST
Unfortunately, I don't know what caused it. If I remember correctly, I had rearranged some of the buttons on the toolbar the last time I used that workspace before the problem occurred. I think I moved the diff buttons (ignore whitespace, next difference, previous difference) from the default location (to the right of the perspective buttons) over to the left somewhere. I may have moved some other toolbar buttons or views around as well, but I can't remember.
Comment 10 Matt Schirle CLA 2013-11-25 17:28:16 EST
I don't know if this helps at all, but I frequently use the Team Synchronizing, Debug, and Java perspectives. It's unlikely this problem was caused by any other perspectives, since I almost never touch them. The views I use the most are the Java Editor, Package Exlporer, Search, Type Hierarchy, Progress, Outline, History, Problems, Error Log, Console, JUnit, Debug, Variables, Breakpoints, and Synchronize (CVS). Those might be some good starting places to look.
Comment 11 Daniel Rolka CLA 2013-11-27 09:46:58 EST
Unfortunately I don't manage to replicate the issue. 
I've prepared the patch proposal that in theory solves the issue: https://git.eclipse.org/r/#/c/18971/

However we can also consider closing the bug without changing the code and return to it when it occurs again

Daniel
Comment 13 Daniel Rolka CLA 2013-12-10 13:15:33 EST
verified in the build: I20131209-2000

Daniel