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

Bug 399134

Summary: loader constraint violation: when resolving method "org.eclipse.recommenders.utils.rcp.JdtUtils.createUnresolvedType
Product: z_Archived Reporter: George Lindholm <javadev>
Component: RecommendersAssignee: Andreas Sewe <sewe>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: marcel.bruch, steffen.pingel
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Bug Depends on:    
Bug Blocks: 405288    
Attachments:
Description Flags
Eclipse configuration none

Description George Lindholm CLA 2013-01-25 16:20:42 EST
What steps will reproduce the problem?
1. No idea. Was just editing Java source when error appeared
2. 
3. 


-- Error Details --
Date: Fri Jan 25 13:07:16 PST 2013
Message: Unhandled event loop exception
Severity: Error
Product: Eclipse 1.5.1.20121004-1506 (org.eclipse.epp.package.java.product)
Plugin: org.eclipse.ui
Session Data:
eclipse.buildId=M20120914-1800
java.version=1.7.0_11
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Framework arguments:  -product org.eclipse.epp.package.java.product
Command-line arguments:  -os linux -ws gtk -arch x86_64 -product org.eclipse.epp.package.java.product

Exception Stack Trace:
org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.LinkageError: loader constraint violation: when resolving method "org.eclipse.recommenders.utils.rcp.JdtUtils.createUnresolvedType(Lorg/eclipse/jdt/internal/compiler/lookup/TypeBinding;)Lcom/google/common/base/Optional;" the class loader (instance of org/eclipse/osgi/internal/baseadaptor/DefaultClassLoader) of the current class, org/eclipse/recommenders/internal/completion/rcp/BaseRecommendersCompletionContext, and the class loader (instance of org/eclipse/osgi/internal/baseadaptor/DefaultClassLoader) for resolved class, org/eclipse/recommenders/utils/rcp/JdtUtils, have different Class objects for the type (Lorg/eclipse/jdt/internal/compiler/lookup/TypeBinding;)Lcom/google/common/base/Optional; used in the signature)
	at org.eclipse.swt.SWT.error(SWT.java:4361)
	at org.eclipse.swt.SWT.error(SWT.java:4276)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:138)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3537)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3189)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1045)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:940)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:86)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:587)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:542)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	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:353)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1414)
Caused by: java.lang.LinkageError: loader constraint violation: when resolving method "org.eclipse.recommenders.utils.rcp.JdtUtils.createUnresolvedType(Lorg/eclipse/jdt/internal/compiler/lookup/TypeBinding;)Lcom/google/common/base/Optional;" the class loader (instance of org/eclipse/osgi/internal/baseadaptor/DefaultClassLoader) of the current class, org/eclipse/recommenders/internal/completion/rcp/BaseRecommendersCompletionContext, and the class loader (instance of org/eclipse/osgi/internal/baseadaptor/DefaultClassLoader) for resolved class, org/eclipse/recommenders/utils/rcp/JdtUtils, have different Class objects for the type (Lorg/eclipse/jdt/internal/compiler/lookup/TypeBinding;)Lcom/google/common/base/Optional; used in the signature
	at org.eclipse.recommenders.internal.completion.rcp.BaseRecommendersCompletionContext.getReceiverType(BaseRecommendersCompletionContext.java:319)
	at org.eclipse.recommenders.internal.completion.rcp.calls.engine.CallsCompletionProposalComputer.findReceiver(CallsCompletionProposalComputer.java:156)
	at org.eclipse.recommenders.internal.completion.rcp.calls.engine.CallsCompletionProposalComputer.computeCompletionProposals(CallsCompletionProposalComputer.java:121)
	at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333)
	at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:340)
	at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:328)
	at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:284)
	at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1839)
	at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:566)
	at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:563)
	at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:498)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
	at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:492)
	at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:378)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
	... 24 more
Comment 1 George Lindholm CLA 2013-01-25 16:22:04 EST
Created attachment 226137 [details]
Eclipse configuration
Comment 2 Marcel Bruch CLA 2013-01-25 17:38:36 EST
Andreas, we should have a look on this next week and see whether we need a fix for SR2.
Comment 3 Marcel Bruch CLA 2013-01-26 04:04:38 EST
Is this related to bug 385270?

According to the log there are two versions of Guava - which is likely cause the exception. George, can you update to 1.0.3 and see whether the error still exists?

Latest update can be found here:
http://download.eclipse.org/recommenders/updates/train/e42
Comment 4 Andreas Sewe CLA 2013-01-26 05:33:02 EST
As far as I can see, this is a uses-conflict. Both the caller and the callee bundle Require-Bundle;bundle-version="[10.0.0,11.0.0)" but don't declare package com.google.common.base (where the Optional class resides) as part of their public API.

Suggested fix: Use Import-Package for all Guava classes and ensure that com.google.common packages are part of all uses directives. This would touch a large number of manifests, but is IMHO the Right Thing^TM.
Comment 5 Andreas Sewe CLA 2013-01-26 08:30:10 EST
Change set <https://git.eclipse.org/r/9946> is an attempt to fix this. Let's discuss it over there in Gerrit.
Comment 6 George Lindholm CLA 2013-01-28 14:32:22 EST
Hi Marcel,
   I upgraded to 1.0.3 and will see what happens
Comment 7 Marcel Bruch CLA 2013-04-10 01:32:55 EDT
As there was an update an no follow up, I conclude it works.