Karaf
  1. Karaf
  2. KARAF-1018

using auto-complete (TAB key) on commands that don't take Arguments/Options throws IndexOutOfBoundsException.

    Details

      Description

      When using the TAB auto-complete key after commands that do not take any Arguments/Options,
      a message is printed saying "Error executing command: -1".
      The shell then becomes unresponsive and the TAB auto-complete option is inactive.

      1. Shell.jpg
        100 kB
        Adam Lavie
      2. doSomething.java
        1 kB
        Adam Lavie

        Activity

        Hide
        Glen Mazza added a comment -

        Just to confirm, this error is occurring only on new commands that don't have any options that you've specially created for Karaf? Because AFAIK every Karaf command has the --help option, which would mean this error would never occur for any built-in Karaf commands, correct?

        Show
        Glen Mazza added a comment - Just to confirm, this error is occurring only on new commands that don't have any options that you've specially created for Karaf? Because AFAIK every Karaf command has the --help option, which would mean this error would never occur for any built-in Karaf commands, correct?
        Hide
        Jean-Baptiste Onofré added a comment -

        I think so, but it can happen on Karaf command is the description attribute is not defined.

        I will override the OsgiCommandSupport to define a default empty description. Anyway, the Karaf console (jline) should handle that, I will enhance it as well.

        Show
        Jean-Baptiste Onofré added a comment - I think so, but it can happen on Karaf command is the description attribute is not defined. I will override the OsgiCommandSupport to define a default empty description. Anyway, the Karaf console (jline) should handle that, I will enhance it as well.
        Hide
        Jean-Baptiste Onofré added a comment -

        The problem doesn't occur on trunk (link to the enhancement around the shell namespace). I'm testing on karaf-2.2.x.

        Show
        Jean-Baptiste Onofré added a comment - The problem doesn't occur on trunk (link to the enhancement around the shell namespace). I'm testing on karaf-2.2.x.
        Hide
        Jean-Baptiste Onofré added a comment -

        I'm not able to reproduce the issue.

        Could you provide your command code, especially the annotated class and the blueprint declaration of the command ?

        Show
        Jean-Baptiste Onofré added a comment - I'm not able to reproduce the issue. Could you provide your command code, especially the annotated class and the blueprint declaration of the command ?
        Hide
        Adam Lavie added a comment -

        This issue is still not resolved.
        Will attach the command code.

        Show
        Adam Lavie added a comment - This issue is still not resolved. Will attach the command code.
        Hide
        Adam Lavie added a comment - - edited

        attached the command and a printscreen of the shell client.
        This was reproduces on 2.2.5, 2.2.6 and 3.0.0

        Show
        Adam Lavie added a comment - - edited attached the command and a printscreen of the shell client. This was reproduces on 2.2.5, 2.2.6 and 3.0.0
        Hide
        Christian Schneider added a comment -

        How do you install the command? Do you use the blueprint namespace? Can you provide a full project?

        Show
        Christian Schneider added a comment - How do you install the command? Do you use the blueprint namespace? Can you provide a full project?
        Hide
        Adam Lavie added a comment -

        Sure I can. basically it's an opensource project that you can check out using git from www.cloudifysource.org, or I can just send it to you directly.
        just tell me what you prefer.
        Thanks,
        Adam

        Show
        Adam Lavie added a comment - Sure I can. basically it's an opensource project that you can check out using git from www.cloudifysource.org, or I can just send it to you directly. just tell me what you prefer. Thanks, Adam
        Hide
        Christian Schneider added a comment -

        Checking out is ok. Can you provide some more informations where the sources are?

        Show
        Christian Schneider added a comment - Checking out is ok. Can you provide some more informations where the sources are?
        Hide
        Adam Lavie added a comment -

        In the cloudify project, you will find a karaf based project called CLI. You will find everything you need there.
        Please let me know if you need anything else.
        Adam

        Show
        Adam Lavie added a comment - In the cloudify project, you will find a karaf based project called CLI. You will find everything you need there. Please let me know if you need anything else. Adam
        Hide
        Christian Schneider added a comment -

        I checked out the source and tried to compile the CLI project.
        This is the error I get:
        [ERROR] Failed to execute goal on project CLI: Could not resolve dependencies for project org.cloudifysource:CLI:jar:2.1.1: Failed to collect dependencies for [junit:junit:jar:4.8.2 (test), com.gigasp
        aces:gs-openspaces:jar:9.0.1-m1-6694-50 (provided), org.apache.karaf.shell:org.apache.karaf.shell.console:jar:2.2.5 (compile), org.slf4j:slf4j-api:jar:1.6.1 (compile), org.slf4j:slf4j-nop:jar:1.6.1 (c
        ompile), commons-io:commons-io:jar:2.0.1 (provided), org.hyperic:sigar:jar:1.6.5 (provided), org.codehaus.groovy:groovy:jar:1.8.5 (provided), org.apache.httpcomponents:httpclient:jar:4.1.1 (compile),
        org.apache.httpcomponents:httpmime:jar:4.1.1 (compile), org.codehaus.jackson:jackson-core-asl:jar:1.3.0 (compile), org.codehaus.jackson:jackson-mapper-asl:jar:1.3.0 (compile), org.apache.commons:commo
        ns-exec:jar:1.1.1-SNAPSHOT (compile), org.cloudifysource:dsl:jar:2.1.1 (provided), org.cloudifysource:rest-client:jar:2.1.1 (compile), commons-logging:commons-logging:jar:1.0.3 (provided), com.sun:dep
        loy:jar:1 (system)]: Failed to read artifact descriptor for org.cloudifysource:dsl:jar:2.1.1: Could not transfer artifact org.cloudifysource:dsl:pom:2.1.1 from/to org.openspaces (http://maven-reposito
        ry.openspaces.org): Access denied to: http://maven-repository.openspaces.org/org/cloudifysource/dsl/2.1.1/dsl-2.1.1.pom, ReasonPhrase:Forbidden. -> [Help 1]

        Show
        Christian Schneider added a comment - I checked out the source and tried to compile the CLI project. This is the error I get: [ERROR] Failed to execute goal on project CLI: Could not resolve dependencies for project org.cloudifysource:CLI:jar:2.1.1: Failed to collect dependencies for [junit:junit:jar:4.8.2 (test), com.gigasp aces:gs-openspaces:jar:9.0.1-m1-6694-50 (provided), org.apache.karaf.shell:org.apache.karaf.shell.console:jar:2.2.5 (compile), org.slf4j:slf4j-api:jar:1.6.1 (compile), org.slf4j:slf4j-nop:jar:1.6.1 (c ompile), commons-io:commons-io:jar:2.0.1 (provided), org.hyperic:sigar:jar:1.6.5 (provided), org.codehaus.groovy:groovy:jar:1.8.5 (provided), org.apache.httpcomponents:httpclient:jar:4.1.1 (compile), org.apache.httpcomponents:httpmime:jar:4.1.1 (compile), org.codehaus.jackson:jackson-core-asl:jar:1.3.0 (compile), org.codehaus.jackson:jackson-mapper-asl:jar:1.3.0 (compile), org.apache.commons:commo ns-exec:jar:1.1.1-SNAPSHOT (compile), org.cloudifysource:dsl:jar:2.1.1 (provided), org.cloudifysource:rest-client:jar:2.1.1 (compile), commons-logging:commons-logging:jar:1.0.3 (provided), com.sun:dep loy:jar:1 (system)]: Failed to read artifact descriptor for org.cloudifysource:dsl:jar:2.1.1: Could not transfer artifact org.cloudifysource:dsl:pom:2.1.1 from/to org.openspaces ( http://maven-reposito ry.openspaces.org): Access denied to: http://maven-repository.openspaces.org/org/cloudifysource/dsl/2.1.1/dsl-2.1.1.pom , ReasonPhrase:Forbidden. -> [Help 1]
        Hide
        Christian Schneider added a comment -

        Moving to 3.0.1. If I can reproduce the error I will move it back to 3.0.0

        Show
        Christian Schneider added a comment - Moving to 3.0.1. If I can reproduce the error I will move it back to 3.0.0
        Hide
        Adam Lavie added a comment -

        I have added instructions in the git cloudify page on how to build the project, import it to the eclipse and debug it.
        The reason you got the error is that you can't build the CLI by itself. It depends on another project (DSL) that has to be compiled first.
        If you follow the instructions on git you should not have any problems. ant will do all the work for you.
        Please let me know if you are still having problems with it.

        Show
        Adam Lavie added a comment - I have added instructions in the git cloudify page on how to build the project, import it to the eclipse and debug it. The reason you got the error is that you can't build the CLI by itself. It depends on another project (DSL) that has to be compiled first. If you follow the instructions on git you should not have any problems. ant will do all the work for you. Please let me know if you are still having problems with it.
        Hide
        Adam Lavie added a comment -

        Forgot to publish the link: https://github.com/CloudifySource/cloudify

        Show
        Adam Lavie added a comment - Forgot to publish the link: https://github.com/CloudifySource/cloudify
        Hide
        Barak added a comment - - edited

        Has there been any progress with this issue? The problem is still relevant in 2.2.9.

        Show
        Barak added a comment - - edited Has there been any progress with this issue? The problem is still relevant in 2.2.9.

          People

          • Assignee:
            Jean-Baptiste Onofré
            Reporter:
            Adam Lavie
          • Votes:
            3 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:

              Development