首页 > 解决方案 > 数据源的安全加载错误。解密数据时出错

问题描述

我知道这里已经问过一个类似的问题,但是由于给出的答案对我没有帮助,而且我的问题有点不同,所以我在问一个新问题。

我通过创建数据源admin panel -> Configure -> Datasources,它工作正常。但是,如果我重新启动服务器,所有创建的数据源都会从数据源列表中丢失。

当我运行ESB服务器时,我可以通过日志看到这些数据源无法正确加载,因为 ESB 服务器无法解密它之前加密的敏感数据:

DataSourceRepository 在路径'/repository/components/org.wso2.carbon.ndatasource/myDatasource 更新数据源时出错 [remove:false]

从注册表更新数据源“myDatasource”时出错 [remove:false]:安全加载数据源时出错

元信息:解密数据时出错

尽管数据源列表中缺少myDatasource我仍然可以通过以下方式在注册表中看到它admin panel -> Registry -> /_system/config/repository/components/org.wso2.carbon.ndatasource/myDatasource

标签: encryptionwso2datasourceesb

解决方案


我有同样的问题。这似乎是 6.4.0 中引入的一些错误。
6.3.0 没有表现出这种行为。

作为一种解决方法,如果您在/conf/datasources/master-datasources.xml中定义数据源,那么数据源会在服务器启动时正确加载。然而,这不是理想的解决方案,因为它们随后无法通过 Web 控制台进行编辑。

或者,您可以下载注册表项,编辑密码元素以删除“Encrypted=true”并将密码更改为未加密。然后将编辑后的文件作为新的注册表项与旧的一起上传。

这两种方法都不适用于生产,因为它们使密码未加密。

出于兴趣,您是否在 Windows 上运行它?我还在 EI 6.4.0 上发现 Ciphertool 实用程序由于路径格式错误而无法运行。我怀疑这可能是相关的,但我找不到格式错误的路径来自哪里,它似乎在重复路径中的 {carbon.home} 元素:

    C:\Program Files\WSO2\Enterprise Integrator\6.4.0\bin>ciphertool
Using CARBON_HOME:   C:\Program Files\WSO2\Enterprise Integrator\6.4.0
Using JAVA_HOME:    C:\WSO2\Enterprise Integrator\6.3.0\jdk\jdk1.8.0_192
Exception in thread "main" java.nio.file.InvalidPathException: Illegal char <:> at index 51: C:\Program Files\WSO2\Enterprise Integrator\6.4.0\C:\Program Files\WSO2\Enterprise Integrator\6.4.0\/repository/resources/security/wso2carbon.jks
        at sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:182)
        at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153)
        at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
        at sun.nio.fs.WindowsPath.parse(WindowsPath.java:94)
        at sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:255)
        at java.nio.file.Paths.get(Paths.java:84)
        at org.wso2.ciphertool.utils.Utils.getConfigFilePath(Utils.java:98)
        at org.wso2.ciphertool.utils.Utils.setSystemProperties(Utils.java:289)
        at org.wso2.ciphertool.CipherTool.initialize(CipherTool.java:93)
        at org.wso2.ciphertool.CipherTool.main(CipherTool.java:52)

推荐阅读