Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If the dependencies are managed up to Guava 18, there is a problem with Guice using a deprecated and no longer public method. #846

Closed
cgoudie opened this issue Sep 13, 2014 · 7 comments

Comments

@cgoudie
Copy link

cgoudie commented Sep 13, 2014

java.lang.IllegalAccessError: tried to access method com.google.common.collect.MapMaker.makeComputingMap(Lcom/google/common/base/Function;)Ljava/util/concurrent/ConcurrentMap; from class com.google.inject.internal.Annotations$AnnotationChecker
at com.google.inject.internal.Annotations$AnnotationChecker.(Annotations.java:104)
at com.google.inject.internal.Annotations.(Annotations.java:122)
at com.google.inject.spi.InjectionPoint.(InjectionPoint.java:94)
at com.google.inject.spi.InjectionPoint$InjectableField.toInjectionPoint(InjectionPoint.java:440)
at com.google.inject.spi.InjectionPoint.getInjectionPoints(InjectionPoint.java:725)
at com.google.inject.spi.InjectionPoint.forInstanceMethodsAndFields(InjectionPoint.java:358)
at com.google.inject.spi.InjectionPoint.forInstanceMethodsAndFields(InjectionPoint.java:377)
at com.google.inject.internal.BindingBuilder.toInstance(BindingBuilder.java:84)

I see that in the released version of the 4.0 beta: https://github.com/google/guice/blob/359c5c3ec4083dea3dd5060ffc4087d73ff98777/core/src/com/google/inject/internal/Annotations.java

On line 73 and 221 makeComputingMap is used. It's been changed to package scope in guava 18 it would appear.

@cgoudie
Copy link
Author

cgoudie commented Sep 13, 2014

It looks like this is fixed by 8743a0b

Any chance you could push a .1 release with this change?

@sameb
Copy link
Member

sameb commented Sep 15, 2014

Are you getting this exception with the 3.0 release of the 4.0 beta release? With 3.0 there should be no issue because we embed Guava internally. With 4.0.. I'll figure out how to cut a new beta.

@davido
Copy link

davido commented Sep 15, 2014

Guava 18 compatible new beta release would be greatly appreciated. Gerrit Code Review project still depends on custom Guice build, because this fix wasn't released yet [1].

[1] 3b02622

@sameb
Copy link
Member

sameb commented Oct 10, 2014

4.0 beta5 pushed with the changes.

@jhaber
Copy link
Contributor

jhaber commented Nov 12, 2014

We are building our own Guice artifact with Guava bundled and relocated the way it was in Guice 3 to avoid issues like this. I'd suggest doing this unless you happen to use Guava 16.0.1 (the version Guice is compiled against). Even if you do use Guava 16.0.1, I'd still recommend doing it in case you upgrade Guava in the future.

@ghost
Copy link

ghost commented Jan 23, 2015

I'm still getting this error in when running 4.0-beta5

@sameb
Copy link
Member

sameb commented Jan 23, 2015

Are you sure you don't have an earlier guice in your classpath somewhere?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants