【问题标题】:Unable to read websphere custom properties in web.xml无法读取 web.xml 中的 websphere 自定义属性
【发布时间】:2015-05-01 16:35:36
【问题描述】:

我正在尝试在我的 war 文件之外读取我的配置文件,因此我在 Websphere 7.1 中声明了一个自定义属性/变量。但是有些 websphere 无法读取变量/令牌。

错误:

2015-04-30 18:19:57,459 错误 [server.startup : 0] [] [] [com.abc.config.admin.ConfigTool] - com.abc.config.AbcConfigException:从文件(${abc.config.dir}/configs)加载配置时出现异常:参数“目录”不是目录

web.xml:

<context-param>
        <param-name>secondaryBasePathList</param-name>
        <param-value>${abc.config.dir}/configs</param-value>
        <description>
            Directory/Path where the external files required for the
            configuration framework
        </description>
    </context-param>

我尝试了以下方法: 1. 在服务器 JVM 自定义属性中设置属性/令牌(根据 Websphere 文档:https://www-01.ibm.com/support/knowledgecenter/SSAW57_7.0.0/com.ibm.websphere.nd.multiplatform.doc/ info/ae/ae/xrun_jvm.html?cp=SSAW57_7.0.0%2F3-16-5-448)

  1. 将属性/令牌设置为 websphere 变量(根据 Websphere 文档:https://www-01.ibm.com/support/knowledgecenter/SSAW57_8.5.5/com.ibm.websphere.nd.doc/ae/ucws_rvars_inst.html
  2. 在服务器 Web 容器自定义属性中设置属性/令牌(根据 Websphere 文档:https://www-01.ibm.com/support/knowledgecenter/SSAW57_8.5.5/com.ibm.websphere.zseries.doc/ae/rweb_custom_props.html

以上所有方法都不适合我..

谢谢 禅那

【问题讨论】:

    标签: websphere web.xml


    【解决方案1】:

    WebSphere Application Server 不支持 web.xml 文件中的变量替换。您最好的选择是声明 &lt;env-entry&gt; 并在安装应用程序时指定绑定(实际值或默认命名空间中绑定的值的查找名称)。

    【讨论】:

    • 感谢 bkail,我会尝试使用 属性并更新您。
    猜你喜欢
    • 1970-01-01
    • 2020-12-08
    • 1970-01-01
    • 1970-01-01
    • 2020-04-06
    • 2019-03-14
    • 1970-01-01
    • 1970-01-01
    • 2020-10-30
    相关资源
    最近更新 更多