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

web subsystem virtual-server is requiring an alias to succeed

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 7.0.0.CR1
    • No Release
    • Web
    • None

    Description

      A web subsystem fragment like the following:

      <subsystem xmlns="urn:jboss:domain:web:1.0">
      <connector name="http" scheme="http" protocol="HTTP/1.1" socket-binding="http"/>
      <virtual-server name="localhost" enable-welcome-root="false" />
      </subsystem>

      fails with to execute with an IllegalArgumentException because of how the ALIAS attribute is handled. The org.jboss.as.web.WebVirtualHostAdd.aliases method is requiring an ALIAS if the node has one, but it is not checking if it is actually defined:

      static String[] aliases(final ModelNode node) {
      if(node.has(Constants.ALIAS))

      { final ModelNode aliases = node.require(Constants.ALIAS); final int size = aliases.asInt(); final String[] array = new String[size]; for(int i = 0; i < size; i ++) array[i] = aliases.get(i).asString(); return array; }

      return NO_ALIASES;
      }

      An operation like this one input:

      {
      "operation" => "add",
      "address" => [
      ("subsystem" => "web"),
      ("virtual-server" => "localhost")
      ],
      "enable-welcome-root" => false,
      "operation-headers" =>

      {"rollback-on-runtime-failure" => false}
      }

      is seen as the following with an alias with an undefined value by the aliases method:
      {
      "operation" => "add",
      "address" => [
      ("subsystem" => "web"),
      ("virtual-server" => "localhost")
      ],
      "enable-welcome-root" => false,
      "operation-headers" => {"rollback-on-runtime-failure" => false}

      ,
      "alias" => undefined,
      "access-log" => undefined,
      "rewrite" => undefined,
      "default-web-module" => undefined
      }

      so the node.require(Constants.ALIAS) call fails.

      Attachments

        Activity

          People

            starksm64 Scott Stark (Inactive)
            starksm64 Scott Stark (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 1 hour
                1h
                Remaining:
                Remaining Estimate - 1 hour
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified