Uploaded image for project: 'Sakai'
  1. Sakai
  2. SAK-33137

Percentage based Grades Divide by Zero Exception

    XMLWordPrintable

    Details

    • Previous Issue Keys:
      GIT2-3477
    • Previous GIT issue:

      Description

      Steps to Reproduce:
      1. Create a new site with a new gradebook
      2. Make a Gradebook item
      3. Edit item to have 0 points

      4. Switch Gradebook to Percentage based Entry
      5. See The Glorious exception:

      org.apache.wicket.WicketRuntimeException: Can't instantiate page using constructor 'public org.sakaiproject.gradebookng.tool.pages.GradebookPage()'. An exception has been thrown during construction!
          at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:194)
          at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:67)
          at org.apache.wicket.DefaultMapperContext.newPageInstance(DefaultMapperContext.java:133)
          at org.apache.wicket.core.request.handler.PageProvider.resolvePageInstance(PageProvider.java:268)
          at org.apache.wicket.core.request.handler.PageProvider.getPageInstance(PageProvider.java:166)
          at org.apache.wicket.request.handler.render.PageRenderer.getPage(PageRenderer.java:78)
          at org.apache.wicket.request.handler.render.WebPageRenderer.renderPage(WebPageRenderer.java:117)
          at org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:229)
          at org.apache.wicket.core.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:175)
          at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:862)
          at org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
          at org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:261)
          at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:218)
          at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:289)
          at org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:259)
          at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:201)
          at org.apache.wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:137)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
          at org.sakaiproject.util.RequestFilter.doFilter(RequestFilter.java:411)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
          at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:720)
          at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:466)
          at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:358)
          at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:318)
          at org.sakaiproject.tool.impl.ActiveToolComponent$MyActiveTool.forward(ActiveToolComponent.java:513)
          at org.sakaiproject.portal.charon.SkinnableCharonPortal.forwardTool(SkinnableCharonPortal.java:1484)
          at org.sakaiproject.portal.charon.handlers.SiteHandler.doToolBuffer(SiteHandler.java:1154)
          at org.sakaiproject.portal.charon.handlers.SiteHandler.bufferContent(SiteHandler.java:1010)
          at org.sakaiproject.portal.charon.handlers.SiteHandler.doSite(SiteHandler.java:484)
          at org.sakaiproject.portal.charon.handlers.SiteHandler.doGet(SiteHandler.java:263)
          at org.sakaiproject.portal.charon.handlers.SiteHandler.doGet(SiteHandler.java:151)
          at org.sakaiproject.portal.charon.SkinnableCharonPortal.doGet(SkinnableCharonPortal.java:858)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
          at org.sakaiproject.util.RequestFilter.doFilter(RequestFilter.java:460)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
          at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
          at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
          at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:676)
          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:522)
          at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1095)
          at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672)
          at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2500)
          at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2489)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
          at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
          at java.lang.Thread.run(Thread.java:745)
      Caused by: java.lang.reflect.InvocationTargetException
          at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
          at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
          at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
          at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
          at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:175)
          ... 61 more
      Caused by: java.lang.ArithmeticException: Division undefined
          at java.math.BigDecimal.divide(BigDecimal.java:1741)
          at org.sakaiproject.component.gradebook.BaseHibernateManager.calculateEquivalentPercent(BaseHibernateManager.java:1330)
          at org.sakaiproject.component.gradebook.BaseHibernateManager.convertPointsToPercentage(BaseHibernateManager.java:1355)
          at org.sakaiproject.component.gradebook.GradebookServiceHibernateImpl.getGradesForStudentsForItem(GradebookServiceHibernateImpl.java:1816)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:498)
          at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302)
          at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
          at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
          at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
          at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)
          at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
          at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
          at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208)
          at com.sun.proxy.$Proxy46.getGradesForStudentsForItem(Unknown Source)
          at org.sakaiproject.gradebookng.business.GradebookNgBusinessService.buildGradeMatrix(GradebookNgBusinessService.java:776)
          at org.sakaiproject.gradebookng.business.GradebookNgBusinessService.buildGradeMatrix(GradebookNgBusinessService.java:612)
          at WICKET_org.sakaiproject.gradebookng.business.GradebookNgBusinessService$$FastClassByCGLIB$$86be4ca5.invoke(<generated>)
          at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
          at org.apache.wicket.proxy.LazyInitProxyFactory$CGLibInterceptor.intercept(LazyInitProxyFactory.java:333)
          at WICKET_org.sakaiproject.gradebookng.business.GradebookNgBusinessService$$EnhancerByCGLIB$$80032445.buildGradeMatrix(<generated>)
          at org.sakaiproject.gradebookng.tool.pages.GradebookPage.<init>(GradebookPage.java:212)
          ... 66 more
      

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  Unassigned
                  Reporter:
                  master-bob Leonardo Canessa (Inactive)
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Git Source Code