Clarity Upgrade fails with java.lang.NumberFormatException
search cancel

Clarity Upgrade fails with java.lang.NumberFormatException

book

Article ID: 370760

calendar_today

Updated On:

Products

Clarity PPM On Premise Clarity PPM SaaS

Issue/Introduction

Clarity Upgrade fails with java.lang.NumberFormatException on reading database decimals: 

 

6/13/24 12:27 p. m. (Echo)   CA PPM upgrade from 16.2.0 to 16.2.2 detected.
6/13/24 12:27 p. m. (Echo)     
6/13/24 12:27 p. m. (MathTask) java.lang.NumberFormatException: For input string: "1,28"
6/13/24 12:27 p. m. (MathTask)     at java.base/jdk.internal.math.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:2054)
6/13/24 12:27 p. m. (MathTask)     at java.base/jdk.internal.math.FloatingDecimal.parseDouble(FloatingDecimal.java:110)
6/13/24 12:27 p. m. (MathTask)     at java.base/java.lang.Double.parseDouble(Double.java:651)
6/13/24 12:27 p. m. (MathTask)     at java.base/java.lang.Double.<init>(Double.java:733)
6/13/24 12:27 p. m. (MathTask)     at net.sf.antcontrib.math.Numeric.evaluate(Numeric.java:66)
6/13/24 12:27 p. m. (MathTask)     at net.sf.antcontrib.math.Math.multiply(Math.java:165)
6/13/24 12:27 p. m. (MathTask)     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
6/13/24 12:27 p. m. (MathTask)     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
6/13/24 12:27 p. m. (MathTask)     at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
6/13/24 12:27 p. m. (MathTask)     at java.base/java.lang.reflect.Method.invoke(Method.java:568)
org.apache.tools.ant.BuildException: java.lang.NullPointerException: Cannot invoke "Object.toString()" because "res" is null

Cause

On Premise PostgreSQL database using non English US locale

Resolution

  1. Stop the PostgreSQL services
  2. Update the postgres.conf file to have the below parameters instead of used locale:
    lc_messages = 'English_United States.1252'                                          # locale for system error message
                                                                                    # strings
    lc_monetary = 'English_United States.1252'                                          # locale for monetary formatting
    lc_numeric = 'English_United States.1252'                                             # locale for number formatting
    lc_time = 'English_United States.1252'                                                    # locale for time formatting
  3. Save, restart the services
  4. Connect to the database and check the below settings:
    SHOW LC_COLLATE
    show LC_CTYPE
    show LC_NUMERIC
  5. Should show the English US locale.
  6. Restart the upgrade 

Note: Broadcom Support recommends to always use English US locale when installing the PostgreSQL database