简体   繁体   中英

WSO2 Identity Server 5.0.0 with Postgres registry database

I tried WSO2 - Identity Server 5.0.0 using postgresql-9.1 as a registry database and had the following troubles :

First i got some troubles setting up the registry database :

  • in the file ${CARBON_HOME}/dbscripts/identity/postgresql.sql at line 199 i had to replace :

     ID INTEGER INTEGER NEXTVAL('IDN_ASSOCIATED_ID_SEQ'), 

    by

     ID INTEGER DEFAULT NEXTVAL('IDN_ASSOCIATED_ID_SEQ'), 
  • in the file ${CARBON_HOME}/dbscripts/identity/application-mgt/postgresql.sql i had to replace every occurence of :

     ID INTEGER NEXTVAL 

    by

     ID INTEGER DEFAULT NEXTVAL 

    and at line 249 i had to replace :

     PROPERTY_BLOB_VALUE BLOB, 

    by

     PROPERTY_BLOB_VALUE BYTEA, 

I could then create the registry database but i had some other troubles

  • The size of some column : In my config the users are identified by their email (so the user identifier may be long) and this caused an exception when trying to add a Service provider. For example in the REG_LOG table i had to increase the size of the reg_user_id column. I'm not sure it was necessary but i also changed the size of some columns for tables REG_CLUSTER_LOCK, REG_RESOURCE, REG_RESOURCE_HISTORY, REG_COMMENT, REG_RATING and REG_TAG

  • When i tried to add a service provider i got the following exception :

     Caused by: org.postgresql.util.PSQLException: ERREUR: column « ID » doesn't exists Position : 125 at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2161) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1890) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:560) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:417) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:410) at org.wso2.carbon.identity.application.mgt.dao.impl.ApplicationDAOImpl.createApplication(ApplicationDAOImpl.java:129) ... 50 more 

    It looks like postgresql is case sensitive. The column exists but in lower case...

  • When i tried to add a IdP provider i got the following exception :

     Caused by: java.sql.SQLFeatureNotSupportedException: function org.postgresql.jdbc4.Jdbc4PreparedStatement.setBinaryStream(int, InputStream) not yet implemented. at org.postgresql.Driver.notImplemented(Driver.java:727) at org.postgresql.jdbc4.AbstractJdbc4Statement.setBinaryStream(AbstractJdbc4Statement.java:134) at org.wso2.carbon.idp.mgt.dao.IdPManagementDAO.addIdP(IdPManagementDAO.java:1236) ... 122 more 

    i'm using postgresql-9.3-1102.jdbc41.jar driver. It looks like this function is not supported yet. Could it be possible to use the setBinaryStream(int, InputStream, int) function instead (the last parameter is the length of the input stream in bytes)

This is a know issue in Identity Server 5.0.0. You can find a public jira for this from here . Could you please try to use the script files in the jira.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM