与Weblogic系统相比,如何首选Weblogic域中的JAR [英] How to prefer JARs from Weblogic domain over those from weblogic system

查看:93
本文介绍了与Weblogic系统相比,如何首选Weblogic域中的JAR的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Weblogic Server 12.1.1 ,并将一些JAR复制到了域的 lib 文件夹中。 JAR之一是 org.apache.commons.io jar。现在,我有一个问题,即Weblogic本身在其系统类路径中带有 commons-io 的不同版本,因此我得到了 NoSuchMethodErrors 。有什么方法可以配置Weblogic使其更喜欢来自域的库而不是来自Weblogic系统的库?

I am using Weblogic Server 12.1.1 and copied some JARs to my domain's lib folder. One of the JARs is a org.apache.commons.io jar. Now I have the problem that Weblogic itself comes with a different version of commons-io in its system classpath and so I get NoSuchMethodErrors. Is there any way to configure Weblogic to prefer the libs from domain over those from Weblogic system?

过滤类加载器仅适用于应用程序随附的那些JAR( WEB-INF / lib )。

The Filtering Classloader works only on those JARs provided with the application (WEB-INF/lib).

推荐答案

如果需要将JAR放入域/ lib,我认为您必须编辑setDomainEnv.cmd并修改PRE_CLASSPATH变量。

If you need to put JARs into the domain /lib, I think you have to edit the setDomainEnv.cmd and modify PRE_CLASSPATH variable.

示例:
设置PRE_CLASSPATH = C:\myinstallation\ Middleware\wlserver_12.1\domains\mydomain\lib\myjar.jar

Example: set PRE_CLASSPATH=C:\myinstallation\Middleware\wlserver_12.1\domains\mydomain\lib\myjar.jar

但是,如果有可能将JAR放入WEB-INF / lib或APP-INF / lib,然后使用@Blekit解决方案,它更干净。

But, if is possible to put JARs in WEB-INF/lib or APP-INF/lib, then use @Blekit solution, it's cleaner.

这篇关于与Weblogic系统相比,如何首选Weblogic域中的JAR的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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