Uploaded image for project: 'Application Server 7'
  1. Application Server 7
  2. AS7-1159

Running commands from file in CLI without a connection fails with a hidden NullPointerException - Failed to execute batch: null

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 7.0.0.Beta1
    • 7.0.0.CR1
    • CLI
    • None
    • Workaround Exists
    • Hide

      Add --connect to the call to jboss-admin.sh to connect before the commands in the file are executed.

      Show
      Add --connect to the call to jboss-admin.sh to connect before the commands in the file are executed.

    Description

      The following NPE occurs if a file is executed without specifying to connect: -

      java.lang.NullPointerException
      at org.jboss.as.cli.handlers.batch.BatchRunHandler.doHandle(BatchRunHandler.java:82)
      at org.jboss.as.cli.handlers.CommandHandlerWithHelp.handle(CommandHandlerWithHelp.java:92)
      at org.jboss.as.cli.CommandLineMain.processLine(CommandLineMain.java:437)
      at org.jboss.as.cli.CommandLineMain.processFile(CommandLineMain.java:363)
      at org.jboss.as.cli.CommandLineMain.main(CommandLineMain.java:257)
      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:270)
      at org.jboss.modules.Main.main(Main.java:313)

      However the error that is reported to the end user is "Failed to execute batch: null"

      The following command from the CR1 distro will reproduce: -

      ./jboss-admin.sh --file=scripts/secure-standalone-mgmt.cli

      In addition to this it is not possible to specify the address of the native interface to connect to from the command line when using --file, if --connect is specified only the default host and port will be used.

      Attachments

        Activity

          People

            olubyans@redhat.com Alexey Loubyansky
            darran.lofthouse@redhat.com Darran Lofthouse
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: