-
Bug
-
Resolution: Done
-
Major
-
No Release
-
None
-
Workaround Exists
-
-
Low
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))
return NO_ALIASES;
}
An operation like this one input:
{
"operation" => "add",
"address" => [
("subsystem" => "web"),
("virtual-server" => "localhost")
],
"enable-welcome-root" => false,
"operation-headers" =>
}
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.