user3595078
user3595078

Reputation: 273

JDBCUserStoreManager Configuring as Secondary User Stores is not working in wso2esb

I am using wso2 esb 4.8.1. I am trying to add the JDBCUserStoreManager Configuring as Secondary User Stores but unable to add some query related errors occurring. my configuration is like this <

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>

its showing success message while adding if i restart the server its giving so many errors. like

[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...

if i add this configuratin

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

again its giving this error tenant -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)

i need to add the data source for this else its work,I am unable to get the issue. my table is like this table name:AUTHENTICATION columnnames: username, password,role

data:system,system,everyone

any help for this. Thanks in advance,

Upvotes: 3

Views: 1014

Answers (1)

Pushpalanka
Pushpalanka

Reputation: 877

The cause may be that some of the other SQL queries running are expecting the default WSO2 user store schema as you are using the default shipped JDBCUserStoreManager with a different schema. When you have the need to use a this kind of different user store structure, it is recommended to use a custom user store, which provide you more freedom on handling user store functionality according to your requirement. Following links may be of help to you. (Please note that though document is for Identity Server - 5.0.0, it's valid for ESB 4.8.1 as well.)

[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

Upvotes: 1

Related Questions