2 Replies Latest reply on Aug 3, 2011 3:25 AM by rasmeet

    Accessing properties defined through SystemPropertiesService

    karlkras

      Hopefully a pretty basic question.

      From my understanding I should be able to define properties in the properties-service.xml file of JBoss and modules running within the context of that server's instance should be able to reference them.

       

      I'm doing some testing using this but I'm not getting the results I'm expecting. I'm assuming it's because my understanding of the functionality might be "misplaced".

       

      I'd like to reference a property that I've defined in this file (under [jboss]/server/all/deploy) from a jsp... to demonstrate:

       

      properties-service.xml  :

       

        <mbean code="org.jboss.varia.property.SystemPropertiesService"

           name="jboss:type=Service,name=SystemProperties">

       

          <attribute name="Properties">

             my.property.approot=C:/xmldata

          </attribute>

       

        </mbean>

       

      and then in my jsp:

       

      <% System.out.println(System

              .getProperty("my.property.approot")); %>

       

      I'm finding that the getProperty call is returning null.

       

      Should this work this way or am I mistaken?

       

      thanks,

      Karl