Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-3578

jboss-cli.bat always exits with return code 0 even after a cli failure

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 8.1.0.Final
    • Fix Version/s: 9.0.0.Alpha1
    • Component/s: CLI
    • Labels:
      None

      Description

      jboss-cli.bat cannot be reliably controlled by other scripts because it does not report return code from cli execution and always exits with 0 even after a failure.

      It can be solved with the following patch:

      --- C:/home/JBoss/wildfly-8.1.0.Final/bin/jboss-cli-orig.bat	Sat May 31 04:54:25 2014
      +++ C:/home/JBoss/wildfly-8.1.0.Final/bin/jboss-cli.bat	Thu Jul 03 10:19:09 2014
      @@ -1,4 +1,5 @@
       @echo off
      +setlocal ENABLEEXTENSIONS
       rem -------------------------------------------------------------------------
       rem JBoss Admin CLI Script for Windows
       rem -------------------------------------------------------------------------
      @@ -48,6 +49,7 @@
       if not exist "%JBOSS_RUNJAR%" (
         echo Could not locate "%JBOSS_RUNJAR%".
         echo Please check that you are in the bin directory when running this script.
      +  set /A RC=1
         goto END
       )
       
      @@ -71,5 +73,11 @@
            org.jboss.as.cli ^
            %*
       
      +set /A RC=%errorlevel%
       :END
       if "x%NOPAUSE%" == "x" pause
      +
      +if "x%RC%" == "x" (
      +  set /A RC=0
      +)
      +exit /B %RC%
      

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                aloubyansky Oleksiy Lubyanskyy
                Reporter:
                garu Gabriele Garuglieri
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: