0

I am deploying my application to Wildfly 9 and I am getting a strange error that resembles class loading problems. The same war file deploys successfully to Tomcat so I am guessing Wildfly is bundling com.google classes and somehow it is interfering with the bundled libraries in the war file.

First, the error looks like this:

Caused by: 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.<init>(Annotations.java:104)
at com.google.inject.internal.Annotations.<clinit>(Annotations.java:122)
at com.google.inject.Key.ensureRetainedAtRuntime(Key.java:362)
at com.google.inject.Key.strategyFor(Key.java:354)
at com.google.inject.Key.get(Key.java:222)
at org.eclipse.sisu.wire.ParameterKeys.<clinit>(ParameterKeys.java:28)
at org.eclipse.sisu.wire.DependencyAnalyzer.<init>(DependencyAnalyzer.java:92)
at org.eclipse.sisu.wire.ElementAnalyzer.<init>(ElementAnalyzer.java:87)
at org.eclipse.sisu.wire.WireModule.configure(WireModule.java:74)
at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:229)
at com.google.inject.spi.Elements.getElements(Elements.java:103)
at com.google.inject.internal.InjectorShell$Builder.build(InjectorShell.java:136)
at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:104)
at com.google.inject.Guice.createInjector(Guice.java:94)
at com.google.inject.Guice.createInjector(Guice.java:71)
at com.google.inject.Guice.createInjector(Guice.java:61)

and I have both guava-16.0.1.jar and sisu-guice-3.1.0-no_aop.jar inside my war file's lib folder.

so I basically need to solve this issue, whether it is a class loading issue or not.

Farzad
  • 1,132
  • 9
  • 21
  • 1
    Wildfly has Guava 18 as a module (have a look at `modules\system\layers\base\com\google\guava\main` in your Wildfly installation) and that method has package private access in that version. So you'd either have to try and upgrade your libs or exclude the module - although I'm not sure which other modules need it so exluding the guava module might be quite a complex task. – Thomas Jan 16 '17 at 15:32
  • I tried excluding it but It seems you can not exclude modules that are in war dependency itself. – Farzad Jan 16 '17 at 15:35
  • Yes the problem might be that the guava module is needed by other modules which in turn are needed by your application. Thus you'd best try to upgrade your libs to use at least guava 18. – Thomas Jan 16 '17 at 15:37

0 Answers0