JDBCUserStoreManager配置为辅助用户存储在wso2esb中不起作用

时间:2014-07-08 12:25:30

标签: wso2 wso2esb wso2carbon wso2is

我正在使用wso2 esb 4.8.1。 我正在尝试添加JDBCUserStoreManager配置为辅助用户存储但无法添加一些与查询相关的错误。 我的配置是这样的 <

UserStoreManager class="org.wso2.carbon.user.core.jdbc.JDBCUserStoreManager">
      <Property name="driverName">oracle.jdbc.OracleDriver</Property>
      <Property name="url">jdbc:oracle:thin:@localhost:1521:xe</Property>
      <Property name="userName">fff</Property>
      <Property name="password">fff</Property>
      <Property name="Disabled">false</Property>
      <Property name="MaxUserNameListLength">100</Property>
      <Property name="MaxRoleNameListLength">100</Property>
      <Property name="UserRolesCacheEnabled">true</Property>
      <Property name="PasswordDigest">SHA-256</Property>
      <Property name="ReadGroups">true</Property>
      <Property name="ReadOnly">false</Property>
      <Property name="IsEmailUserName">false</Property>
      <Property name="DomainCalculation">default</Property>
      <Property name="StoreSaltedPassword">true</Property>
      <Property name="WriteGroups">true</Property>
      <Property name="UserNameUniqueAcrossTenants">false</Property>
      <Property name="PasswordJavaRegEx">^[\S]{5,30}$</Property>
      <Property name="PasswordJavaScriptRegEx">^[\S]{5,30}$</Property>
      <Property name="UsernameJavaRegEx">^[\S]{5,30}$</Property>
      <Property name="UsernameJavaScriptRegEx">^[\S]{5,30}$</Property>
      <Property name="RolenameJavaRegEx">^[\S]{5,30}$</Property>
      <Property name="RolenameJavaScriptRegEx">^[\S]{5,30}$</Property>
      <Property name="SCIMEnabled">false</Property>
      <Property name="SelectUserSQL">select fff.AUTHENTICATION.username from kkkk.AUTHENTICATION;</Property>
      <Property name="GetRoleListSQL">select fff.AUTHENTICATION.username from kkkk.AUTHENTICATION;</Property>
      <Property name="DomainName">TT.com</Property>
      <Property name="Description"/>
</UserStoreManager>
如果我重新启动服务器它会给出这么多错误,那么在添加时会显示成功消息。 像

[2014-07-08 17:07:42,620] ERROR - JDBCUserStoreManager Using sql : select fff.AUTHENTICATION.username from fff.AUTHENTICATION;
[2014-07-08 17:07:42,624] ERROR - AbstractUserStoreManager org.wso2.carbon.user.
core.UserStoreException: Invalid column index
[2014-07-08 17:07:42,663]  INFO - ServiceBusInitializer Starting ESB...

如果我添加这个configuratin

 <Property name="SelectUserSQL">select kkkk.AUTHENTICATION.username from kkkk.AUTHENTICATION;</Property>
      <Property name="EmptyRolesAllowed">Allowed</Property>
      <Property name="DomainName">TT.com</Property> 

再次给出了这个错误  租客-1234

[2014-07-08 17:49:10,112] ERROR - JDBCUserStoreManager Error while retrieving ro
les from JDBC user store
java.sql.SQLException: ORA-00942: table or view does not exist

        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:445)
        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396)
        at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:879)
        at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:450)
        at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:192)
        at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:531)
        at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.
java:207)

我需要为其他工作添加数据源,我无法解决问题。 我的桌子是这样的  表名:AUTHENTICATION  列名:用户名,密码,角色

data:system,system,everyone

对此有任何帮助。 提前谢谢,

1 个答案:

答案 0 :(得分:1)

原因可能是某些正在运行的其他SQL查询正在使用默认的WSO2用户存储架构,因为您使用的是默认的随附的JDBCUserStoreManager和不同的架构。当您需要使用这种不同的用户存储结构时,建议使用自定义用户存储,这样您可以根据需要更自由地处理用户存储功能。以下链接可能对您有所帮助。 (请注意,虽然文档适用于Identity Server - 5.0.0,但它也适用于ESB 4.8.1。)

[1] - http://docs.wso2.com/display/IS500/Writing+a+Custom+User+Store+Manager

[2] - http://pushpalankajaya.blogspot.com/2013/09/how-to-write-custom-user-store-manager.html