You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Jean-Christophe Kautzmann (JIRA)" <ji...@apache.org> on 2014/07/10 17:03:05 UTC
[jira] [Updated] (SLING-3757) cannot add more than 1 service user
with the OSGI console
[ https://issues.apache.org/jira/browse/SLING-3757?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jean-Christophe Kautzmann updated SLING-3757:
---------------------------------------------
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:
{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}
was:
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}
> 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
>
> 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:
> {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)