3

I have a problem to deploy an application on weblogic server, after a discussion here on stackoverflow

i realized that the problem is that weblogic 12c is using a lib file com.google.common_1.0.0.0_0-6.jar , and my application is using Guava-11.0.2.jar, and it sound for me like they are conflicting, tried to search on google but i have no idea what to do, whats the proper solution to solve it?

Community
  • 1
  • 1
Elye M.
  • 2,667
  • 4
  • 30
  • 43
  • 3
    I have no idea what's actually in com.google.common_1.0.0.0_0-6.jar... – Louis Wasserman Nov 14 '12 at 20:18
  • Someone who knows WebLogic will probably have to weigh in here. It may be safe to replace that com.google.common_1.0.0.0_0-6.jar file with a newer Guava jar, but then again it might not. – Daniel Pryden Nov 14 '12 at 20:28
  • 1
    The safest approach when you don't have control of the classpath is to repackage the dependency into an internal package. The maven shade plugin and ant JarJar task can do this, but its a tad slow. – Ben Manes Nov 15 '12 at 03:17
  • try my answer at this [thread](http://stackoverflow.com/a/17976553/2098832) should work as well – Casey Jul 31 '13 at 17:07

3 Answers3

4

I came across the same problem, what I did was, I replaced the com.google.common_1.0.0.0_0-6.jar file from weblogic-home/modules with the latest Guava that's currently guava-13.0.1.jar, but then i saw that weblogic is looking for a file with the name com.google.common.... so I just rename the Guava file to com.google.common_1.0.0.0_0-6.jar, and it worked for me.

Hope it will work for you as well!

meilechh
  • 825
  • 2
  • 8
  • 17
  • Wow!! Thanks! that helped me as well, i"m not working already almost 2 days looking for a solution , – Elye M. Nov 15 '12 at 17:19
  • I would say that this is a workaround. Fixing the problem this way adds one more configuration step to your installation process, which is easy to miss. I would go for classloader configuration in weblogic.xml – Andrew Nov 01 '13 at 13:11
3

It is a well known problem Weblogic. It solution is to use a setting file weblogic.xml, in which it is possible to specify the boot sequence libraries by classloader.

1

The problem is easily resolved without such hacks as the one suggested by @meilechh. You can add prefer-application-packages to your weblogic.xml or weblogic-application.xml.

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

Ric
  • 114
  • 3