[jboss-jira] [JBoss JIRA] Closed: (AS7-893) web subsystem virtual-server is requiring an alias to succeed
Jason Greene (JIRA)
jira-events at lists.jboss.org
Mon Jun 13 16:20:23 EDT 2011
[ https://issues.jboss.org/browse/AS7-893?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jason Greene closed AS7-893.
----------------------------
Resolution: Done
> web subsystem virtual-server is requiring an alias to succeed
> -------------------------------------------------------------
>
> Key: AS7-893
> URL: https://issues.jboss.org/browse/AS7-893
> Project: Application Server 7
> Issue Type: Bug
> Components: Web
> Affects Versions: No Release
> Reporter: Scott Stark
> Assignee: Scott Stark
> Fix For: 7.0.0.CR1
>
> Original Estimate: 1 hour
> Remaining Estimate: 1 hour
>
> 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.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list