Karaf
  1. Karaf
  2. KARAF-951

dev:create-dump raises a NullPointerException

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.4, 3.0.0
    • Fix Version/s: 2.2.5, 3.0.0
    • Component/s: karaf-shell
    • Labels:
      None

      Description

      dev:create-dump shell command (and dev MBean) raises a NullPointerException:

      2011-10-20 19:39:14,110 | INFO | l Console Thread | Console | araf.shell.console.jline.Console 236 | 28 - org.apache.karaf.shell.console - 2.2.4.SNAPSHOT | Exception caught while executing command
      java.lang.NullPointerException
      at org.apache.karaf.diagnostic.common.LogDumpProvider.createDump(LogDumpProvider.java:41)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.6.0_26]
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)[:1.6.0_26]
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)[:1.6.0_26]
      at java.lang.reflect.Method.invoke(Method.java:597)[:1.6.0_26]
      at org.apache.aries.proxy.impl.ProxyHandler$1.invoke(ProxyHandler.java:50)[7:org.apache.aries.proxy:0.3.0]
      at org.apache.aries.proxy.impl.DefaultWrapper.invoke(DefaultWrapper.java:31)[7:org.apache.aries.proxy:0.3.0]
      at org.apache.aries.proxy.impl.ProxyHandler.invoke(ProxyHandler.java:78)[7:org.apache.aries.proxy:0.3.0]
      at $Proxy2.createDump(Unknown Source)[13:org.apache.karaf.diagnostic.core:2.2.4.SNAPSHOT]
      at org.apache.karaf.diagnostic.command.DumpCommand.doExecute(DumpCommand.java:88)[39:org.apache.karaf.diagnostic.command:2.2.4.SNAPSHOT]
      at org.apache.karaf.shell.console.OsgiCommandSupport.execute(OsgiCommandSupport.java:38)[28:org.apache.karaf.shell.console:2.2.4.SNAPSHOT]
      at org.apache.felix.gogo.commands.basic.AbstractCommand.execute(AbstractCommand.java:35)[28:org.apache.karaf.shell.console:2.2.4.SNAPSHOT]
      at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:78)[28:org.apache.karaf.shell.console:2.2.4.SNAPSHOT]
      at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:474)[28:org.apache.karaf.shell.console:2.2.4.SNAPSHOT]
      at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:400)[28:org.apache.karaf.shell.console:2.2.4.SNAPSHOT]
      at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)[28:org.apache.karaf.shell.console:2.2.4.SNAPSHOT]
      at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)[28:org.apache.karaf.shell.console:2.2.4.SNAPSHOT]
      at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)[28:org.apache.karaf.shell.console:2.2.4.SNAPSHOT]
      at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:89)[28:org.apache.karaf.shell.console:2.2.4.SNAPSHOT]
      at org.apache.karaf.shell.console.jline.Console.run(Console.java:218)[28:org.apache.karaf.shell.console:2.2.4.SNAPSHOT]
      at java.lang.Thread.run(Thread.java:662)[:1.6.0_26]

        Activity

        Hide
        Jean-Baptiste Onofré added a comment -

        OK, I understood the issue.

        The issue is that I changed the log location (in the etc/org.ops4j.pax.logging.cfg file).

        The create-dump command tries to get the log (to include into the dump zip file) in a hard-coded way:

        File logDir = new File("data/log");

        To be consistent, create-dump should check the pax logging appender location (using the corresponding OSGi service) to get the file in the right directory.

        Show
        Jean-Baptiste Onofré added a comment - OK, I understood the issue. The issue is that I changed the log location (in the etc/org.ops4j.pax.logging.cfg file). The create-dump command tries to get the log (to include into the dump zip file) in a hard-coded way: File logDir = new File("data/log"); To be consistent, create-dump should check the pax logging appender location (using the corresponding OSGi service) to get the file in the right directory.
        Hide
        Jean-Baptiste Onofré added a comment -

        I enhanced the LogDumpProvider to look for *.file property in org.ops4j.pax.logging configuration and package the corresponding log files.

        Show
        Jean-Baptiste Onofré added a comment - I enhanced the LogDumpProvider to look for *.file property in org.ops4j.pax.logging configuration and package the corresponding log files.
        Hide
        Jean-Baptiste Onofré added a comment -

        Fixed on trunk: revision 1188587.

        Show
        Jean-Baptiste Onofré added a comment - Fixed on trunk: revision 1188587.
        Hide
        Jean-Baptiste Onofré added a comment -

        Fixed on trunk with the service unget: revision 1188594.

        Show
        Jean-Baptiste Onofré added a comment - Fixed on trunk with the service unget: revision 1188594.
        Hide
        Jean-Baptiste Onofré added a comment -

        Fixed on karaf-2.2.x branch: revision 1188596.

        Show
        Jean-Baptiste Onofré added a comment - Fixed on karaf-2.2.x branch: revision 1188596.

          People

          • Assignee:
            Jean-Baptiste Onofré
            Reporter:
            Jean-Baptiste Onofré
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development