如何在WebLogic中设置jar的顺序? [英] How to set order of jars in WebLogic?
问题描述
在我的应用程序中,我使用的是 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.
- 在您域的bin文件夹中更改startWeblogic.cmd(sh),查找类路径设置,并在其他WebLogic jar之前添加新的joda
- 如上所述,如果应用程序是Web应用程序,并且选择了战争中包含的任何库,则可以更改weblogic.xml.
-
如果使用的是Enterprise应用程序,则可以在weblogic-application.xml中设置以下选项:
- 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
- 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.
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屋!