My Oracle Support Banner

Exception Thrown While Accessing Capabilities Using AdminRoleService.getAdminRolesForUser API (Doc ID 2227861.1)

Last updated on JANUARY 27, 2017

Applies to:

Identity Manager - Version and later
Information in this document applies to any platform.


The following exception is thrown when attempting to access capabilities that are associated with individual admin role using adminRoleService.getAdminRolesForUser(userKey,null) API.

Exception [EclipseLink-7242] (Eclipse Persistence Services - 2.3.1.v20111018-r10243): org.eclipse.persistence.exceptions.ValidationException
Exception Description: An attempt was made to traverse a relationship using indirection that had a null Session. This often occurs when an entity with an uninstantiated LAZY relationship is serialized and that lazy relationship is traversed after serialization. To avoid this issue, instantiate the LAZY relationship prior to serialization.
at org.eclipse.persistence.exceptions.ValidationException.instantiatingValueholderWithNullSession(
at org.eclipse.persistence.internal.indirection.QueryBasedValueHolder.instantiate(
at org.eclipse.persistence.internal.indirection.QueryBasedValueHolder.instantiate(
at org.eclipse.persistence.internal.indirection.DatabaseValueHolder.getValue(
at org.eclipse.persistence.indirection.IndirectList.buildDelegate(
at org.eclipse.persistence.indirection.IndirectList.getDelegate(
at org.eclipse.persistence.indirection.IndirectList$1.<init>(
at org.eclipse.persistence.indirection.IndirectList.listIterator(
at org.eclipse.persistence.indirection.IndirectList.iterator(

Sample code that produces above exception.

AdminRoleService adminRoleSrvc = oimClient.getService(AdminRoleService.class);
List adminroles1 = adminRoleSrvc.getAdminRolesForUser(userKey,null);
for (AdminRole a :adminroles1) {
          String roleName = a.getRoleName();
          System.out.println("Admin Role Name: " + roleName );
List capabilities;
capabilities = a.getCapabilitiess();
for (Capability c: capabilities) {
          System.out.println("Action Name: "+ c.getActionName());
          System.out.println("Resource Name: " + c.getResourceName());



To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!

In this Document

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.