Tomcat - Locale difference with Console and Windows Service

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • maxt
    New Member
    • Nov 2006
    • 1

    Tomcat - Locale difference with Console and Windows Service

    I am using Windows XP, Tomcat 5.5.17, JRE 1.5.0_08. I am in Australia. For testing localization, my Windows Region is set to English, US.

    The Tomcat xml's are set to their install defaults.

    When using the Console, tomcat5.exe, my localization files work correctly, returning the Locale, en_US in the string str.

    When using Windows Services, the Locale string returned is en.AU with the same code and the Region still set to English, US.

    The code used is:
    Code:
    Locale currentLocale = Locale.getDefault();
    String str = currentLocale.toString();
    In the Services I am using a Classpath command: C:\Program Files\BMJ\Tomca t\bin\bootstrap .jar and Java Options:
    -Dcatalina.base= C:\Program Files\BMJ\Tomca t
    -Dcatalina.home= C:\Program Files\BMJ\Tomca t

    Any help explaining how to get the default Locale using Services would be appreciated. I do not want to set the Locale, but to get and apply my users default Locale using Services.

    The same applies to the use of the Robot class used for sending keystrokes. OK with Console, no response or error with Services.

    Thanks
    Max
  • siliq
    New Member
    • Mar 2007
    • 1

    #2
    Hi max
    I came across the same problem as you are.

    I cannot explain the underlying reason, but I could offer you a walk-around solution:

    add in:
    Code:
    -Duser.language=en
    -Duser.country=US
    as the Tomcat's Java parameters

    I hope this solution is helpful.

    Comment

    • Motoma
      Recognized Expert Specialist
      • Jan 2007
      • 3236

      #3
      Thanks for your response siliq. Welcome to theScripts!

      Comment

      • khadarbasha
        New Member
        • Jun 2007
        • 1

        #4
        Originally posted by siliq
        Hi max
        I came across the same problem as you are.

        I cannot explain the underlying reason, but I could offer you a walk-around solution:

        add in:
        Code:
        -Duser.language=en
        -Duser.country=US
        as the Tomcat's Java parameters

        I hope this solution is helpful.
        Hi Sliq,
        I was facing the same problem. it worked me too. thank you.

        Regards,
        Khadar.

        Comment

        • makinilla
          New Member
          • Jul 2007
          • 1

          #5
          Hi I have the same problem but i can not find the Java configurations file to change, can you help me?

          Thanks.

          Comment

          Working...