Uploaded image for project: 'OpenAM'
  1. OpenAM
  2. OPENAM-13948

When realm have Session service and user has Session service too viewing User's service fails

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 6.0.0, 6.0.0.1, 6.0.0.2, 6.0.0.3, 6.0.0.4, 6.0.0.5, 6.5.0
    • Fix Version/s: 7.0.0, 6.5.3
    • Component/s: rest, REST-SMS, session
    • Labels:
      None
    • Functional tests:
      Yes

      Description

      Bug description

      When the realm has a Session Service and also if the user is assigned a session service, the XUI fails to display the users Services (under Identities > User > Services)
      In fact the following REST calls fails with 500 Internal Error

      /json/realms/root/realms/test/users/quota/services?_action=nextdescendents
      /json/realms/root/realms/test/users/quota/services?_action=getCreatableTypes

      with

      CoreSystem 
      ERROR: A runtime exception occurred during the CREST request handling
      java.lang.IllegalStateException: Exception from invocation expected to be handled by promise
              at org.forgerock.json.resource.AnnotatedMethod.invoke(AnnotatedMethod.java:100)
              at org.forgerock.json.resource.AnnotatedMethod.invoke(AnnotatedMethod.java:61)
              at org.forgerock.json.resource.AnnotatedRequestHandler.handleRead(AnnotatedRequestHandler.java:60)
              at org.forgerock.json.resource.Router.handleRead(Router.java:331)
              at org.forgerock.openam.core.rest.sms.tree.DescribedGeneralActionsHandler.handleRead(DescribedGeneralActionsHandler.java:87)
      
      .....
              at java.lang.reflect.Method.invoke(Method.java:498)
              at org.forgerock.json.resource.AnnotatedMethod.invoke(AnnotatedMethod.java:96)
              ... 135 more
      Caused by: java.lang.NullPointerException: The attribute iplanet-am-session-service-status has no attribute schema in schema null
              at org.forgerock.openam.core.sms.SmsJsonConverter.getAttributeSchema(SmsJsonConverter.java:340)
              at org.forgerock.openam.core.sms.SmsJsonConverter.isSingleTypeAttribute(SmsJsonConverter.java:333)
              at org.forgerock.openam.core.sms.SmsJsonConverter.toJson(SmsJsonConverter.java:228)
              at org.forgerock.openam.core.sms.SmsJsonConverter.toJson(SmsJsonConverter.java:171)
              at org.forgerock.openam.core.rest.sms.SmsUserServiceSingletonProvider.handleRead(SmsUserServiceSingletonProvider.java:175)
              ... 140 more
      
        • Tested to fail on 6.5 MASTER too (M11)

      How to reproduce the issue

      1. Create a new realm
      2. Create a Session service at the realm level
      3. Create a new user
      4. Assign this user a Session service
      5. Observe the failure to display any Service for this user after
      Expected behaviour
      Should not cause issues
      
      Current behaviour
      Fails the REST calls or UI to display users bound services
      

      Work around

      Remove the Realm level "session" service.

      SmsJsonConverter.java
                      if (shouldBeIgnored(attributeName)) {
                          continue;
                      }
      
                      AttributeSchema attributeSchema = schema.getAttributeSchema(attributeName);
                      AttributeSchema.Type type = attributeSchema.getType();
      
      // Somehow attributeSchema is NULL
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                emma.rumsey Emma Rumsey
                Reporter:
                chee-weng.chea C-Weng C
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: