Claus Ibsen created CAMEL-26863:
-----------------------------------
Summary: camel-jbang - Every command in the shell panel fails with
a NullPointerException
Key: CAMEL-26863
URL: https://issues.apache.org/jira/browse/CAMEL-26863
Project: Camel
Issue Type: Bug
Components: camel-jbang
Reporter: Claus Ibsen
Assignee: Claus Ibsen
Fix For: 4.24.0
Every command typed in the shell panel of camel tui (F6) fails with:
{noformat}
java.lang.NullPointerException: Cannot read field "versionHelpRequested"
because "x0" is null
at
picocli.CommandLine$ParseResult$Builder.access$1100(CommandLine.java:12685)
at
picocli.CommandLine$Interpreter.isAnyHelpRequested(CommandLine.java:14851)
at picocli.CommandLine$Interpreter.parse(CommandLine.java:13640)
...
at
org.jline.picocli.PicocliCommandRegistry$PicocliCommand.execute(PicocliCommandRegistry.java:292)
at
org.apache.camel.dsl.jbang.core.commands.CamelShellCommandRegistry$2.execute(CamelShellCommandRegistry.java:126)
{noformat}
for example ps, version, get route, ask who are you. camel shell is fine.
Since CAMEL-26440 the shell panel builds the commands with
CamelJBangMain.newCommandLine(), a fresh root command line that is never
parsed. The shell runs a sub-command directly, and picocli then asks each
parent command whether help was requested; the root has no parse result, hence
the NPE. camel shell uses the command line that ran camel shell, whose root is
parsed.
_Claude Code on behalf of davsclaus_
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)