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

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: No Release
    • Fix Version/s: 7.0.0.CR1
    • Component/s: Web
    • Labels:
      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.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                starksm64 Scott Stark
                Reporter:
                starksm64 Scott Stark
              • 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