8 Replies Latest reply on Jan 23, 2015 10:07 AM by rafachies

    System properties are not resolved in jboss eap 6.2

    bangalore09

      We are setting system properties via standalone.xml as -Dproperty=value option and we are trying to refer in xml as ${systemproperty}, which doesn't resolve at runtime.

       

      The parameters are seen from management console under the section Profile-->General Configuration-->System Properties

       

      These variable are accessible from java code as System.getProperty("property").

       

      Any help is highly appreciable.

       

      Thanks & Regards

        • 1. Re: System properties are not resolved in jboss eap 6.2
          johnlfox

          Not all XML values can be set using the ${property} syntax.  Use the ':read-resource-description' command from the CLI to interrogate the XML resource you are changing and verify that '"expressions-allowed" => true' is set for that attribute.  If it isn't, you can't use an expression. If it is set, post a little more of your XML so we can see what attribute you are trying to use this on.

          • 2. Re: System properties are not resolved in jboss eap 6.2
            wdfink

            If you use the interactive CLI shell command you can check each attribute whether it supports such properties use :read-resource-description and look for the expression-allowed flag

            • 3. Re: System properties are not resolved in jboss eap 6.2
              bangalore09

              [standalone@localhost:9999 /] /system-property=JAAS:read-resource-description

              {

                  "outcome" => "success",

                  "result" => {

                      "description" => "A system property to set on the server.",

                      "access-constraints" => {"sensitive" => {"system-property" => {"type" =>

              "core"}}},

                      "attributes" => {"value" => {

                          "type" => STRING,

                          "description" => "The value of the system property.",

                          "expressions-allowed" => true,

                          "nillable" => true,

                          "min-length" => 0L,

                          "max-length" => 2147483647L,

                          "access-type" => "read-write",

                          "storage" => "configuration",

                          "restart-required" => "no-services"

                      }},

                      "operations" => undefined,

                      "children" => {}

                  }

              }

               

              expressions-allowed present, but still not picking the value off ${JAAS}.

              • 4. Re: System properties are not resolved in jboss eap 6.2
                ctomc

                not on system property definition on place where you want to use it...

                • 5. Re: System properties are not resolved in jboss eap 6.2
                  bangalore09

                  I added parameters in standalone.bat as java parameters (-Dparam=value). And I am trying to use them in my ear file (application.xml) to set web context.

                   

                  After looking at forum, I added those params through jboss-cli tool under the sub-system system-parameters.

                   

                  I don't know in which sub-system to check or modify to update "expressions-allowed" tag.

                   

                  Please help me.

                  • 6. Re: System properties are not resolved in jboss eap 6.2
                    ricardinho_rio

                    Has anybody had any good solution on that? I am facing the same problem.

                    • 7. Re: System properties are not resolved in jboss eap 6.2
                      ctomc

                      so you want to use expression on your application description files (application.xml, web.xml,...) and annotations.

                       

                      for that you need to enable such capability in ee subsystem

                      set

                      <spec-descriptor-property-replacement>true</spec-descriptor-property-replacement>

                      <jboss-descriptor-property-replacement>true</jboss-descriptor-property-replacement>

                       

                      if you want also annotation replacement also enable annotation-property-replacement

                       

                      but for the last one i am not sure in what version is was added, i think it was 6.3 if not later.

                      • 8. Re: System properties are not resolved in jboss eap 6.2
                        rafachies

                        Do not pass this as a script parameter. Create the property through the Web Console in Configuration -> System Property.

                        Second options is though CLI: /system-property=my.key:add(value=myvalue)

                        Third option is editing the standlone.xml, including in the end of the file, before close </server>

                         

                            <system-properties>

                                <property name="my.key" value="myvalue"/>

                            </system-properties>