简体   繁体   English

Weblogic-如何添加特定的jar来加载到weblogic中而不影响其他

[英]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. 我想在我的weblogic应用程序中使用joda-time版本1.6,默认情况下weblogic附带joda-time 1.2,我希望服务器加载最新的joda-time库。

My joda-time jar located at: 我的joda-time jar位于:

/WEB-INF/lib/

It works by modifying /WEB-INF/weblogic.xml with the following: 它通过使用以下内容修改/WEB-INF/weblogic.xml来工作:

<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? 我怎么能只想让weblogic使用最新的joda-time而不影响其他库?

I tried to modify weblogic-application.xml in /META-INF/, it won't work. 我试图修改/ META-INF /中的weblogic-application.xml,它不起作用。

You could instead add the following to only overwrite the jodatime library 您可以改为添加以下内容以仅覆盖jodatime库

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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