Community
Participate
Working Groups
I20110429-0945 I am running a large product (originally built against Eclipse 3.6.2) on Eclipse 4.1. I start up the first time ok but subsequent starts give me the attached ClassCastExceptions and DI exceptions. I'll attach the full log. java.lang.ClassCastException: org.eclipse.e4.ui.model.application.ui.basic.impl.PartImpl incompatible with org.eclipse.emf.ecore.EObject at org.eclipse.ui.internal.Workbench.getWindowContext(Workbench.java:1736) at org.eclipse.ui.internal.Workbench.getWorkbenchPage(Workbench.java:1654) at org.eclipse.ui.internal.Workbench.setReference(Workbench.java:1678) at org.eclipse.ui.internal.Workbench.access$19(Workbench.java:1675) at org.eclipse.ui.internal.Workbench$30.handleEvent(Workbench.java:1626) at org.eclipse.e4.ui.services.internal.events.UIEventHandler$1.run(UIEventHandler.java:41) org.eclipse.e4.core.di.InjectionException: Could not find satisfiable constructor in org.eclipse.ui.internal.e4.compatibility.CompatibilityView at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:319) at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:237) at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:153) at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:90) at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:64) at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:53) at org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer.createWidget(ContributedPartRenderer.java:141)
Created attachment 194757 [details] log file This is the log for the 2nd start. It is for an empty (but not new) workspace.
(In reply to comment #0) > I20110429-0945 > > I am running a large product (originally built against Eclipse 3.6.2) on > Eclipse 4.1. I start up the first time ok but subsequent starts give me the > attached ClassCastExceptions and DI exceptions. I'll attach the full log. > > java.lang.ClassCastException: > org.eclipse.e4.ui.model.application.ui.basic.impl.PartImpl incompatible with > org.eclipse.emf.ecore.EObject Hmmm. Doesn't this look like EMF is not using our model, but has fallen back to EObjects when it loaded our model? PW
DJ, in the second startup, can you check that our model plugins are installed and activated? org.eclipse.e4.ui.model.workbench PW
DJ, isn't there a way to trace class loading? The line in question takes an MPart: MElementContainer<?> parent = (MElementContainer<?>) ((EObject) part).eContainer(); But PartImpl definitely has EObject in its part hierarchy. That implies that the EObject used in this method is not the same one that our bundle loaded, right? So maybe we're looking for 2 different loadings of EObject? PW
Created attachment 195085 [details] Classloading trace for org.eclipse.emf.ecore package Paul and I looked at this and there is only 1 version of EMF available and loaded. (the most recent one) I have attached the class loading trace file resulting from the monitoring of all the classes in the org.eclipse.emf.ecore package.
adding Ed, maybe he's an idea what's going on. I remember having seeing this sometimes when i launched an inner and PDE has cached some strange things and it went away by checking "Clear the configuration area before launching".
(In reply to comment #5) > Created attachment 195085 [details] > Classloading trace for org.eclipse.emf.ecore package Thanx for the class loading, DJ. I see 2 different places that say: Loading class: org.eclipse.emf.ecore.EObject The next thing we probably need to see is the resolver? trace. I know there's a way to ask OSGi to print up which bundles is providing which class for each classloading call. I'm just not sure of the debug magic. Tom? PW
Could you try running with the following trace option set: org.eclipse.osgi/debug/loader=true This is a rather verbose trace to use, but it should show entries like this for each class that is read from disk BundleClassLoader[org.eclipse.ui.ide_3.7.0.I20110425-1800].loadClass(org.eclipse.jface.viewers.TextCellEditor) BundleLoader[org.eclipse.ui.ide_3.7.0.I20110425-1800].loadBundleClass(org.eclipse.jface.viewers.TextCellEditor) BundleLoader[org.eclipse.jface_3.7.0.I20110504-0800].findLocalClass(org.eclipse.jface.viewers.TextCellEditor) BundleClassLoader[/develop/install/current/eclipse/plugins/org.eclipse.jface_3.7.0.I20110504-0800.jar].findClass(org.eclipse.jface.viewers.TextCellEditor) about to read 7865 bytes from org/eclipse/jface/viewers/TextCellEditor.class read 7865 bytes from /develop/install/current/eclipse/plugins/org.eclipse.jface_3.7.0.I20110504-0800.jar/org/eclipse/jface/viewers/TextCellEditor.class defining class org.eclipse.jface.viewers.TextCellEditor BundleLoader[org.eclipse.jface_3.7.0.I20110504-0800] found local class org.eclipse.jface.viewers.TextCellEditor Here the trace is indicting that org.eclipse.ui.ide bundle class loader is attempting to load org.eclipse.jface.viewers.TextCellEditor which in turn delegates to org.eclipse.jface which finally finds the class file on the bundle class path of org.eclipse.jface.
This seems to put all debug info into the console. Is there a way to 1) direct it to a log and 2) filter based on class/package?
(In reply to comment #9) > This seems to put all debug info into the console. Is there a way to 1) direct > it to a log and 2) filter based on class/package? From a cmd shell, you can redirect console output to a file (even on windows :-) C:\development> eclipse33\eclipsec.exe -debug debug.options -data workspaces\pw_workspace >debug.log 2>&1 PW
(In reply to comment #9) > This seems to put all debug info into the console. Is there a way to 1) direct > it to a log and 2) filter based on class/package? You would have to do something like Paul suggests, there is no way to filter.
Created attachment 195216 [details] debug output
The only time I've ever seen an exception like this is when two versions of the class are loaded. In that case it was two versions of DOM. I've never seen it happen with EMF because the bundles are singletons so it should be quite hard to load two versions of the core runtime...
(In reply to comment #13) > The only time I've ever seen an exception like this is when two versions of the > class are loaded. In that case it was two versions of DOM. I've never seen it > happen with EMF because the bundles are singletons so it should be quite hard But not impossible for IBM: BundleClassLoader[C:\rad803\plugins\com.ibm.websphere.v7_7.0.101.v20110111_1854\wasJars\org.eclipse.emf.ecore.jar].findClass(org.eclipse.emf.ecore.EObject) about to read 1030 bytes from org/eclipse/emf/ecore/EObject.class read 1030 bytes from C:\rad803\plugins\com.ibm.websphere.v7_7.0.101.v20110111_1854\wasJars\org.eclipse.emf.ecore.jar/org/eclipse/emf/ecore/EObject.class defining class org.eclipse.emf.ecore.EObject PW
Awesome. This appears to be a problem with the adopting product including its own version of Eclipse JARs (including v3.2 of core.runtime and osgi!) and re-exporting all packages. Then later different versions of the same package are getting wired in a way that results in the ClassCastExceptions that we're seeing. This isn't a 4.1 problem. Closing.
I have the same exception in my product file in Kepler.Actually th eproduct file is from an example from EMF Client Platform, and it works file when I first import the examole. But as soon as I rename the plugin it stops working. i have tried setting the cleaning configuration area but that didn't help. Could you please explain how I can figure out a solution for this?