简体   繁体   中英

Weblogic - How to add specific jar to load in weblogic without affecting other

I want to use joda-time version 1.6 in my weblogic application, weblogic comes with joda-time 1.2 by default, i want the server to load for the newest joda-time library.

My joda-time jar located at:

/WEB-INF/lib/

It works by modifying /WEB-INF/weblogic.xml with the following:

<container-descriptor>     
<prefer-web-inf-classes>true</prefer-web-inf-classes>   
</container-descriptor> 

But, there is a problem if i add the above codes, it will affect my other functions that use other libraries.

How can i just want weblogic to use the latest joda-time without affecting other libraries?

I tried to modify weblogic-application.xml in /META-INF/, it won't work.

You could instead add the following to only overwrite the jodatime library

 <wls:container-descriptor>
    <wls:prefer-application-packages>
            <wls:package-name>org.joda.time</wls:package-name>
    </wls:prefer-application-packages>
 </wls:container-descriptor>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM