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

Prevent NPE in log:tail

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.3.0
    • 2.4.0, 3.0.0, 2.3.4
    • karaf
    • None

    Description

      In some cases (after a log:clean for instance), log:tail throws a NPE:

      2013-10-11 14:53:51,037 | INFO | l Console Thread | Console | araf.shell.console.jline.Console 198 | 14 - org.apache.karaf.shell.console - 2.3.1 | Exception caught while executing command
      java.lang.NullPointerException
      at org.apache.karaf.shell.log.DisplayLog.getColor(DisplayLog.java:172)[34:org.apache.karaf.shell.log:2.3.1]
      at org.apache.karaf.shell.log.DisplayLog.display(DisplayLog.java:143)[34:org.apache.karaf.shell.log:2.3.1]
      at org.apache.karaf.shell.log.LogTail.doExecute(LogTail.java:40)[34:org.apache.karaf.shell.log:2.3.1]
      at org.apache.karaf.shell.console.OsgiCommandSupport.execute(OsgiCommandSupport.java:38)[14:org.apache.karaf.shell.console:2.3.1]
      at org.apache.felix.gogo.commands.basic.AbstractCommand.execute(AbstractCommand.java:35)[14:org.apache.karaf.shell.console:2.3.1]
      at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:78)[14:org.apache.karaf.shell.console:2.3.1]
      at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:474)[14:org.apache.karaf.shell.console:2.3.1]
      at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:400)[14:org.apache.karaf.shell.console:2.3.1]
      at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)[14:org.apache.karaf.shell.console:2.3.1]
      at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)[14:org.apache.karaf.shell.console:2.3.1]
      at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)[14:org.apache.karaf.shell.console:2.3.1]
      at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:89)[14:org.apache.karaf.shell.console:2.3.1]
      at org.apache.karaf.shell.console.jline.Console.run(Console.java:174)[14:org.apache.karaf.shell.console:2.3.1]
      at java.lang.Thread.run(Thread.java:722)[:1.7.0_21]
      ...

      We should prevent this and fallback without colour if not found.

      Attachments

        Issue Links

          Activity

            People

              jbonofre Jean-Baptiste Onofré
              jbonofre Jean-Baptiste Onofré
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: