Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-3757

cannot add more than 1 service user with the OSGI console

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Service User Mapper 1.0.0
    • Service User Mapper 1.0.4
    • None
    • None

    Description

      To reproduce:
      1. Open the OSGI console -> configuration -> Apache Sling Service User Mapper Service Amendment
      2. add 2 configs and save

      In the error.log:

      10.07.2014 16:33:29.074 *ERROR* [CM Event Dispatcher (Fire ConfigurationEvent: pid=org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl.amended.28a5ee37-c86b-40d7-892f-44a5b1b0a72c)] org.apache.sling.serviceusermapper [org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl(17)] The bindAmendment method has thrown an exception (java.lang.NullPointerException)
      java.lang.NullPointerException: null
           at org.apache.sling.commons.osgi.ServiceUtil$ComparableImplementation.compareTo(ServiceUtil.java:70)
           at org.apache.sling.serviceusermapping.impl.MappingConfigAmendment.compareTo(MappingConfigAmendment.java:95)
           at org.apache.sling.serviceusermapping.impl.MappingConfigAmendment.compareTo(MappingConfigAmendment.java:37)
           at java.util.ComparableTimSort.countRunAndMakeAscending(ComparableTimSort.java:290)
           at java.util.ComparableTimSort.sort(ComparableTimSort.java:157)
           at java.util.ComparableTimSort.sort(ComparableTimSort.java:146)
           at java.util.Arrays.sort(Arrays.java:472)
           at java.util.Collections.sort(Collections.java:155)
           at org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl.updateMappings(ServiceUserMapperImpl.java:164)
           at org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl.bindAmendment(ServiceUserMapperImpl.java:141)
      

      It seems that a null check is missing at:
      https://github.com/apache/sling/blob/trunk/bundles/commons/osgi/src/main/java/org/apache/sling/commons/osgi/ServiceUtil.java#L70

                  if (id.equals(otherId)) {
      

      should be:

                  if (id != null && id.equals(otherId)) {
      

      Attachments

        Activity

          People

            cziegeler Carsten Ziegeler
            jck Jean-Christophe Kautzmann
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: