1

There is WSO2 EI 6.4.0 docker container running in which trying to do user management task such as adding new role,adding new user, assign role to newly created user etc

When i try to add new role/listing role, it is not even shows default role such as admin or internal/everyone below ERROR got in console

Error while listing roles. Error: Cannot change transaction isolation level in the middle of a transaction.

console error

WSO2 Log:

[2023-05-16 12:32:41,412] [-1234] [] [http-nio-9443-exec-35] ERROR {org.wso2.carbon.user.mgt.ui.UserStoreCountClient} -  Cannot change transaction isolation level in the middle of a transaction.
org.wso2.carbon.identity.user.store.count.stub.UserStoreCountServiceUserStoreCounterException: UserStoreCountServiceUserStoreCounterException
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
        at java.lang.Class.newInstance(Class.java:442)
        at org.wso2.carbon.identity.user.store.count.stub.UserStoreCountServiceStub.countRoles(UserStoreCountServiceStub.java:617)

When i try to add new user, below ERROR i got.

Error while loading roles. Error: Error occurred while getting hybrid roles from filter : %

user console error

WSo2 Log:

[2023-05-16 12:34:22,826] [-1234] [] [http-nio-9443-exec-19] ERROR {org.wso2.carbon.user.mgt.UserRealmProxy} -  org.wso2.carbon.user.core.UserStoreException: Error occurred while getting hybrid roles from filter : %
[2023-05-16 12:34:22,830] [-1234] [] [http-nio-9443-exec-19] ERROR {org.wso2.carbon.user.mgt.ui.UserAdminClient} -  Error occurred while getting hybrid roles from filter : %
org.wso2.carbon.user.mgt.stub.UserAdminUserAdminException: UserAdminUserAdminException
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
        at java.lang.Class.newInstance(Class.java:442)
        at org.wso2.carbon.user.mgt.stub.UserAdminStub.getRolesOfUser(UserAdminStub.java:2555)
        at org.wso2.carbon.user.mgt.ui.UserAdminClient.getRolesOfUser(UserAdminClient.java:154)
        at org.apache.jsp.user.add_002dstep2_jsp._jspService(add_002dstep2_jsp.java:245)
        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)

Note:

DBMS: `PostgreSQL`
DBMS Version: `12.11`
DBMS Driver: `PostgreSQL JDBC Driver`
DBMS Driver Version: `42.2.2`

How to resolve this issue?

James Z
  • 12,209
  • 10
  • 24
  • 44
Justin
  • 855
  • 2
  • 11
  • 30

1 Answers1

1

Try adding the following to your DataSource config. This issue is reported here.

<testOnBorrow>true</testOnBorrow>
<validationQuery>SELECT 1; COMMIT</validationQuery>
<defaultAutoCommit>false</defaultAutoCommit>
<commitOnReturn>true</commitOnReturn>
<rollbackOnReturn>false</rollbackOnReturn>
ycr
  • 12,828
  • 2
  • 25
  • 45
  • 1
    Hi @ycr Thank you so much, after adding above params in WSO2_CARBON_DB, WSO2_USER_DB and REGISTRY_DB above issue resolved, now i could able to see default roles, adding new role/new user etc. – Justin May 19 '23 at 13:14