Bug 521734 - ClassNotFoundException: org.objectteams.IBoundBase2 cannot be found by com.google.guava
Summary: ClassNotFoundException: org.objectteams.IBoundBase2 cannot be found by com.go...
Status: NEW
Alias: None
Product: Objectteams
Classification: Tools
Component: OTEquinox (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Stephan Herrmann CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2017-09-01 04:30 EDT by Andreas Sewe CLA
Modified: 2017-09-04 07:42 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Sewe CLA 2017-09-01 04:30:19 EDT
Hi,

I am currently triaging the following bug that automated error reporting assigned to Code Recommenders [1], but which seems to be a weird ObjectTeams/Code Recommenders interaction by way of Google Guava:

java.lang.ClassNotFoundException: org.objectteams.IBoundBase2 cannot be found by com.google.guava_15.0.0.v201403281430
    at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:484)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:395)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:387)
    at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:150)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at java.lang.ClassLoader.defineClass1(ClassLoader.java:-2)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
    at org.eclipse.osgi.internal.loader.ModuleClassLoader.defineClass(ModuleClassLoader.java:276)
    at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.defineClass(ClasspathManager.java:655)
    at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findClassImpl(ClasspathManager.java:578)
    at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClassImpl(ClasspathManager.java:538)
    at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:525)
    at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:328)
    at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:368)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:446)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:395)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:387)
    at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:150)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at com.google.common.util.concurrent.AbstractService.failed(AbstractService.java:549)
    at com.google.common.util.concurrent.AbstractService.notifyFailed(AbstractService.java:421)
    at com.google.common.util.concurrent.AbstractService.startAsync(AbstractService.java:188)
    at com.google.common.util.concurrent.AbstractIdleService.startAsync(AbstractIdleService.java:161)
    at org.eclipse.recommenders.coordinates.rcp.EclipseProjectCoordinateAdvisorService.open(EclipseProjectCoordinateAdvisorService.java:158)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethodAccessorImpl.java:-2)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.eclipse.recommenders.internal.rcp.RcpModule$Listener$1.executeMethod(RcpModule.java:292)
    at org.eclipse.recommenders.internal.rcp.RcpModule$Listener$1.afterInjection(RcpModule.java:284)
    at com.google.inject.internal.MembersInjectorImpl.notifyListeners(MembersInjectorImpl.java:97)
    at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:95)
    at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:254)
    at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
    at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1031)
    at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
    at com.google.inject.Scopes$1$1.get(Scopes.java:65)
    at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
    at com.google.inject.internal.FactoryProxy.get(FactoryProxy.java:54)
    at com.google.inject.internal.SingleParameterInjector.inject(SingleParameterInjector.java:38)
    at com.google.inject.internal.SingleParameterInjector.getAll(SingleParameterInjector.java:62)
    at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:84)
    at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:254)
    at com.google.inject.internal.FactoryProxy.get(FactoryProxy.java:54)
    at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
    at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1031)
    at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
    at com.google.inject.Scopes$1$1.get(Scopes.java:65)
    at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
    at com.google.inject.internal.InjectorImpl$4$1.call(InjectorImpl.java:978)
    at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1024)
    at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:974)
    at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.findReceiverTypeAndModel(CallCompletionSessionProcessor.java:133)
    at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.startSession(CallCompletionSessionProcessor.java:108)
    at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireStartSession(IntelligentCompletionProposalComputer.java:305)
    at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:171)
    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:337)
    at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:331)
    at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:288)
    at org.eclipse.jface.text.contentassist.ContentAssistant$3.run(ContentAssistant.java:2007)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:2004)
    at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:560)
    at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$7(CompletionProposalPopup.java:555)
    at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:489)
    at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
    at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:482)
    at org.eclipse.jface.text.contentassist.ContentAssistant$AutoAssistListener$1.run(ContentAssistant.java:377)
    at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:37)
    at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:182)
    at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4497)

Do you have any idea why Guava would even try to load an org.objecteams.* class?

