4 Replies Latest reply on Sep 27, 2002 12:51 PM by Chris

    System Properties

    Chris Davis Newbie

      I'm porting a weblogic application to JBoss. I got everything port and running, but I can't figure out where/how to put system properties. IN weblogic, I place in the welogic.properties file, example:

      // my props
      java.system.property.krs.idls.elementDirectory=/usr/local/weblogic/content/elements
      java.system.property.krs.idls.soundDirectory=/usr/local/weblogic/content/sounds
      java.system.property.krs.idls.attachmentDirectory=/usr/local/weblogic/content/attachments
      java.system.property.krs.idls.chunkLoaderTempDirectory=/tmp
      java.system.property.krs.idls.ilsServer=devils.krsonline.com

      Where can I put these for JBoss (I'm using JBoss-2.4.4_Tomcat-4.0.1) and do they need to be in a diffrent format? I tried placing them in the jboss.properties file, but it didn't work. I also read in the documentation that jboss.properties is going to be removed from future version, so I'd like to know the right place to put them.

      Please help.


        • 1. Re: System Properties
          Adrian Brock Master

          It is considered a bad idea to use System properties.
          That is why jboss.properties has been deprecated.
          It's a bit like global variables in programs ;-)

          If they are part of the application, they should be
          env entries in ejb-jar.xml

          If they are for external services, the external service
          should be accessed through jndi and the configuration
          exposed for management using jmx where they can be
          dynamically configured.

          If you really need to use properties, add them to
          run.bat/run.sh like the xml parser properties.
          But this should be the exception rather than the rule.

          Regards,
          Adrian

          • 2. Re: System Properties
            John Wagg Newbie

            It maybe a bit late to re-open this question but I don't think I agree with warjort's response. I think there are valid reasons for having global variables available to an application. I agree it should be the exception rather than the rule but it is a valid thing to do. We are involved here in application production for multiple sites. There are things the application needs to know about the site it is installed on (log locations, logging levels and local configuration of the application in our case) it would be possible to include this in ejb-jar.xml's but we don't really want to produce jar's/ear's that are specific to one site. System properties are the way to do it. I suppose it's only a matter of emphasis.

            • 3. Re: System Properties
              John Wagg Newbie

              It maybe a bit late to re-open this question but I don't think I agree with warjort's response. I think there are valid reasons for having global variables available to an application. I agree it should be the exception rather than the rule but it is a valid thing to do. We are involved here in application production for multiple sites. There are things the application needs to know about the site it is installed on (log locations, logging levels and local configuration of the application in our case) it would be possible to include this in ejb-jar.xml's but we don't really want to produce jar's/ear's that are specific to one site. System properties are the way to do it. I suppose it's only a matter of emphasis.

              • 4. Re: System Properties
                Chris Newbie

                Hi Adrian

                I was going to use system properties to solve my problem, but thought maybe I should get ideas from you. I have a class that needs to establish whether it is running in a web container (Tomcat) or in a J2EE app server (JBOSS). I know that web containers support init() methods in servlets, but I don't know if there is a J2EE standard way of doing this from an app server?

                Any thoughts?

                Regards

                Chris