[jboss-jira] [JBoss JIRA] (AS7-4113) jboss-cli.sh: give exit code != 0 on connect failure

Alexey Loubyansky (JIRA) jira-events at lists.jboss.org
Thu Mar 8 14:54:36 EST 2012


     [ https://issues.jboss.org/browse/AS7-4113?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexey Loubyansky updated AS7-4113:
-----------------------------------

    Summary: jboss-cli.sh: give exit code != 0 on connect failure  (was: jboss-cli.sh: give exit code != 0 on failure)


In general, the exit code is set correctly. But connect is a good catch, thanks.
                
> jboss-cli.sh: give exit code != 0 on connect failure
> ----------------------------------------------------
>
>                 Key: AS7-4113
>                 URL: https://issues.jboss.org/browse/AS7-4113
>             Project: Application Server 7
>          Issue Type: Feature Request
>          Components: CLI
>    Affects Versions: 7.1.0.Final
>            Reporter: Frank Langelage
>            Assignee: Alexey Loubyansky
>
> When jboss-cli.sh fails, it does not set an exit code.
> E.g. called with option --connect and the server is not running, the connect fails. But exit code is 0.
> sb2000.[maj2e_langfr]/mbi/mbi2e_all. ksh -x $JBOSS_HOME/bin/jboss-cli.sh --controller=localhost:9999 --connect
> + + dirname /mbi/tools/jboss/7.1/bin/jboss-cli.sh
> DIRNAME=/mbi/tools/jboss/7.1/bin
> + cygwin=false
> + darwin=false
> + linux=false
> + uname
> + false
> + + cd /mbi/tools/jboss/7.1/bin/..
> + pwd
> RESOLVED_JBOSS_HOME=/mbi/tools/jboss/7.1
> + [ x/mbi/tools/jboss/7.1 = x ]
> + + cd /mbi/tools/jboss/7.1
> + pwd
> SANITIZED_JBOSS_HOME=/mbi/tools/jboss/7.1
> + [ /mbi/tools/jboss/7.1 != /mbi/tools/jboss/7.1 ]
> + export JBOSS_HOME
> + [ x = x ]
> + [ x/mbi/tools/jdk/1.6.0 != x ]
> + JAVA=/mbi/tools/jdk/1.6.0/bin/java
> + false
> + false
> + eval "/mbi/tools/jdk/1.6.0/bin/java" -jar "/mbi/tools/jboss/7.1/jboss-modules.jar" -mp "/mbi/tools/jboss/7.1/modules" org.jboss.as.cli "$@"
> + /mbi/tools/jdk/1.6.0/bin/java -jar /mbi/tools/jboss/7.1/jboss-modules.jar -mp /mbi/tools/jboss/7.1/modules org.jboss.as.cli --controller=localhost:9999 --connect
> org.jboss.as.cli.CliInitializationException: Failed to connect to the controller
>         at org.jboss.as.cli.impl.CliLauncher.initCommandContext(CliLauncher.java:228)
>         at org.jboss.as.cli.impl.CliLauncher.main(CliLauncher.java:207)
>         at org.jboss.as.cli.CommandLineMain.main(CommandLineMain.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 org.jboss.modules.Module.run(Module.java:260)
>         at org.jboss.modules.Main.main(Main.java:291)
> Caused by: org.jboss.as.cli.CommandLineException: The controller is not available at localhost:9999
>         at org.jboss.as.cli.impl.CommandContextImpl.connectController(CommandContextImpl.java:639)
>         at org.jboss.as.cli.impl.CommandContextImpl.connectController(CommandContextImpl.java:613)
>         at org.jboss.as.cli.impl.CliLauncher.initCommandContext(CliLauncher.java:226)
>         ... 8 more
> sb2000.[maj2e_langfr]/mbi/mbi2e_all. echo $?
> 0

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list