Uploaded image for project: 'Red Hat Fuse'
  1. Red Hat Fuse
  2. ENTESB-2279

[user experience] command fabric:encrypt-message NullPointerException

    XMLWordPrintable

Details

    • % %

    Description

      If user tries to execute command encrypt-message in non-fabric fuse container, it prints NullPointerException as response.
      I think there are better ways to to tell user that this command works only in fabric enviroment (I'm guessing).

      Fabric8:karaf@root> encrypt-message **********
      Error executing command: java.lang.NullPointerException
      

      log:tail output:

      2014-12-09 09:51:04,075 | ERROR | l Console Thread | Console                          | ?                                   ? | 28 - org.apache.karaf.shell.console - 2.4.0.redhat-620046 | Exception caught while executing command
      java.lang.NullPointerException
              at io.fabric8.zookeeper.utils.ZooKeeperUtils.exists(ZooKeeperUtils.java:277)
              at io.fabric8.commands.EncryptAction.doExecute(EncryptAction.java:56)
              at org.apache.karaf.shell.console.AbstractAction.execute(AbstractAction.java:33)
              at org.apache.felix.gogo.commands.basic.AbstractCommand.execute(AbstractCommand.java:35)
              at sun.reflect.GeneratedMethodAccessor27.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.7.0_72]
              at java.lang.reflect.Method.invoke(Method.java:606)[:1.7.0_72]
              at org.apache.aries.proxy.impl.ProxyHandler$1.invoke(ProxyHandler.java:54)[18:org.apache.aries.proxy.impl:1.0.4]
              at org.apache.aries.proxy.impl.ProxyHandler.invoke(ProxyHandler.java:119)[18:org.apache.aries.proxy.impl:1.0.4]
              at io.fabric8.commands.$Encrypt1285246167.execute(Unknown Source)[mvn:org.apache.aries.proxy/org.apache.aries.proxy.impl/1.0.4:]
              at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:78)[28:org.apache.karaf.shell.console:2.4.0.redhat-620046]
              at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:477)[28:org.apache.karaf.shell.console:2.4.0.redhat-620046]
              at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:403)[28:org.apache.karaf.shell.console:2.4.0.redhat-620046]
              at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)[28:org.apache.karaf.shell.console:2.4.0.redhat-620046]
              at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)[28:org.apache.karaf.shell.console:2.4.0.redhat-620046]
              at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)[28:org.apache.karaf.shell.console:2.4.0.redhat-620046]
              at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:92)[28:org.apache.karaf.shell.console:2.4.0.redhat-620046]
              at org.apache.karaf.shell.console.jline.Console.run(Console.java:196)[28:org.apache.karaf.shell.console:2.4.0.redhat-620046]
              at org.apache.karaf.shell.console.jline.DelayedStarted.run(DelayedStarted.java:79)[28:org.apache.karaf.shell.console:2.4.0.redhat-620046]
      

      Same command in fabric enviroment:

      Fabric8:karaf@root> fabric:encrypt-message *********
      Encrypting message admin
      Using algorithm PBEWithMD5AndDES and password ***
      Result: git/dKL6roQEAU7zhIhuFA==
      

      Also help message could be improved. It says:

      Fabric8:karaf@root> fabric:encrypt-message --help
      DESCRIPTION
              fabric:encrypt-message
      
              Encrypts a value using the configured algorithm and master password
      
      SYNTAX
              fabric:encrypt-message [options] message 
      
      ARGUMENTS
              message
                      The message to encrypt.
      
      OPTIONS
              -a, --alogrithm
                      The algorithm to use. (Defaults to the configured one).
              -p, --password
                      The password to use. (Defaults to the configured one).
              --help
                      Display this help message
      

      (Defaults to the configured one)
      Where can I configure this?
      What are allowed algorithms?
      Does it support only symmetric cryptography?

      Attachments

        Activity

          People

            yfang@redhat.com Freeman(Yue) Fang
            jludvice Josef Ludvicek (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: