4 Replies Latest reply on Dec 15, 2015 11:13 PM by Jay SenSharma

    user.timezone setting in Wildfly 8.2.Final

    Arnab Ghosh Novice

      Hi All,

       

      I am trying to change the default timezone by setting user.timezone. I am passing it during server startup using standalone.sh as below:

      /wildfly/bin/standalone.sh --server-config=standalone-full.xml  -Dapp.hostname=$HOST -Duser.timezone=$TIMEZONE -P /config/aoma.properties >> /log/console.log 2>&1 &

       

      But this is not working.

      When I have adding it to standalone.conf in java_opts section, it is working as expected.

       

      Is this is the correct behavior or I am doing any mistake ?

       

      Regards

      Arnab

        • 1. Re: user.timezone setting in Wildfly 8.2.Final
          Jay SenSharma Master

          Hello Arnab,

           

              I have tested the same on "wildfly-8.2.1.Final" and i can see that it is working fine and the user.timezone is getting updated properly in the server log as well.   This is what i tried :

           

              Took a fresh "wildfly-8.2.1.Final"  and started it as following:

           

          $ ./standalone.sh -Duser.timezone=UTC
          
          

           

              And i can see that server.log has the following entry:

           

          sun.java.command = /PATH/TO/wildfly-8.2.1.Final/jboss-modules.jar -mp /PATH/TO/wildfly-8.2.1.Final/modules org.jboss.as.standalone -Djboss.home.dir=/PATH/TO/wildfly-8.2.1.Final -Djboss.server.base.dir=/PATH/TO/wildfly-8.2.1.Final/standalone -Duser.timezone=UTC
          .
          .
          user.language = en
          user.name = jsensharma
          user.timezone = UTC
          

           

           

          Regards

          Jay SenSharma

          • 2. Re: user.timezone setting in Wildfly 8.2.Final
            Arnab Ghosh Novice

            I am using Wildfly 8.2.0.Final. But probably the version may not be the issue. Let me test few more things and get back

            • 3. Re: user.timezone setting in Wildfly 8.2.Final
              Arnab Ghosh Novice

              Jay,

               

              The same happens for me as well. I was able to see user.timezone set correct value via the cli, but there is no effect. The log shows time in default timezone of the VM and not the timezone I have set.

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

               

              But the moment I set it via the standalone.conf it takes effect. The only difference I see is in output of jinfo, the order in which the user.timezone and property appears. Not sure what is going on.

               

              Regards

              Arnab

              • 4. Re: user.timezone setting in Wildfly 8.2.Final
                Jay SenSharma Master

                Hello Arnab,

                 

                    I am testing on "/wildfly-8.2.1.Final"  and i can see that when i start the WildFly as following the value of user.timezone property is getting reflected properly.

                 

                Example:

                $ ./standalone.sh -Duser.timezone=UTC
                

                 

                 

                Running the CLI:

                [standalone@localhost:9990 /] /core-service=platform-mbean/type=runtime:read-attribute(name=system-properties)
                {
                    "outcome" => "success",
                    "result" => {
                        "[Standalone]" => "",
                        "awt.toolkit" => "sun.lwawt.macosx.LWCToolkit",
                        "file.encoding" => "UTF-8",
                        .
                        .
                        .
                        "user.dir" => "/PATH/TO/wildfly-8.2.1.Final/bin",
                        "user.home" => "/Users/jsensharma",
                        "user.language" => "en",
                        "user.name" => "jsensharma",
                        "user.timezone" => "UTC"
                    }
                }
                


                Notice:   "user.timezone" => "UTC" in the above Output.

                 

                So please check if you are connecting to the correct WildFly instance or not?

                 

                Regards

                Jay SenSharma