Guava and Weblogic:ClassNotFoundException

前端 未结 2 595
难免孤独
难免孤独 2020-12-12 02:39

I\'m trying to work on a web application that deploys to Weblogic 10.3.5. One of the maven dependencies is Guava.

Unfortunately, upon attempting to publish the proje

2条回答
  •  情歌与酒
    2020-12-12 03:07

    • Yes it's classloader issue (application vs. WebLogic classloading)
    • guava libraries and com.google.common contains same classes
    • WebLogic has com.google.common_1.0.0.0_0-6.jar or com.google.common_1.1.0.0_0-6.jar in it's classpath, in modules directory. (depending on WebLogic version, but the jar content is same, only META-INF\MANIFEST.MF is different)
    • You cannot find this library in WebLogic Classloader Analysis Tool (CAT). I'm not sure why is that....
    • Why not using WebLogic built in feature with help of FilteringClassLoaders - prefer-application-packages ?

    you need to add something like this to your weblogic.xml or weblogic-application.xml if you are in EAR application

    
        
                com.google.common.*
        
    
    

    Then redeploy the application.

    It works for us.

    • pros: no need to replace & rename magic with com.google.common*.jar files... that's a way to suicide...

    Hope it helps.

    For more info, see the link:
    https://www.rational-pi.be/2013/03/guava-and-weblogic12c/

提交回复
热议问题