Uploaded image for project: 'Application Server 7'
  1. Application Server 7
  2. AS7-5835

CLONE - application.xml does not support property replacement

XMLWordPrintable

    • Hide

      Make sure to set:

      <subsystem xmlns="urn:jboss:domain:ee:1.1">
      <spec-descriptor-property-replacement>
      true
      </spec-descriptor-property-replacement>
      <jboss-descriptor-property-replacement>
      true
      </jboss-descriptor-property-replacement>
      </subsystem>

      Attached is a test case. Deploy and access the URL
      It will show 'web-test' ${sysProp:'app-test'}

      indicating that substitution ins application.xml was not done.

      See application.xml:

      <env-entry>
      <env-entry-name>test</env-entry-name>
      <env-entry-type>java.lang.String</env-entry-type>
      <env-entry-value>${sysProp:'app-test'}</env-entry-value>
      </env-entry>

      in web.xml

      <context-param>
      <param-name>webtest</param-name>
      <param-value>${sysProp:'web-test'}</param-value>
      </context-param>

      I did some digging:

      org/jboss/metadata/parser/util/MetaDataElementParser.java:

      139 if (DescriptionGroupMetaDataParser.parse(reader, earMetaData.getDescriptionGroup()))

      { 140 return; 141 }

      142 if (EnvironmentRefsGroupMetaDataParser.parse(reader, earMetaData.getEarEnvironmentRefsGroup()))

      { 143 return; 144 }

      are not calling the parse method with the "propertyReplacer"

      Show
      Make sure to set: <subsystem xmlns="urn:jboss:domain:ee:1.1"> <spec-descriptor-property-replacement> true </spec-descriptor-property-replacement> <jboss-descriptor-property-replacement> true </jboss-descriptor-property-replacement> </subsystem> Attached is a test case. Deploy and access the URL It will show 'web-test' ${sysProp:'app-test'} indicating that substitution ins application.xml was not done. See application.xml: <env-entry> <env-entry-name>test</env-entry-name> <env-entry-type>java.lang.String</env-entry-type> <env-entry-value>${sysProp:'app-test'}</env-entry-value> </env-entry> in web.xml <context-param> <param-name>webtest</param-name> <param-value>${sysProp:'web-test'}</param-value> </context-param> I did some digging: org/jboss/metadata/parser/util/MetaDataElementParser.java: 139 if (DescriptionGroupMetaDataParser.parse(reader, earMetaData.getDescriptionGroup())) { 140 return; 141 } 142 if (EnvironmentRefsGroupMetaDataParser.parse(reader, earMetaData.getEarEnvironmentRefsGroup())) { 143 return; 144 } are not calling the parse method with the "propertyReplacer"

      Property substitution in application.xml does not work

              sdouglas1@redhat.com Stuart Douglas (Inactive)
              tfonteyn Tom Fonteyne (Inactive)
              Votes:
              1 Vote for this issue
              Watchers:
              9 Start watching this issue

                Created:
                Updated:
                Resolved: