Issue 14036

Occurrence homepage gives oops when cube counts are 0

14036
Reporter: omeyn
Type: Bug
Summary: Occurrence homepage gives oops when cube counts are 0
Priority: Minor
Resolution: Fixed
Status: Closed
Created: 2013-09-24 13:33:07.176
Updated: 2017-10-06 16:00:11.192
Resolved: 2017-10-06 16:00:11.173
TimeOriginalEstimate: 60
TimeEstimate: 60
        
Description: Something on the page divides by 0. Set to minor because if we have 0 in the cubes, we are well into Ooops land.

ERROR [2013-09-24 13:28:19,122+0200] [http-8080-1] com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor: / by zero
java.lang.ArithmeticException: / by zero
        at java.math.BigDecimal.divideAndRound(BigDecimal.java:1424) ~[na:1.7.0_19]
        at java.math.BigDecimal.divide(BigDecimal.java:1398) ~[na:1.7.0_19]
        at freemarker.core.ArithmeticEngine$BigDecimalEngine.divide(ArithmeticEngine.java:190) ~[freemarker-2.3.19.jar:2.3.19]
        at freemarker.core.ArithmeticEngine$BigDecimalEngine.divide(ArithmeticEngine.java:172) ~[freemarker-2.3.19.jar:2.3.19]
        at freemarker.core.ArithmeticExpression._getAsTemplateModel(ArithmeticExpression.java:110) ~[freemarker-2.3.19.jar:2.3.19]
        at freemarker.core.Expression.getAsTemplateModel(Expression.java:89) ~[freemarker-2.3.19.jar:2.3.19]
        at freemarker.core.ParentheticalExpression._getAsTemplateModel(ParentheticalExpression.java:75) ~[freemarker-2.3.19.jar:2.3.19]
        at freemarker.core.Expression.getAsTemplateModel(Expression.java:89) ~[freemarker-2.3.19.jar:2.3.19]
        at freemarker.core.BuiltIn$stringBI._getAsTemplateModel(BuiltIn.java:408) ~[freemarker-2.3.19.jar:2.3.19]
        at freemarker.core.Expression.getAsTemplateModel(Expression.java:89) ~[freemarker-2.3.19.jar:2.3.19]
        at freemarker.core.MethodCall._getAsTemplateModel(MethodCall.java:86) ~[freemarker-2.3.19.jar:2.3.19]
        at freemarker.core.Expression.getAsTemplateModel(Expression.java:89) ~[freemarker-2.3.19.jar:2.3.19]
        at freemarker.core.Expression.getStringValue(Expression.java:93) ~[freemarker-2.3.19.jar:2.3.19]
        at freemarker.core.DollarVariable.accept(DollarVariable.java:76) ~[freemarker-2.3.19.jar:2.3.19]
        at freemarker.core.Environment.visit(Environment.java:221) ~[freemarker-2.3.19.jar:2.3.19]
        at freemarker.core.MixedContent.accept(MixedContent.java:92) ~[freemarker-2.3.19.jar:2.3.19]
        at freemarker.core.Environment.visit(Environment.java:221) ~[freemarker-2.3.19.jar:2.3.19]
        at freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:79) ~[freemarker-2.3.19.jar:2.3.19]
        at freemarker.core.Environment.visit(Environment.java:221) ~[freemarker-2.3.19.jar:2.3.19]
        at freemarker.core.IteratorBlock$Context.runLoop(IteratorBlock.java:167) ~[freemarker-2.3.19.jar:2.3.19]
        at freemarker.core.Environment.visit(Environment.java:428) ~[freemarker-2.3.19.jar:2.3.19]
        at freemarker.core.IteratorBlock.accept(IteratorBlock.java:102) ~[freemarker-2.3.19.jar:2.3.19]
        at freemarker.core.Environment.visit(Environment.java:221) ~[freemarker-2.3.19.jar:2.3.19]
        at freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:79) ~[freemarker-2.3.19.jar:2.3.19]
        at freemarker.core.Environment.visit(Environment.java:221) ~[freemarker-2.3.19.jar:2.3.19]
        at freemarker.core.MixedContent.accept(MixedContent.java:92) ~[freemarker-2.3.19.jar:2.3.19]
        at freemarker.core.Environment.visit(Environment.java:221) ~[freemarker-2.3.19.jar:2.3.19]
        at freemarker.core.Environment.process(Environment.java:199) ~[freemarker-2.3.19.jar:2.3.19]
        at freemarker.template.Template.process(Template.java:259) ~[freemarker-2.3.19.jar:2.3.19]
        at org.apache.struts2.views.freemarker.FreemarkerResult.doExecute(FreemarkerResult.java:215) ~[struts2-core-2.3.14.jar:2.3.14]
        at org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:186) ~[struts2-core-2.3.14.jar:2.3.14]
        at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:371) [xwork-core-2.3.14.jar:2.3.14]
        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:275) [xwork-core-2.3.14.jar:2.3.14]
        at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:256) ~[struts2-core-2.3.14.jar:2.3.14]
        at com.google.inject.struts2.Struts2Factory$ProvidedInterceptor.intercept(Struts2Factory.java:215) [guice-struts2-3.0.jar:na]
        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) [xwork-core-2.3.14.jar:2.3.14]
]]>