[1] <https://dev.eclipse.org/recommenders/committers/aeri/v2/#!/problems/598337dae4b05728f8e90d98>
Comment 1 Stephan Herrmann CLA 2017-09-01 16:13:37 EDT
(In reply to Andreas Sewe from comment #0)
> Hi,
> 
> I am currently triaging the following bug that automated error reporting
> assigned to Code Recommenders [1], but which seems to be a weird
> ObjectTeams/Code Recommenders interaction by way of Google Guava:
> 
> java.lang.ClassNotFoundException: org.objectteams.IBoundBase2 cannot be
> found by com.google.guava_15.0.0.v201403281430
>     at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:484)
>     at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:395)
>     at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:387)
>     at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:150)
>     at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
>     at java.lang.ClassLoader.defineClass1(ClassLoader.java:-2)
>     at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
>     at org.eclipse.osgi.internal.loader.ModuleClassLoader.defineClass(ModuleClassLoader.java:276)
>     at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.defineClass(ClasspathManager.java:655)
>     at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findClassImpl(ClasspathManager.java:578)
>     at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClassImpl(ClasspathManager.java:538)
>     at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:525)
>     at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:328)
>     at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:368)
>     at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:446)
>     at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:395)
>     at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:387)
>     at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:150)
>     at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
>     at com.google.common.util.concurrent.AbstractService.failed(AbstractService.java:549)
>     at com.google.common.util.concurrent.AbstractService.notifyFailed(AbstractService.java:421)
>     at com.google.common.util.concurrent.AbstractService.startAsync(AbstractService.java:188)
> 
> [...]
>
> Do you have any idea why Guava would even try to load an org.objecteams.*
> class?
> 
> [1]
> <https://dev.eclipse.org/recommenders/committers/aeri/v2/#!/problems/598337dae4b05728f8e90d98>
> 

Hi Andreas, in fact I do have an idea regarding your question :)

Something must have motivated Object Teams to weave additional code into a guava class, which then refers to an Object Teams type.

For users observing this problem, the following declaration in eclipse.ini after -vmargs should work around the problem:

   -Dotequinox.weave.thread=base

(The underlying feature is, that the OT-runtime needs to be notified about creation of new threads, so it weaves callbacks into several places. By the above option this behavior is restricted to only such locations to which an explicit aspect binding is declared).

There still is a bug, since whenever such weaving happens, also the necessary wiring between bundles should be added so that the class can be found.

Unfortunately I don't think I can reconstruct this bug just based on the stacktrace.

Useful extra information would, e.g., be:
- were any errors logged prior to this exception?
- if the problem is reproducible, logs from running with -Dotequinox.debug=OK
And of course
- the installed version of org.eclipse.objectteams.otequinox
Comment 2 Andreas Sewe CLA 2017-09-04 07:42:51 EDT
(In reply to Stephan Herrmann from comment #1)
> Unfortunately I don't think I can reconstruct this bug just based on the
> stacktrace.
> 
> Useful extra information would, e.g., be:
> - were any errors logged prior to this exception?

Overall, this problem was reported in 6 separate incidents [1] by a single unlucky user.

Using the built-in "incidents with same reporter ID in 10 minutes timeframe" search, you get a bit more context [2], including errors reported by OT/Equinox itself.

> - if the problem is reproducible, logs from running with -Dotequinox.debug=OK

I am afraid, I can give you those without help from the reporting user.

> And of course
> - the installed version of org.eclipse.objectteams.otequinox

As org.eclipse.objectteams doesn't show up in the stack trace, the Automated Error Reporting unfortunately doesn't include this information in the report. But I have flagged this problem with the "installed-features" and "installed-bundles" needinfos.

Also, the "incidents with same reporter ID in 10 minutes timeframe" search produced incidents like [3] which do contain ObjectTeams version numbers:

- org.eclipse.objectteams.otdt.ui 2.6.0.201706061122
- org.eclipse.objectteams.otdt - 2.6.0.201706061122
- org.eclipse.objectteams.otredyn - 1.3.0.201706061121

Hope this helps.

[1] <https://dev.eclipse.org/recommenders/committers/aeri/v2/#!/incidents/?c:!((t:problem-id,val:%27598337dae4b05728f8e90d98%27)),sort:!((prop:timestamp,dir:DESCENDING))>
[2] <https://dev.eclipse.org/recommenders/committers/aeri/v2/#!/incidents/?c:!((t:reporter-id,val:%2779b6f1ff-aec5-4398-b30a-003a44c43e82%27),(t:created-on,op:after,val:%272017-08-11T09:50:43%27),(t:created-on,op:before,val:%272017-08-11T10:00:43%27)),sort:!((prop:timestamp,dir:DESCENDING))>
[3] <https://dev.eclipse.org/recommenders/committers/aeri/v2/#!/incidents/598db718e4b07a83ba43d33d>