Return-Path: X-Original-To: apmail-karaf-dev-archive@minotaur.apache.org Delivered-To: apmail-karaf-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id F2B5F10987 for ; Fri, 29 Nov 2013 09:33:25 +0000 (UTC) Received: (qmail 62286 invoked by uid 500); 29 Nov 2013 09:33:25 -0000 Delivered-To: apmail-karaf-dev-archive@karaf.apache.org Received: (qmail 62224 invoked by uid 500); 29 Nov 2013 09:33:25 -0000 Mailing-List: contact dev-help@karaf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@karaf.apache.org Delivered-To: mailing list dev@karaf.apache.org Received: (qmail 62208 invoked by uid 99); 29 Nov 2013 09:33:25 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 29 Nov 2013 09:33:25 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of ch007m@gmail.com designates 209.85.192.175 as permitted sender) Received: from [209.85.192.175] (HELO mail-pd0-f175.google.com) (209.85.192.175) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 29 Nov 2013 09:33:19 +0000 Received: by mail-pd0-f175.google.com with SMTP id w10so13523515pde.34 for ; Fri, 29 Nov 2013 01:32:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=DcHQF4+8542Az/TXLCWNuV56IzHOrsIeklqbWmH+9xA=; b=RQkOXnll+6cd+PlZxZ+Ht552Zw5bUMnrrJXFKPWFzmJSBtmJklBAjiNE75Pxf2IcpY DocC+Yr8iNNE+/No7uIfLjYKm3If55pCdY4SOtCPl3B4HGKH80NrQCj9ufWp0rN9Sy6Y kBSsT5hfnC6F8RtasYaJRG08Ikmf045mURe+Qn5WeNCFH8OmXLw9JLf6o/PwXYKFT8MM AT22eM8FOha8l7/bRGSrkbtCLI7X4YLeNUBFtAzVZAvm8/Oc54kHboBETEtBsIWIn7zD bz00qYs57e6UYvWjaaSourQWCw4Vsyr9xFh9Cxl1yqJXrFmKGMptvhdTq0SBokFXOU60 QyYw== MIME-Version: 1.0 X-Received: by 10.68.211.1 with SMTP id my1mr15311681pbc.55.1385717578348; Fri, 29 Nov 2013 01:32:58 -0800 (PST) Received: by 10.70.37.208 with HTTP; Fri, 29 Nov 2013 01:32:58 -0800 (PST) In-Reply-To: <52985EF1.4050901@nanthrax.net> References: <52985EF1.4050901@nanthrax.net> Date: Fri, 29 Nov 2013 10:32:58 +0100 Message-ID: Subject: Re: NPE with command Help & Karaf Shell Console From: Charles Moulliard To: dev@karaf.apache.org Content-Type: multipart/alternative; boundary=e89a8ff1c6b2043d6704ec4d848d X-Virus-Checked: Checked by ClamAV on apache.org --e89a8ff1c6b2043d6704ec4d848d Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 2.3.3 On Fri, Nov 29, 2013 at 10:31 AM, Jean-Baptiste Onofr=E9 w= rote: > Hi Charles, > > what's the Karaf version (as it changed between 2.x and 3.x) ? > > Regards > JB > > > On 11/29/2013 10:18 AM, Charles Moulliard wrote: > >> Hi, >> >> For a documentation project, I'm currently creating a Java Command Line >> Tool client using our excellent Apache Karaf Shell Console. Nevertheless= , >> when I try to get help from a command, Gogo & Felix returns a NPE >> >> HylaMain >> java.io.BufferedInputStream@9506dc4 >> hyla>echo blabla >> echo blabla >> blabla >> hyla>help echo >> help echo >> [main] ERROR org.apache.karaf.shell.console.jline.Console - Exception >> caught while executing command >> java.lang.NullPointerException >> at >> org.apache.karaf.shell.console.help.HelpAction. >> doExecute(HelpAction.java:40) >> at >> org.apache.karaf.shell.console.AbstractAction. >> execute(AbstractAction.java:33) >> at >> org.apache.felix.gogo.commands.basic.AbstractCommand.execute( >> AbstractCommand.java:35) >> at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:474) >> at org.apache.felix.gogo.runtime.Closure.executeStatement( >> Closure.java:400) >> at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108) >> at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183) >> at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120) >> at >> org.apache.felix.gogo.runtime.CommandSessionImpl.execute( >> CommandSessionImpl.java:89) >> at org.apache.karaf.shell.console.jline.Console.run(Console.java:173) >> at org.apache.karaf.shell.console.Main.run(Main.java:220) >> at org.apache.karaf.shell.console.Main.run(Main.java:164) >> at org.apache.karaf.shell.console.Main.run(Main.java:79) >> at com.redhat.gpe.hyla.tooling.HylaMain.main(HylaMain.java:34) >> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >> at >> sun.reflect.NativeMethodAccessorImpl.invoke( >> NativeMethodAccessorImpl.java:39) >> at >> sun.reflect.DelegatingMethodAccessorImpl.invoke( >> DelegatingMethodAccessorImpl.java:25) >> at java.lang.reflect.Method.invoke(Method.java:597) >> at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120) >> Error executing command: java.lang.NullPointerException >> >> As this code is really hard to debug as we have embedded the code of >> org.apache.felix.gogo.runtime >> & org.apache.felix.gogo.commands in the jar of Karaf Shell Console, does >> anybody knows why I could get a NPE when we call this method. In debug >> mode, I confirm that the session object exists but the command is null >> (even if I'm able to recuperate the args 'help echo' and this command >> works >> 'echo blabla' >> >> Regards, >> >> > -- > Jean-Baptiste Onofr=E9 > jbonofre@apache.org > http://blog.nanthrax.net > Talend - http://www.talend.com > --=20 Charles Moulliard Apache Committer / Architect @RedHat Twitter : @cmoulliard | Blog : http://cmoulliard.github.io --e89a8ff1c6b2043d6704ec4d848d--