Uploaded image for project: 'Karaf'
  1. Karaf
  2. KARAF-4974

service:list does not work if the service property ObjectClass returns an empty array

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 4.1.0
    • 4.1.1
    • karaf
    • None

    Description

      To reproduce build this excample https://github.com/cschneider/Karaf-Tutorial/tree/master/tasklist
      and do:
      feature:repo-add mvn:net.lr.tasklist/tasklist-features/1.0.0-SNAPSHOT/xml
      feature:install example-tasklist-persistence

      The feature installs a felix command which has ObjectClass=[]
      This causes the following error when executing service:list
      java.lang.ArrayIndexOutOfBoundsException: 0
      at org.apache.karaf.service.command.ListServices$ServiceClassComparator.compare(ListServices.java:157) [40:org.apache.karaf.service.core:4.1.0]
      at org.apache.karaf.service.command.ListServices$ServiceClassComparator.compare(ListServices.java:152) [40:org.apache.karaf.service.core:4.1.0]
      at java.util.TimSort.binarySort(TimSort.java:296) [?:?]
      at java.util.TimSort.sort(TimSort.java:239) [?:?]
      at java.util.Arrays.sort(Arrays.java:1512) [?:?]
      at java.util.ArrayList.sort(ArrayList.java:1454) [?:?]
      at java.util.Collections.sort(Collections.java:175) [?:?]
      at org.apache.karaf.service.command.ListServices.execute(ListServices.java:77) [40:org.apache.karaf.service.core:4.1.0]
      at org.apache.karaf.shell.impl.action.command.ActionCommand.execute(ActionCommand.java:84) [43:org.apache.karaf.shell.core:4.1.0]
      at org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:67) [43:org.apache.karaf.shell.core:4.1.0]
      at org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:82) [43:org.apache.karaf.shell.core:4.1.0]
      at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:552) [43:org.apache.karaf.shell.core:4.1.0]
      at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:478) [43:org.apache.karaf.shell.core:4.1.0]
      at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:367) [43:org.apache.karaf.shell.core:4.1.0]
      at org.apache.felix.gogo.runtime.Pipe.doCall(Pipe.java:417) [43:org.apache.karaf.shell.core:4.1.0]
      at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:229) [43:org.apache.karaf.shell.core:4.1.0]
      at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:59) [43:org.apache.karaf.shell.core:4.1.0]
      at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:?]
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:?]
      at java.lang.Thread.run(Thread.java:745) [?:?]

      Attachments

        Activity

          People

            cschneider Christian Schneider
            cschneider Christian Schneider
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: