DBLookup 参数值作为注册表项不起作用

DBLookup parameter values as registry entries doesn't work

WSO2 EI 6.3.0

作为注册表项的 DBLookup 参数值的计算方式类似于文字。我读过 https://docs.wso2.com/display/EI630/DBLookup+Mediator 但对我不起作用。

Me dblookup 配置

<dblookup description="Checking historical">
    <connection>
        <pool>
            <driver>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver>
            <url>jdbc:sqlserver://localhost:1433;databasename=test</url>
            <user>conf:/custom/config.xml/database/user</user>
            <password>somepass</password>
        </pool>
    </connection>
    <statement>
        <sql><![CDATA[SELECT * FROM someTable]]></sql>
    </statement>
</dblookup>

和异常

org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Login failed for user 'conf:/custom/config.xml/database/user'

您使用的用户名将无法使用,原因是。

 <user>conf:/custom/config.xml/database/user</user>

用户字段尝试读取保存在文件中的值,这里您从 config.xml 读取,但是稍后您在 .xml 中提供相对路径,因此它将不起作用.

我建议您将用户名保存在注册表文件中,然后访问该用户名,这应该可行。