4 Replies Latest reply on Dec 6, 2002 5:25 PM by tbauer

    URGENT: How do I get variable values from the application en

    tbauer

      Dear Friends,

      I have a Jboss/Mysql application that will be installed on a few servers (each running for a specific US time zone). I want to be able to set some timezone specific attributes in one of the configuration XML files, and then read the value of those variables from my java code. Could someone please send tell me, or send me a code snippet that shows me how to get the attribute values from the environment....thanks a bunch....tim tbauer@mac.com

        • 1. Re: URGENT: How do I get variable values from the applicatio

          For an URGENT request you are a little thin on details but... ;)

          I am assumming 3.x ...

          In the server/default/deploy directory there is a file called properties-service.xml. At the bottom of that file you will find the system properties service. You should see the following commented out element:



          my.project.property=This is the value of my property
          my.project.anotherProperty=This is the value of my other property



          Uncomment this section and add your property values.

          After the service is redeployed, these properties are now accessable via System.getProperty(...) method calls

          HTH

          • 2. Re: URGENT: How do I get variable values from the applicatio
            tbauer

            >> For an URGENT request you are a little thin on details but... ;

            Well, despite my "thin" details you suggestion definitely helped point me in the right direction...I read the file you suggested and it actually had a comment indicating that I should put my properties in another file:

            /server/default/conf/jboss-service.xml

            which I did...and yes, thank you, it works perfectly...

            thanks a million...

            • 3. Re: URGENT: How do I get variable values from the applicatio

              Sorry for the comment!!!! It sounded funny when I typed it.

              What version are you using? I don't see any such note in my files. I am still using 3.0.0.

              Thanks
              Jim

              • 4. Re: URGENT: How do I get variable values from the applicatio
                tbauer

                Jim, I'm using 3.0.3..on Mac OSX 10.2.2 with MySQL 3.23.53.

                Inside the properties_service.xml file down near where the system properties service is commented out, there's a comment that read:

                <!-- Allows rich access to system properties. This now lives in
                the conf/jboss-service.xml descriptor by default in the default
                and all configurations.

                in other words: /server/default/conf/jboss-service.xml

                thanks again...cheers, tim