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

NPE is thrown when execute source command from client/ssh

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 4.1.2
    • 4.1.3, 4.2.0.M1
    • karaf
    • None
    • Java 8, Windows 7

    Description

      The NullPointerException is thrown when execute source command with a relative path as argument from client/ssh, e.g
      >client.bat -h localhost source scripts/abc.script

      2017-08-30T14:48:25,935 | ERROR | Thread-133       | he.karaf.shell.support.ShellUtil  149 | 107 - org.apache.karaf.shell.core - 4.1.2 | Exception caught while executing command
      java.lang.NullPointerException: null
      	at org.apache.karaf.shell.commands.impl.SourceAction.execute(SourceAction.java:71) [105:org.apache.karaf.shell.commands:4.1.2]
      	at org.apache.karaf.shell.impl.action.command.ActionCommand.execute(ActionCommand.java:84) [107:org.apache.karaf.shell.core:4.1.2]
      	at org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:68) [107:org.apache.karaf.shell.core:4.1.2]
      	at org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:86) [107:org.apache.karaf.shell.core:4.1.2]
      	at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:571) [107:org.apache.karaf.shell.core:4.1.2]
      	at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:497) [107:org.apache.karaf.shell.core:4.1.2]
      	at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:386) [107:org.apache.karaf.shell.core:4.1.2]
      	at org.apache.felix.gogo.runtime.Pipe.doCall(Pipe.java:417) [107:org.apache.karaf.shell.core:4.1.2]
      	at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:229) [107:org.apache.karaf.shell.core:4.1.2]
      	at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:59) [107:org.apache.karaf.shell.core:4.1.2]
      	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) [?:?]
      

      After debugging, the root cause maybe the L82 of org.apache.karaf.shell.impl.console.HeadlessSessionImpl class

      session.currentDir(null);
      

      Attachments

        Issue Links

          Activity

            People

              jbonofre Jean-Baptiste Onofré
              xldai Xilai Dai
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: