Uploaded image for project: 'JBoss Web Server'
  1. JBoss Web Server
  2. JWS-774

tomcat-vault's CLI error handling needs work

XMLWordPrintable

    • Hide

      1) Install tomcat-vault
      2) Pass an incomplete command to vault to see how it behaves. Examples (excluding the banner for brevity):

      $ bin/vault.sh -t a
      ....
      Problem while parsing command line parameters:
      org.apache.commons.cli.MissingOptionException: Missing required option: [-c Check whether the secured attribute already exists in the vault, -x Secured attribute value (such as password) to store, -h Help]
      	at org.apache.commons.cli.Parser.checkRequiredOptions(Parser.java:299)
      	at org.apache.commons.cli.Parser.parse(Parser.java:231)
      	at org.apache.commons.cli.Parser.parse(Parser.java:119)
      	at org.apache.tomcat.vault.VaultTool.<init>(VaultTool.java:134)
      	at org.apache.tomcat.vault.VaultTool.main(VaultTool.java:79)
      $ bin/vault.sh
      ....
      Please enter a Digit::   0: Start Interactive Session  1: Remove Interactive Session  2: Exit
      a
      Exception in thread "main" java.util.InputMismatchException
      	at java.util.Scanner.throwFor(Scanner.java:864)
      	at java.util.Scanner.next(Scanner.java:1485)
      	at java.util.Scanner.nextInt(Scanner.java:2117)
      	at java.util.Scanner.nextInt(Scanner.java:2076)
      	at org.apache.tomcat.vault.VaultTool.main(VaultTool.java:109)
      
      Show
      1) Install tomcat-vault 2) Pass an incomplete command to vault to see how it behaves. Examples (excluding the banner for brevity): $ bin/vault.sh -t a .... Problem while parsing command line parameters: org.apache.commons.cli.MissingOptionException: Missing required option: [-c Check whether the secured attribute already exists in the vault, -x Secured attribute value (such as password) to store, -h Help] at org.apache.commons.cli.Parser.checkRequiredOptions(Parser.java:299) at org.apache.commons.cli.Parser.parse(Parser.java:231) at org.apache.commons.cli.Parser.parse(Parser.java:119) at org.apache.tomcat.vault.VaultTool.<init>(VaultTool.java:134) at org.apache.tomcat.vault.VaultTool.main(VaultTool.java:79) $ bin/vault.sh .... Please enter a Digit:: 0: Start Interactive Session 1: Remove Interactive Session 2: Exit a Exception in thread "main" java.util.InputMismatchException at java.util.Scanner.throwFor(Scanner.java:864) at java.util.Scanner.next(Scanner.java:1485) at java.util.Scanner.nextInt(Scanner.java:2117) at java.util.Scanner.nextInt(Scanner.java:2076) at org.apache.tomcat.vault.VaultTool.main(VaultTool.java:109)

      The error handling in tomcat-vault's CLI consists of e.printStackTrace() which dumps directly to the screen for users to see. We should catch those exceptions and log some user-friendly messages on how to address them instead of dumping stacks with sometimes non-existent messages.

              rhn-support-csutherl Coty Sutherland
              rhn-support-csutherl Coty Sutherland
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: