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

NullPointerException when performing log:clear then log:tail

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.2.12, 2.3.2, 2.4.0, 3.0.0
    • Component/s: None
    • Labels:
      None
    • Environment:

      Windows Server 2008 r2, Ubuntu

      Description

      This occurs within FuseESB, but it was mentioned that this may be a karaf issue

      Here is the sequence of events which take place :

      FuseESB:karaf@root> log:clear
      FuseESB:karaf@root> log:tail
      Error executing command: java.lang.NullPointerException
      FuseESB:karaf@root> log:tail
      2012-10-19 22:22:34,260 | INFO  | l Console Thread | Console                          | 18 - org.apache.karaf.shell.console - 2.2.5.fuse-70-097 | Exception caught while executing command
      java.lang.NullPointerException
      	at org.apache.karaf.shell.log.DisplayLog.getColor(DisplayLog.java:172)[42:org.apache.karaf.shell.log:2.2.5.fuse-70-097]
      	at org.apache.karaf.shell.log.DisplayLog.display(DisplayLog.java:143)[42:org.apache.karaf.shell.log:2.2.5.fuse-70-097]
      	at org.apache.karaf.shell.log.LogTail.doExecute(LogTail.java:40)[42:org.apache.karaf.shell.log:2.2.5.fuse-70-097]
      	at org.apache.karaf.shell.console.OsgiCommandSupport.execute(OsgiCommandSupport.java:38)[18:org.apache.karaf.shell.console:2.2.5.fuse-70-097]
      	at org.apache.felix.gogo.commands.basic.AbstractCommand.execute(AbstractCommand.java:35)[18:org.apache.karaf.shell.console:2.2.5.fuse-70-097]
      	at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:78)[18:org.apache.karaf.shell.console:2.2.5.fuse-70-097]
      	at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:474)[18:org.apache.karaf.shell.console:2.2.5.fuse-70-097]
      	at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:400)[18:org.apache.karaf.shell.console:2.2.5.fuse-70-097]
      	at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)[18:org.apache.karaf.shell.console:2.2.5.fuse-70-097]
      	at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)[18:org.apache.karaf.shell.console:2.2.5.fuse-70-097]
      	at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)[18:org.apache.karaf.shell.console:2.2.5.fuse-70-097]
      	at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:89)[18:org.apache.karaf.shell.console:2.2.5.fuse-70-097]
      	at org.apache.karaf.shell.console.jline.Console.run(Console.java:233)[18:org.apache.karaf.shell.console:2.2.5.fuse-70-097]
      	at java.lang.Thread.run(Thread.java:722)[:1.7.0_07]
      

        Activity

        Hide
        charly Heath Kesler added a comment -

        this issue appears to be fixed, I tested in 2.2.10-SNAPSHOT, 2.3, and 3.0 and all worked as expected (no exceptions).

        Steps to test:

        • start karaf
        • log:clear
        • log:tail
        • log:tail (again just to make sure it did not throw an exception the first time)

        no error

        I also tried several combinations of clear and tail in between other commands, just to make sure.

        Show
        charly Heath Kesler added a comment - this issue appears to be fixed, I tested in 2.2.10-SNAPSHOT, 2.3, and 3.0 and all worked as expected (no exceptions). Steps to test: start karaf log:clear log:tail log:tail (again just to make sure it did not throw an exception the first time) no error I also tried several combinations of clear and tail in between other commands, just to make sure.
        Hide
        ffang Freeman Fang added a comment -

        Yeah, most likely KARAF-546 already fixed it, and the FUSE ESB version(7.0.2.fuse-097) you're using definitely already have this fix. I also tried that version and log:clear|log:tail just works for me and I can't reproduce this NPE. Could you elaborate how we can reproduce it?

        Freeman

        Show
        ffang Freeman Fang added a comment - Yeah, most likely KARAF-546 already fixed it, and the FUSE ESB version(7.0.2.fuse-097) you're using definitely already have this fix. I also tried that version and log:clear|log:tail just works for me and I can't reproduce this NPE. Could you elaborate how we can reproduce it? Freeman
        Hide
        jbonofre Jean-Baptiste Onofré added a comment -

        I'm not able to reproduce it on 2.2.9, 2.2.10-SNAPSHOT, 2.3.0, 2.3.1-SNAPSHOT, and 3.0.0-SNAPSHOT.

        I close this issue, please reopen it if you reproduce it on one of the listed versions above.

        Show
        jbonofre Jean-Baptiste Onofré added a comment - I'm not able to reproduce it on 2.2.9, 2.2.10-SNAPSHOT, 2.3.0, 2.3.1-SNAPSHOT, and 3.0.0-SNAPSHOT. I close this issue, please reopen it if you reproduce it on one of the listed versions above.
        Hide
        alanfoster Alan Foster added a comment -

        As requested I have reopened this issue as I am able to reproduce this same error on karaf 2.3 on windows 7

        karaf@root> log:Clear
        karaf@root> log:Tail
        Error executing command: java.lang.NullPointerException
        karaf@root> version
        2.3.0
        karaf@root> log:tail
        2012-12-21 22:35:51,589 | INFO  | l Console Thread | Console
              | araf.shell.console.jline.Console  199 | 14 - org.apache.karaf.shell.cons
        ole - 2.3.0 | Exception caught while executing command
        java.lang.NullPointerException
                at org.apache.karaf.shell.log.DisplayLog.getColor(DisplayLog.java:172)[2
        1:org.apache.karaf.shell.log:2.3.0]
                at org.apache.karaf.shell.log.DisplayLog.display(DisplayLog.java:143)[21
        :org.apache.karaf.shell.log:2.3.0]
                at org.apache.karaf.shell.log.LogTail.doExecute(LogTail.java:40)[21:org.
        apache.karaf.shell.log:2.3.0]
                at org.apache.karaf.shell.console.OsgiCommandSupport.execute(OsgiCommand
        Support.java:38)[14:org.apache.karaf.shell.console:2.3.0]
                at org.apache.felix.gogo.commands.basic.AbstractCommand.execute(Abstract
        Command.java:35)[14:org.apache.karaf.shell.console:2.3.0]
                at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:
        78)[14:org.apache.karaf.shell.console:2.3.0]
                at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:474)[14
        :org.apache.karaf.shell.console:2.3.0]
                at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:4
        00)[14:org.apache.karaf.shell.console:2.3.0]
                at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)[14:org.apache.k
        araf.shell.console:2.3.0]
                at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)[14:or
        g.apache.karaf.shell.console:2.3.0]
                at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)[14:or
        g.apache.karaf.shell.console:2.3.0]
                at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessi
        onImpl.java:89)[14:org.apache.karaf.shell.console:2.3.0]
                at org.apache.karaf.shell.console.jline.Console.run(Console.java:175)[14
        :org.apache.karaf.shell.console:2.3.0]
                at java.lang.Thread.run(Thread.java:662)[:1.6.0_27]
        ^C
        

        Again, the steps to reproduce are not entirely clear. But a log:clear followed by a log:tail is what causes this to occur eventually

        Show
        alanfoster Alan Foster added a comment - As requested I have reopened this issue as I am able to reproduce this same error on karaf 2.3 on windows 7 karaf@root> log:Clear karaf@root> log:Tail Error executing command: java.lang.NullPointerException karaf@root> version 2.3.0 karaf@root> log:tail 2012-12-21 22:35:51,589 | INFO | l Console Thread | Console | araf.shell.console.jline.Console 199 | 14 - org.apache.karaf.shell.cons ole - 2.3.0 | Exception caught while executing command java.lang.NullPointerException at org.apache.karaf.shell.log.DisplayLog.getColor(DisplayLog.java:172)[2 1:org.apache.karaf.shell.log:2.3.0] at org.apache.karaf.shell.log.DisplayLog.display(DisplayLog.java:143)[21 :org.apache.karaf.shell.log:2.3.0] at org.apache.karaf.shell.log.LogTail.doExecute(LogTail.java:40)[21:org. apache.karaf.shell.log:2.3.0] at org.apache.karaf.shell.console.OsgiCommandSupport.execute(OsgiCommand Support.java:38)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.commands.basic.AbstractCommand.execute(Abstract Command.java:35)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java: 78)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:474)[14 :org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:4 00)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)[14:org.apache.k araf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)[14:or g.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)[14:or g.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessi onImpl.java:89)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.karaf.shell.console.jline.Console.run(Console.java:175)[14 :org.apache.karaf.shell.console:2.3.0] at java.lang. Thread .run( Thread .java:662)[:1.6.0_27] ^C Again, the steps to reproduce are not entirely clear. But a log:clear followed by a log:tail is what causes this to occur eventually
        Hide
        alanfoster Alan Foster added a comment -

        This issue has been reproducable on windows 7, windows server 2008 r2 and ubuntu
        When this exception occurs it has been when using both karaf.bat and client.bat

        Show
        alanfoster Alan Foster added a comment - This issue has been reproducable on windows 7, windows server 2008 r2 and ubuntu When this exception occurs it has been when using both karaf.bat and client.bat
        Hide
        ffang Freeman Fang added a comment -
        Show
        ffang Freeman Fang added a comment - commit fix http://svn.apache.org/r1484682 for trunk http://svn.apache.org/r1484681 for 2.x branch http://svn.apache.org/r1484646 for 2.3.x branch http://svn.apache.org/r1484683 for 2.2.x branch

          People

          • Assignee:
            ffang Freeman Fang
            Reporter:
            alanfoster Alan Foster
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development