【问题标题】:MobileFirst 7.1 reads the default worklight.properties even though the JNDI value is empty即使 JNDI 值为空,MobileFirst 7.1 也会读取默认的 worklight.properties
【发布时间】:2016-07-18 19:55:41
【问题描述】:

我们在 MFP 7.1 上遇到了这种行为,而在 WL 6.2 上却不是这样,它在我们的团队中引发了警报。

问题说明:

在 Worklight.properties 我有一个条目:

ENV = MFP-DEV.

我正在使用和适配器来读取这个属性:

var environment = WL.Server.configuration["ENV"];
WL.Logger.info ("Env Enabled is :" + environment);

我编译我的服务器代码并创建要部署在我的实际服务器上的 war 文件。当我解压war文件时,“EVN”条目为空,这与我们在运行 WL 6.2 时的情况相同。

问题是在 WL 6.2 中,如果我没有在服务器级别分配值。此条目的适配器输出为"undefined"

WL.Logger.info ("Env Enabled is :" + environment); 
// Env Enabled is undefined

但是,在 MFP 7.1 中进行相同的测试。结果如下:

WL.Logger.info ("Env Enabled is :" + environment); 
// Env Enabled is MFP-DEV

这意味着 MFP 服务器实际上正在读取 worklight.properties 以获取分配的值,该值位于 war 文件中,如果 JNDI 值未在服务器级别设置。除非我在 JNDI 中输入一个实际值,否则服务器将始终在其 war 文件中读取默认值。

这引起了对以下属性的关注,因为我们没有在 JNDI 服务器上为它们分配任何值。

worklight.properties 中的默认值:

#The path to the keystore, relative to the server folder in the MobileFirst Project, for example: conf/my-cert.jks
wl.ca.keystore.path=conf/mfp-default.keystore
#The type of the keystore file. Valid values are jks or pkcs12.
wl.ca.keystore.type=jks
#The password to the keystore file.
wl.ca.keystore.password=jYCuzgPNXNMLKfmlk6WM
#The alias of the entry where the private key and certificate are stored, in the keystore.
wl.ca.key.alias=mfp-default-cert
#The password to the alias in the keystore.
wl.ca.key.alias.password=82ShbwXc0KD5ni9Zc6yq

服务器 JNDI:

关于如何处理这个问题有什么建议吗?

服务器版本:7.1.0.00.20160401-2103

【问题讨论】:

    标签: ibm-mobilefirst mobilefirst-server


    【解决方案1】:

    在我看来,这更像是一个已修复的错误。

    您已经在 worklight.properties 中设置了一个自定义属性,而在 v7.1 中,您实际上可以在适配器代码中访问该属性。那太棒了。相应地更改您的实现。

    我也没有看到与您提到的其他属性的关系。
    你说有“关注”和“问题”,但你没有具体说明什么是“关注”和“问题”。

    【讨论】:

      猜你喜欢
      • 2018-01-20
      • 1970-01-01
      • 2011-04-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多