Weblogic首选应用程序包无法正常工作 [英] Weblogic Prefer application packages not working

查看:152
本文介绍了Weblogic首选应用程序包无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Weblogic 10.3.6门户服务器。 Weblogic 10.3.6总是使用weblogic附带的common-fileupload jar。但我希望服务器使用我在战争中使用的服务器。

I am using Weblogic 10.3.6 portal server. Weblogic 10.3.6 always uses common-fileupload jar that comes with weblogic. But I want the server to use the one I have inside my war.

用例是我有war1它使用的是war2里面的apache jar。我在两个战争的weblogic.xml中添加了以下行,但它不起作用,仍然加载weblogic特定的jar。

Use case is I have war1 it uses apache jars which are inside war2. I added below lines in weblogic.xml of both wars but it is not working and still loading weblogic specific jars.

<wls:container-descriptor>
    <wls:prefer-application-packages>
      <wls:package-name>com.sample.*</wls:package-name>
    </wls:prefer-application-packages>  
  </wls:container-descriptor> 

知道为什么没有使用战争中的jar?

Any idea why the jar inside the wars are not been used ?

推荐答案

为了使用prefer-application-packages,prefer-web-inf-classes必须设置为false。

In order to use prefer-application-packages prefer-web-inf-classes must be set to false.

WebLogic文档中的示例:

An example from WebLogic documentation:

<?xml version="1.0" encoding="UTF-8"?>
<weblogic-web-app xmlns="http://xmlns.oracle.com/weblogic/weblogic-web-app">
  <container-descriptor>
    <prefer-web-inf-classes>false</prefer-web-inf-classes>
    <prefer-application-packages>
      <package-name>javax.faces.*</package-name>
      <package-name>com.sun.faces.*</package-name>
      <package-name>com.bea.faces.*</package-name>
    </prefer-application-packages>

    <prefer-application-resources>
      <resource-name>javax.faces.*</resource-name>
      <resource-name>com.sun.faces.*</resource-name>
      <resource-name>com.bea.faces.*</resource-name>
      <resource-name>META-INF/services/javax.servlet.ServletContainerInitializer</resource-name>
      </prefer-application-resources>
  </container-descriptor>
</weblogic-web-app>

这篇关于Weblogic首选应用程序包无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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