2

I'm programming a web app which uses richfaces 4.3.7 and google guice 4.0.

The problem is that richfaces using guava 18 und google guice using guava 16, this results with the following Exception:

java.lang.RuntimeException: java.lang.IllegalAccessError: tried to access method com.google.common.collect.MapMaker.makeComputingMap(Lcom/google/common/base/Function;)Ljava/util/concurrent/ConcurrentMap; from class org.richfaces.resource.ResourceLibraryFactoryImpl
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.IllegalAccessError: tried to access method com.google.common.collect.MapMaker.makeComputingMap(Lcom/google/common/base/Function;)Ljava/util/concurrent/ConcurrentMap; from class org.richfaces.resource.ResourceLibraryFactoryImpl

Does anyone know a solution? I'm using gradle for dependency management.

Update:

dependencies {
compile 'com.sun.faces:jsf-api:2.2.9'
compile 'com.sun.faces:jsf-impl:2.2.9'
compile 'jstl:jstl:1.2'
compile 'org.hibernate:hibernate-core:4.3.6.Final'
compile 'mysql:mysql-connector-java:5.1.31'
compile 'com.google.inject:guice:4.0'
compile 'org.richfaces.core:richfaces-core-api:4.3.7.Final'
compile 'org.richfaces.core:richfaces-core-impl:4.3.7.Final'
compile 'org.richfaces.ui:richfaces-components-api:4.3.7.Final'
compile 'org.richfaces.ui:richfaces-components-ui:4.3.7.Final'
testCompile group: 'junit', name: 'junit', version: '4.+'
}
user3726033
  • 125
  • 2
  • 10

1 Answers1

2

Try to exclude Guice subdependency, so it will use Richfaces Guava version.

compile 'com.google.inject:guice:4.0' {
  exclude group: 'com.google.guava', module: 'guava'
}
Paszek
  • 156
  • 10
  • This seems not to work. The gradle build fails with following message "No such Property: name for class..". So i replaced name with module. After that the build works but now i got an java.lang.IllegalStateException in org.richfaces.context.ExtendedPartialViewContext.setInstance(ExtendedPartialViewContext.java:55). Maybe anyone has another Idea or what did i wrong? Many thanks in advance. – user3726033 Sep 05 '15 at 19:45
  • This is problem caused by your jsf version: https://issues.jboss.org/browse/RF-13685. You should downgrade jsf mojarra to 2.2.6 or upgrade richfaces to 4.5.x – Paszek Sep 07 '15 at 08:05
  • Awesome, thanks a lot :) (upgraded to richfaces 4.5.x) – user3726033 Sep 07 '15 at 15:13