XML structured variable not replaced

I have the following XML file on which I am trying to update the ss.host.name system property:

<server xmlns="urn:jboss:domain:3.0">
  <extensions>
    <extension module="org.jboss.as.clustering.infinispan" />
    <extension module="org.jboss.as.connector" />
    <extension module="org.jboss.as.deployment-scanner" />
    <extension module="org.jboss.as.ee" />
    <extension module="org.jboss.as.ejb3" />
    <extension module="org.jboss.as.jaxrs" />
    <extension module="org.jboss.as.jdr" />
    <extension module="org.jboss.as.jmx" />
    <extension module="org.jboss.as.jpa" />
    <extension module="org.jboss.as.jsf" />
    <extension module="org.jboss.as.logging" />
    <extension module="org.jboss.as.mail" />
    <extension module="org.jboss.as.naming" />
    <extension module="org.jboss.as.pojo" />
    <extension module="org.jboss.as.remoting" />
    <extension module="org.jboss.as.sar" />
    <extension module="org.jboss.as.security" />
    <extension module="org.jboss.as.transactions" />
    <extension module="org.jboss.as.webservices" />
    <extension module="org.jboss.as.weld" />
    <extension module="org.wildfly.extension.batch" />
    <extension module="org.wildfly.extension.bean-validation" />
    <extension module="org.wildfly.extension.io" />
    <extension module="org.wildfly.extension.request-controller" />
    <extension module="org.wildfly.extension.security.manager" />
    <extension module="org.wildfly.extension.undertow" />
  </extensions>
  <system-properties>
    <property name="ss.host.name" value="localhost" />
  </system-properties>
</server>

My variable is defined as:
/server/system-properties/property[@name='ss.host.name']/@value
with a value of my name, JUSTIN. If I plug this XPath and XML into an XPath tester, it works fine, but the value is never updated when I deploy my project.

The deployment log has this:
Structured variable replacement succeeded on file /home/Octopus/Applications/DEV/com.foo.bar%3Aapp-configuration/1.0.0-SNAPSHOT_3/standalone.xml with format Xml
so I know that it is actually performing the replacement, but the value of ss.host.name is always localhost, I cannot get it to substitute my variable.

Am I going crazy here? I’ve fought with this for about 3 hours now, trying every single dumb XPath trick I can think of and absolutely nothing is working for me.

Hi Justin,

Thanks for getting in touch! Certainly not crazy - I only just recently fought for a while getting an issue that looks identical working that might end up being relevant here.

When XML namespaces are involved, XPath provides a few different ways to select an element. So you could try using a wildcard namespace instead. I.e. change the variable from:

/server/system-properties/property[@name='ss.host.name']/@value

To this:

/*:server/*:system-properties/*:property[@name='ss.host.name']/@value

I hope that helps get this going. If that’s something you’ve already tried, let me know and I’ll be happy to dig into this one further. :slight_smile:

Best regards,

Kenny

Thanks Kenneth, that fixed it for me. I think I will open a ticket for this, because it definitely seems like a bug.

Hi Justin,

Thank for the update, and glad to hear that fixed it up. Octopus leans on XPath here, so we’re basically at the mercy of how that works.

Let us know if you have any questions or concerns moving forward!

Best regards,

Kenny

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.