Availability Selected Devices report (Jasper 6.3) return an error.
search cancel

Availability Selected Devices report (Jasper 6.3) return an error.

book

Article ID: 8123

calendar_today

Updated On:

Products

CA Spectrum

Issue/Introduction

The next error message is displayed when executing the report Availability Selected Devices

The error message is displayed, only if any of devices selected has Outages (availability < 100%)

<Please see attached file for image>

errormessage.jpg

 

Environment

CA Spectrum and Jasper Report 6.3 (Windows)

Cause

The cause of the problem is due the Windows Locale Settings on Jasper Server.

The report uses the en-US locale by default.

Error message in <CABI_ROOT_DIR>\apache-tomcat\webapps\jasperserver-pro\WEB-INF\logs\jasperserver.log is as follow:

2017-09-06 17:19:10,518 ERROR JRFillSubreport,pool-6-thread-1:866 - Fill 1: exception 
net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression for source text: String.valueOf((double) $V{v_dSeconds}*100/ (double) ($V{v_dSeconds}+$V{v_maintTime_Per}+$V{v_Chart_UpTime})) == "NaN" ? 0.00 : Double.parseDouble(new java.text.DecimalFormat("###.#####").format((double) $V{v_dSeconds}*100/ (double) ($V{v_dSeconds}+$V{v_maintTime_Per}+$V{v_Chart_UpTime}))) 
at net.sf.jasperreports.engine.fill.JREvaluator.evaluateEstimated(JREvaluator.java:352) 
at net.sf.jasperreports.engine.fill.JRCalculator.evaluateEstimated(JRCalculator.java:607) 
at net.sf.jasperreports.engine.fill.JRCalculator.estimateVariables(JRCalculator.java:208) 
at net.sf.jasperreports.engine.fill.JRFillDataset.next(JRFillDataset.java:1276) 
at net.sf.jasperreports.engine.fill.JRFillDataset.next(JRFillDataset.java:1250) 
at net.sf.jasperreports.engine.fill.JRBaseFiller.next(JRBaseFiller.java:1056) 
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:117) 
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:580) 
at net.sf.jasperreports.engine.fill.BaseReportFiller.fill(BaseReportFiller.java:396) 
at net.sf.jasperreports.engine.fill.JRFillSubreport.fillSubreport(JRFillSubreport.java:732) 
at net.sf.jasperreports.engine.fill.JRSubreportRunnable.run(JRSubreportRunnable.java:59) 
at net.sf.jasperreports.engine.fill.AbstractThreadSubreportRunner.run(AbstractThreadSubreportRunner.java:221) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) 
at java.lang.Thread.run(Unknown Source) 
Caused by: java.lang.NumberFormatException: For input string: "0,00056" 
at sun.misc.FloatingDecimal.readJavaFormatString(Unknown Source) 
at sun.misc.FloatingDecimal.parseDouble(Unknown Source) 
at java.lang.Double.parseDouble(Unknown Source) 
at Availability32Selected32Devices_1503511841241_557651.evaluateEstimated1(Availability32Selected32Devices_1503511841241_557651:3203) 
at Availability32Selected32Devices_1503511841241_557651.evaluateEstimated(Availability32Selected32Devices_1503511841241_557651:3184) 
at net.sf.jasperreports.engine.fill.JREvaluator.evaluateEstimated(JREvaluator.java:338) 
... 14 more 

The problem occurs due the Double.parseDouble expects a decimal with dot separator (en-US locale), but instead receive a decimal with (in this case) comma separator.

 

Resolution

To correct this problem, you may change the default locale to en-US on the Windows Server Operating System where the Jasper is running.

Fastest option is:

1. Start->Run: regedit

2. Click on Computer, and Select Edit->Find, and search by "LocaleName"

    The current key value should be any of listed (culture name column) in next URL: https://www.microsoft.com/resources/msdn/goglobal/default.mspx

3. Before to modify the key get a backup. Right click the Key Name, select Export. Once the backup is saved, double click LocaleName, and change it to en-US, and press Ok.

4. Repeat steps 2 and 3 until the search does not return results

5. Reboot the Server.

6. Java (Tomcat) will use the Locale of the Operating System (en-US), and this time the report will be executed without errors.

7. In case of a problem, you may restore the modified values in the registry using the backup files obtained in 3.

 

NOTE: There are other options documented to do the same (through GUI or Powershell), so please consult your Windows Server Administrator, before to proceed with the above recommendation.

 

Attachments

1558691237625000008123_sktwi1f5rjvs16gjk.jpeg get_app