Jean-Christophe Kautzmann created SLING-3757:
------------------------------------------------
Summary: cannot add more than 1 service user with the OSGI console
Key: SLING-3757
URL: https://issues.apache.org/jira/browse/SLING-3757
Project: Sling
Issue Type: Bug
Reporter: Jean-Christophe Kautzmann
how to reproduce:
1. in the OSGI console -> configuration -> Apache Sling Service User Mapper
Service Amendment: add 2 configs and save
error.log:
{code}
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)
{code}
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
{code}
if (id.equals(otherId)) {
{code}
should be:
{code}
if (id != null && id.equals(otherId)) {
{code}
--
This message was sent by Atlassian JIRA
(v6.2#6252)