Weblogic 10.3.1.0 is using com.bea.core.apache.commons.net_1.0.0.0_1-4-1.jar… I want to use commons-net-2.0.jar from my code

后端 未结 2 1714
南笙
南笙 2020-12-03 12:15

Weblogic 10.3.1.0 is using com.bea.core.apache.commons.net_1.0.0.0_1-4-1.jar... I want to use commons-net-2.0.jar from my code.

How can I force it to use the newer

2条回答
  •  抹茶落季
    2020-12-03 12:46

    I want to use commons-net-2.0.jar from my code.

    WebLogic uses a parent class loader first strategy and you basically have two options to tweak this behavior:

    • Use the prefer-web-inf-classes element in a weblogic.xml Web application deployment descriptor (that goes in WEB-INF next to the web.xml) ~or~
    • Package your war insider an EAR and use WebLogic Filtering classloader that you configure in a weblogic-application.xml descriptor (that goes in META-INF next to the application.xml)

    Here is an example weblogic.xml:

    
    
        
            true
         
    
    

    Here is an example weblogic-application.xml:

    
    
        
            webapp.encoding.default
            UTF-8
        
        
            javax.jws.*
        
    
    

    The former option is simpler but is global to the webapp. The later introduces more complexity if you're not currently using an EAR packaging but gives finer control.

    See also

    • Understanding WebLogic Server Application Classloading

提交回复
热议问题