Uploaded image for project: 'Forge'
  1. Forge
  2. FORGE-2529

Creating commands with multi steps is a pain with repeated calls

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: Major Major
    • 3.x Future
    • 2.20.1.Final
    • None
    • None

      I think you guys are aware of the surprise you have as a forge addon developer that you get repeated calls for next() / execute() / initializeUI() that you do not expected, and can't seem to grasp the order they are called.

      And here I am speaking when a command implements UIWizard.

      If something goes wrong you can end up with a stacktrace and exception message that does not give you much clue how to fix.

      16:33:22,214 SEVERE [org.jboss.forge.addon.shell.aesh.CommandAdapter] (AeshProcess: 3) Controller cannot be executed: java.lang.IllegalArgumentException: Controller cannot be executed
      	at org.jboss.forge.furnace.util.Assert.isTrue(Assert.java:36) [furnace-api-2.22.7.Final.jar:2.22.7.Final]
      	at org.jboss.forge.addon.ui.impl.controller.WizardCommandControllerImpl.execute(WizardCommandControllerImpl.java:129) [ui-impl-2.20.1.Final.jar:2.20.1.Final]
      	at org.jboss.forge.addon.ui.impl.controller.NoUIWizardControllerDecorator.execute(NoUIWizardControllerDecorator.java:152) [ui-impl-2.20.1.Final.jar:2.20.1.Final]
      	at org.jboss.forge.addon.shell.aesh.CommandAdapter.execute(CommandAdapter.java:98) [shell-impl-2.20.1.Final.jar:2.20.1.Final]
      	at org.jboss.forge.addon.shell.aesh.ForgeCommandContainer.executeCommand(ForgeCommandContainer.java:90) [shell-impl-2.20.1.Final.jar:2.20.1.Final]
      	at org.jboss.aesh.console.AeshConsoleImpl$AeshConsoleCallbackImpl.execute(AeshConsoleImpl.java:311) [aesh-0.65.1.jar:0.65.1]
      	at org.jboss.aesh.console.AeshProcess.run(AeshProcess.java:53) [aesh-0.65.1.jar:0.65.1]
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_45]
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_45]
      	at java.lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_45]
      

      In past experience I have seen this kind of exception if an exception was thrown in the initializeUI method that sometimes neither is logged in the forge log. So it can take some trail and error to fix.

      Anyway just wanted to share that if there is something that can enhance that exception above to give the addon developer a chance to know what was wrong and what he/she can do to fix it.

              Unassigned Unassigned
              cibsen@redhat.com Claus Ibsen
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: