Guava 15.0 jar conflict in WebLogic 12c

你离开我真会死。 提交于 2019-11-29 07:46:07

There's an open issue #1527 targeting this problem (Guava 15 cannot be deployed to any JEE6 container) which occured after fixing this one. Please star and / or comment and wait for the fix (comment #33 suggests that version 15.0.1 could be released in near furture).

EDIT: Meanwhile, the issue was resolved by new maven release:

A note on JEE6 / CDI 1.0

A workaround added in Guava 15.0 to make it compatible with CDI 1.1 (used in JEE7 containers) caused problems for Guava with CDI 1.0 (used in JEE6 containers).

If you're using Guava in a CDI 1.0 environment, you should use guava-15.0-cdi1.0.jar instead of the normal Guava jar. In Maven, the dependency can be specified as:

<dependency>
  <groupId>com.google.guava</groupId>
  <artifactId>guava</artifactId>
  <version>15.0</version>
  <classifier>cdi1.0</classifier>
</dependency>

If you want to deploy on both JEE 6 and 7 servers, you must use Guava 13 or wait until 16 is released.

As an aditional information, I landed on this question with a similar problem while upgrading to Weblogic 12c due to a conflit between WL and Guava (have tried with versions 11 and 18 of Guava).

I found the solution to be to explicitly prefer my application's lib. I set this on my weblogic.xml:

<prefer-application-packages>
  <package-name>com.google.common</package-name>
</prefer-application-packages>

Look at http://docs.oracle.com/middleware/1212/wls/WLPRG/classloading.htm#WLPRG315 for the reference.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!