Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPE on changing role audience of a shared app #22394

Closed
AnuradhaSK opened this issue Jan 23, 2025 · 0 comments · Fixed by wso2-extensions/identity-organization-management#432
Closed

Comments

@AnuradhaSK
Copy link
Contributor

Description

NPE on changing role audience of a shared app from organization audience to application audience

Screen.Recording.2025-01-24.at.00.19.33.mov

Steps to Reproduce

  1. Create an application.
  2. Change its role audience as "Organization"
  3. Create some org audienced roles
  4. Share the app with all sub orgs
  5. Create a sub org
  6. Check on the shared app and shared roles in the sub org
  7. Go back to root app and change the role audience.
  8. Check on the terminal, you can see NPE
[2025-01-24 00:20:31,107] [a535052e-1d04-490d-9fbb-14eb3d6dca69] ERROR {org.wso2.carbon.identity.organization.management.handler.listener.SharedRoleMgtListener} - Exception occurred during deleting roles from organization 3d75bd8a-e85c-4ad6-bfcb-53b184e9256e java.util.concurrent.CompletionException: java.lang.NullPointerException
	at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:314)
	at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:319)
	at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1739)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.lang.NullPointerException
	at org.wso2.carbon.identity.role.v2.mgt.core.dao.RoleDAOImpl.getUserListOfRole(RoleDAOImpl.java:2870)
	at org.wso2.carbon.identity.role.v2.mgt.core.dao.RoleDAOImpl.getRole(RoleDAOImpl.java:506)
	at org.wso2.carbon.identity.role.v2.mgt.core.RoleManagementServiceImpl.getRole(RoleManagementServiceImpl.java:292)
	at org.wso2.carbon.identity.application.mgt.listener.DefaultRoleManagementListener.postGetAssociatedApplicationIdsByRoleId(DefaultRoleManagementListener.java:498)
	at org.wso2.carbon.identity.role.v2.mgt.core.RoleManagementServiceImpl.getAssociatedApplicationByRoleId(RoleManagementServiceImpl.java:950)
	at org.wso2.carbon.identity.organization.management.handler.listener.SharedRoleMgtListener.handleOrganizationAudiencedSharedRoleDeletion(SharedRoleMgtListener.java:540)
	at org.wso2.carbon.identity.organization.management.handler.listener.SharedRoleMgtListener.lambda$handleRemovedOrganizationAudienceRolesOnAppUpdate$5(SharedRoleMgtListener.java:329)
	at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1736)
	... 3 more

  1. When you check the sub org, the shared org roles have not been deleted as well(Since there is no any other app which consume org roles those should be deleted)

Version

IS-7.1.0-m8-SNAPSHOT

Environment Details (with versions)

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging a pull request may close this issue.

3 participants