[wildfly-dev] Widlfly 9.0.1.Final - subsystem expression evaluation not entirely water proof

Brian Stansberry brian.stansberry at redhat.com
Tue Aug 25 11:04:25 EDT 2015


This attribute does not support use of expressions, so any data you 
provide is evaluated simply as a string.

It doesn't support expressions because it is what we call a "model 
reference" attribute. It's value refers to another element in the 
configuration model. We do not allow expressions in those attributes 
because it is not possible to have all the necessary data to resolve the 
expression at the points in time when the correctness of the model must 
be validated.

On 8/25/15 9:31 AM, Dennis Brouwer wrote:
> Dear reader,
>
> We recently moved to Wildfly 9.0.1.Final (from 8.2.0) for testing and
> stumbled upon a bug regarding expression evaluation in the standalone*.xml.
>
> Let me give an example for the following subsystem:
>
> <subsystem xmlns="urn:jboss:domain:jgroups:3.0">
>      <channels default="ee">
>          <channel name="ee"/>
>      </channels>
>      ...
> </subsytem>
>
> Since we have several deployment stages on one physical server we need
> to separate the clusters by using a distinct name for each one of the
> stages deployed. Hence we introduced a startup property to be
> substituted in the standalone*.xml configuration like following snippet
> clarifies:
>
> <subsystem xmlns="urn:jboss:domain:jgroups:3.0">
>      <channels default="${custom_clustername:ee}">
>          <channel name="${custom_clustername:ee}"/>
>      </channels>
>      ...
> </subsytem>
>
> Using this approach however fails to start the container because the
> channels default attribute is properly evaluated to "ee" (accoding to
> specs). However the channel name attribute is not evaluated at all and
> is registered as "${custom_clustername:ee}" (without the quotes).
>
> I took the liberty to dig in the class:
> org.jboss.as.clustering.jgroups.subsystem.JGroupsSubsystemXMLReader and
> manually do the expression evaluation for the channel name. At first
> glance this seems to work however the container rewrites the
> standalone*.xml file at a certain moment resulting in this snippet:
>
> <subsystem xmlns="urn:jboss:domain:jgroups:3.0">
>      <channels default="${custom_clustername:ee}">
>          <channel name="ee"/>
>      </channels>
>      ...
> </subsytem>
>
> Which on subsequent container starts and when using the
> -Dcustom_clustername=whee startup property causes a problem because the
> channels default is evaluated to "whee" and the channel name remains "ee".
>
>
> So my questions are:
>
> 1] How to solve this issue in a correct way?
> 2] Can somebody provide another mechanism to configure a non default
> channel name on startup?
>
>
> --
> Best regards,
>
> *Dennis Brouwer*
> Extraordinary Goalkeeper
>
>
>
>
> ZEEF - Kizitos B.V.
> Amstelboulevard 184
> 1096 HM Amsterdam
> www.ZEEF.com <http://www.zeef.com/>
> US: +1 (415) 992-9409
> NL: +31 (085) 888-3186
>
>
> _______________________________________________
> wildfly-dev mailing list
> wildfly-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/wildfly-dev
>


-- 
Brian Stansberry
Senior Principal Software Engineer
JBoss by Red Hat


More information about the wildfly-dev mailing list