3 Replies Latest reply on Dec 3, 2012 4:02 AM by Wolf-Dieter Fink

    Defining a jboss.server.base.dir doesn't really work

    lups Newbie

      Hi all,

      I'm using JBoss AS 7.1.1 and trying to use a standalone server outside of the JBOSS_HOME "standalone" subdirectory.

       

      To do this, I can't find a howto, so I tried these steps :

      • I copy the C:\My Program Files\jboss\jboss-as-7.1.1.Final\standalone directory in my working environment : C:\Myenv\standalone
      • I execute these lines :

      set JBOSS_HOME=C:\My Program Files\jboss\jboss-as-7.1.1.Final

      set JBOSS_BASE_DIR=C:\Myenv\standalone

      set PATH=%JBOSS_HOME%\bin;%PATH%

      standalone.bat

       

      This doesn't work, do to https://issues.jboss.org/browse/AS7-3800, so I changed last line to

      standalone.bat -Djboss.server.base.dir="%JBOSS_BASE_DIR%"

       

      This time, JBoss starts without error.

       

      However, I think that this simple configuration is still incorrect :

      • The add-user script do not change my C:\Myenv\standalone\configuration\mgmt-users.properties, but my C:\My Program Files\jboss\jboss-as-7.1.1.Final\standalone\configuration\mgmt-users.properties !
      • I also tried (with same failure) :

           add-user -Djboss.server.base.dir="%JBOSS_BASE_DIR%"

      • The jboss-cli command

           /core-service=platform-mbean/type=runtime:read-attribute(name=system-properties)

      reports some references to %JBOSS_HOME%\standalone instead of %JBOSS_BASE_DIR%, as shown in this extract (jboss.server.* are correct but logging.configuration and org.jboss.boot.log.file are invalid) :

       

      "jboss.server.base.dir" => "C:\\Myenv\\standalone",

              "jboss.server.config.dir" => "C:\\Myenv\\standalone\\configuration",

              "jboss.server.data.dir" => "C:\\Myenv\\standalone\\data",

              "jboss.server.default.config" => "standalone.xml",

              "jboss.server.deploy.dir" => "C:\\Myenv\\standalone\\data\\content",

              "jboss.server.log.dir" => "C:\\Myenv\\standalone\\log",

              "jboss.server.name" => "xxxxxx",

              "jboss.server.temp.dir" => "C:\\Myenv\\standalone\\tmp",

              "line.separator" => "

      ",

              "logging.configuration" => "file:C:\\My Program Files\\jboss\\jboss-as-7.1.1.Final\\standalone/configuration/logging.properties",

              "module.path" => "C:\\My Program Files\\jboss\\jboss-as-7.1.1.Final\\modules",

              "org.jboss.boot.log.file" => "C:\\My Program Files\\jboss\\jboss-as-7.1.1.Final\\standalone\\log\\boot.log",

       

      How do you recommand to configure JBoss to have a dedicated standalone server outside of the Jboss install directory ?

       

      Regards,

      Bernard

        • 1. Re: Defining a jboss.server.base.dir doesn't really work
          James Perkins Master

          You should be able to set the JBOSS_BASE_DIR evironment variable in the standalone.conf.bat file.

           

          set "JBOSS_BASE_DIR=C:\Myenv\standalone"
          

           

          --

          James R. Perkins

          1 of 1 people found this helpful
          • 2. Re: Defining a jboss.server.base.dir doesn't really work
            lups Newbie

            Thank you James for your answer. This solves the jboss-cli problem.

             

            However, the add-user.bat script still works with properties file in C:\My Program Files\jboss\jboss-as-7.1.1.Final\standalone\configuration (and not with those in C:\Myenv\standalone\configuration) :

             

            C:\Windows\System32>add-user
            
            What type of user do you wish to add?
             a) Management User (mgmt-users.properties)
             b) Application User (application-users.properties)
            (a):
            
            Enter the details of the new user to add.
            Realm (ManagementRealm) :
            Username : admin
            Password :
            Re-enter Password :
            The username 'admin' is easy to guess
            Are you sure you want to add user 'admin' yes/no? y
            About to add user 'admin' for realm 'ManagementRealm'
            Is this correct yes/no? y
            Added user 'admin' to file 'C:\My Program Files\jboss\jboss-as-7.1.1.Final\standalone\configuration\mgmt-users.properties'
            Added user 'admin' to file 'C:\My Program Files\jboss\jboss-as-7.1.1.Final\domain\configuration\mgmt-users.properties'
            Appuyez sur une touche pour continuer...
            
            C:\Windows\System32>
            

             

            So, users added with add-user script cannot be used to connect to JBoss console.

             

            The easy workarround is to copy mgmt-users.properties from C:\My Program Files\jboss\jboss-as-7.1.1.Final\standalone to C:\Myenv\standalone\configuration.

            But I think that add-user script should take care of the jboss base dir configuration...

             

            Bernard

            • 3. Re: Defining a jboss.server.base.dir doesn't really work
              Wolf-Dieter Fink Master

              With AS7.1.1 the add-user does not support this.

              If you use AS7.2 you can add 'add-user.... -sc c:\Myenv\standalone\configuration'

              I'm not sure whether it works with ' ' in the path as your original 'My Progam Files' is

              1 of 1 people found this helpful