如何在WebLogic中设置jar的顺序? [英] How to set order of jars in WebLogic?

查看:163
本文介绍了如何在WebLogic中设置jar的顺序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序中,我使用的是 Joda-Time 2.0,但在我的 WebLogic 路径中有库Joda-Time 1.2.

In my application I am using Joda-Time 2.0 but in my WebLogic path there is library Joda-Time 1.2.

如何更改顺序并告诉WebLogic使用我的库?现在它正在使用自己的库,而不是我的库.我刚刚在Joda-Time 2.0中添加了一个Maven项目依赖项.

How can I change the order and tell WebLogic to use my library? Now it is using its own library, not mine. I just added a Maven project dependency to Joda-Time 2.0.

推荐答案

有几种方法可以做到这一点.

There are several ways of doing this.

  1. 在您域的bin文件夹中更改startWeblogic.cmd(sh),查找类路径设置,并在其他WebLogic jar之前添加新的joda
  2. 如上所述,如果应用程序是Web应用程序,并且选择了战争中包含的任何库,则可以更改weblogic.xml.
  3. 如果使用的是Enterprise应用程序,则可以在weblogic-application.xml中设置以下选项:

  1. Change your startWeblogic.cmd(sh) in the bin folder for your domain, look for the classpath setting and add the new joda before any other WebLogic jars
  2. as was said above, you can change your weblogic.xml if the application is a web application and chose to prefer any lib that comes inside the war.
  3. If you are using an Enterprise application, you can set the following options in your weblogic-application.xml:

<prefer-application-packages>
    <package-name>org.apache.*</package-name>
    <package-name>antlr.*</package-name>
</prefer-application-packages>

然后在其中设置joda的软件包名称.

And set your package name for joda in there.

请注意,第一个选项可能会导致WebLogic出现异常行为.

Please note that the first option might result in strange behavior from WebLogic.

请注意,由于某些原因,我无法使代码与XML一起使用.

Note for some reason I can't get the code to work with the XML.

这篇关于如何在WebLogic中设置jar的顺序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