Bug 566834 - org.eclipse.e4.core.di.InjectionException: java.lang.ClassCastException
Summary: org.eclipse.e4.core.di.InjectionException: java.lang.ClassCastException
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.6   Edit
Hardware: PC Windows 10
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-09-10 02:00 EDT by Soumya SM CLA
Modified: 2020-09-14 07:15 EDT (History)
3 users (show)

See Also:


Attachments
ClassCastException (23.79 KB, application/octet-stream)
2020-09-10 02:00 EDT, Soumya SM CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Soumya SM CLA 2020-09-10 02:00:33 EDT
Created attachment 284099 [details]
ClassCastException

Customer was using RAD 9 before and their HATS(Host Access transformation Service) RCP application worked fine after the export.They have done some customizations in their code and involves few eclipse code and plugins in their project.

They have now migrated to RAD 9.6 and HATS RCP application runs fine inside the HATS toolkit.
Now they are unable to run the project.

After the eclipse product is exported when user tries to run the eclipse.exe file, the application runs in background and RCP screen does not come up.The error comes as soon as PlatformUI.createAndRunWorkbench gets called.
Have attached the log file for more information.

The log file  gives the following error:

org.eclipse.e4.core.di.InjectionException: java.lang.ClassCastException: org.eclipse.e4.ui.model.application.ui.menu.impl.ToolControlImpl cannot be cast to org.eclipse.emf.ecore.EObject
	at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:65)
	at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:966)
	at org.eclipse.e4.core.internal.di.InjectorImpl.inject(InjectorImpl.java:151)
	at org.eclipse.e4.core.internal.di.InjectorImpl.inject(InjectorImpl.java:118)
	at org.eclipse.e4.core.contexts.ContextInjectionFactory.inject(ContextInjectionFactory.java:73)
	at org.eclipse.ui.internal.Workbench.createWorkbenchWindow(Workbench.java:1531)
	at org.eclipse.ui.internal.Workbench.getActiveWorkbenchWindow(Workbench.java:1505)
	at org.eclipse.ui.internal.services.WorkbenchSourceProvider.updateActiveShell(WorkbenchSourceProvider.java:923)
Comment 1 Rolf Theunissen CLA 2020-09-11 09:40:28 EDT
This is strange, ToolControlImpl *does* implement the EObject interface (it extends BasicEObjectImpl which implements EObject).
Will be very hard to analyze this problem without access to the source/environment where the problem occurs. It should be analyzed why the class cannot be cast, probably it is some classpath issue in which the EObject is loaded twice.

Which version of Eclipse are you using?
Comment 2 Soumya SM CLA 2020-09-14 06:43:36 EDT
Thanks for your response.
We are using RAD 9.6.1.4 and the eclipse version is 4.6.3.v20170301-0400.
And the JRE version is 1.8.0_241.