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

Bug 366288

Summary: Packaging issue with com.google.inject 3.0.0.no_aop
Product: [Modeling] TMF Reporter: Marcel Bruch <marcel.bruch>
Component: RelengAssignee: Dennis Huebner <dennis.huebner>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: lerch, sebastian.zarnekow, sven.efftinge
Version: 2.2.0   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description Marcel Bruch CLA 2011-12-10 02:16:02 EST
When using Guice bundled with xtext/xtend 2.2.0 with our plug-ins (Code Recommenders) in the same build, the build crashed with the exception "NoClassDefFoundError: Lcom/google/inject/internal/util/ImmutableList;" (stacktrace given below). Looking at the contents of com.google.inject 3.0.0.no_aop I recognized that all classes in com/google/inject/internal/util/ start with a $ in front of the actual class name ($ImmutableList etc.) whereas the contents of all other packages look normal, i.e., w/o a $ in front.


Dependency graph looks as follows:

xtext's guice 3.0.0.no_aop
code recommenders' guice 3.0.0 (ignored by p2/maven)

code recommenders guice.muiltibindings depends on: guice 3.0.0

I guess that our multibindings module cannot resolve the $ImmutableList from your guice no_aop package. Can we work on a common guice + multibindings + assisted inject package for Juno on Orbit?


>>>

Caused by: java.lang.NoClassDefFoundError: Lcom/google/inject/internal/util/ImmutableList;
	at java.lang.Class.getDeclaredFields0(Native Method)
	at java.lang.Class.privateGetDeclaredFields(Class.java:2291)
	at java.lang.Class.getDeclaredFields(Class.java:1743)
	at com.google.inject.spi.InjectionPoint.getInjectionPoints(InjectionPoint.java:649)
	at com.google.inject.spi.InjectionPoint.forInstanceMethodsAndFields(InjectionPoint.java:356)
	at com.google.inject.spi.InjectionPoint.forInstanceMethodsAndFields(InjectionPoint.java:375)
	at com.google.inject.internal.BindingBuilder.toProvider(BindingBuilder.java:104)
	at com.google.inject.internal.BindingBuilder.toProvider(BindingBuilder.java:41)
	at com.google.inject.multibindings.Multibinder$RealMultibinder.configure(Multibinder.java:269)
	at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:223)
	at com.google.inject.multibindings.Multibinder.newSetBinder(Multibinder.java:115)
	at com.google.inject.multibindings.Multibinder.newSetBinder(Multibinder.java:124)
	at org.eclipse.recommenders.internal.rcp.RecommendersModule.configureArtifactStore(RecommendersModule.java:89)
	at org.eclipse.recommenders.internal.rcp.RecommendersModule.configure(RecommendersModule.java:62)
	at com.google.inject.AbstractModule.configure(AbstractModule.java:59)
	at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:223)
	at com.google.inject.spi.Elements.getElements(Elements.java:101)
	at com.google.inject.internal.InjectorShell$Builder.build(InjectorShell.java:133)
	at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:103)
	at com.google.inject.Guice.createInjector(Guice.java:95)
	at com.google.inject.Guice.createInjector(Guice.java:72)
	at org.eclipse.recommenders.injection.InjectionService.getInjector(InjectionService.java:47)
Comment 1 Sebastian Zarnekow CLA 2011-12-12 09:32:44 EST
Hi Marcel,

the error message indicates an inconsistent installation. During the build process of google.inject, all guava equivalent classes are renamed and packaged as $Lists, $Something instead of Lists and Something. Did you build the multi-bindings jar manually?

The class files http://code.google.com/p/google-guice/downloads/detail?name=guice-3.0.zip&can=2&q= from contain type references like com/google/inject/internal/util/$ImmutableList whereas your stacktrace indicates that ImmutableList was expected
Comment 2 Marcel Bruch CLA 2011-12-12 09:55:52 EST
Ok, I see what caused this and that it's more our issue than yours :) Yes, we actually build several Guice modules on our own using Maven Tycho.

I guess, we should publish all three modules to orbit. Can you do that? I've no orbit access to add new bundles (didn't request it until now but will do so soon to get all our dependencies into Orbit).
Comment 3 Marcel Bruch CLA 2011-12-23 03:05:55 EST
Johannes opened a request for "Guice on Orbit"

https://bugs.eclipse.org/bugs/show_bug.cgi?id=367477
https://bugs.eclipse.org/bugs/show_bug.cgi?id=367478
https://bugs.eclipse.org/bugs/show_bug.cgi?id=367479

Note: To make Guice with all its fragments work properly in Eclipse PDE "Eclipse-ExtensibleAPI: true" has to be added into Guice host bundle's manifest.mf. Otherwise, no bundle that uses any of the extension packages declared in one of these fragments can compile.
Comment 4 Dennis Huebner CLA 2012-03-08 10:54:48 EST
Google inject is now consumed from Orbit I20120306200913. If some problems with  com.google.inject 3.0.0 still persist, please open an orbit bug.
Comment 5 Karsten Thoms CLA 2017-09-19 16:54:13 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 6 Karsten Thoms CLA 2017-09-19 17:05:04 EDT
Closing all bugs that were set to RESOLVED before Neon.0