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

java.lang.ClassCastException reordering Announcements with count greater than the current 'show XX items'

    Details

    • 12 status:
      Resolved
    • 11 status:
      Resolved
    • Test Plan:
      Hide
      • create 11 announcements
      • ensure the default "show 10 items" drop down is selected
      • open the 'Reorder' tab
      • drag and drop an announcement to reorder it
      • click Update
      • the item on the page is reordered
      Show
      create 11 announcements ensure the default "show 10 items" drop down is selected open the 'Reorder' tab drag and drop an announcement to reorder it click Update the item on the page is reordered

      Description

      Steps

      • create 11 announcements
      • ensure the default "show 10 items" drop down is selected
      • open the 'Reorder' tab
      • drag and drop an announcement to reorder it
      • click Update
      • the item on the page is NOT reordered

      However, if you "reload" the tool in the main view as well as going back into the reorder tab, the order will be correct.

      The problem does NOT happen if the total number of announcements is less that the "show xx items" dropdown
      The problem does NOT happen in Sakai 11.3 and below

      Checking the logs there's an execption

      29-Sep-2017 12:07:31.745 WARN [ajp-bio-8009-exec-8] org.sakaiproject.cheftool.VelocityPortletPaneledAction.actionDispatch Exception calling method doReorderUpdate java.lang.reflect.InvocationTargetException (Caused by java.lang.ClassCastException: org.sakaiproject.announcement.impl.BaseAnnouncementService$BaseAnnouncementMessageEdit cannot be cast to org.sakaiproject.announcement.tool.AnnouncementAction$AnnouncementWrapper)
      java.lang.reflect.InvocationTargetException
      	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.sakaiproject.cheftool.VelocityPortletPaneledAction.actionDispatch(VelocityPortletPaneledAction.java:720)
      	at org.sakaiproject.cheftool.VelocityPortletPaneledAction.processAction(VelocityPortletPaneledAction.java:554)
      	at org.sakaiproject.cheftool.ToolServlet.doGet(ToolServlet.java:230)
      	at org.sakaiproject.cheftool.VelocityPortletPaneledAction.doGet(VelocityPortletPaneledAction.java:1154)
      	at org.sakaiproject.cheftool.ToolServlet.doPost(ToolServlet.java:154)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
      	at org.sakaiproject.vm.ComponentServlet.service(ComponentServlet.java:56)
      	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:716)
      	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:1485)
      	at org.sakaiproject.portal.charon.handlers.SiteHandler.doToolBuffer(SiteHandler.java:1189)
      	at org.sakaiproject.portal.charon.handlers.SiteHandler.bufferContent(SiteHandler.java:1023)
      	at org.sakaiproject.portal.charon.handlers.SiteHandler.doSite(SiteHandler.java:486)
      	at org.sakaiproject.portal.charon.handlers.SiteHandler.doGet(SiteHandler.java:265)
      	at org.sakaiproject.portal.charon.handlers.SiteHandler.doGet(SiteHandler.java:153)
      	at org.sakaiproject.portal.charon.handlers.WorksiteHandler.doPost(WorksiteHandler.java:71)
      	at org.sakaiproject.portal.charon.SkinnableCharonPortal.doPost(SkinnableCharonPortal.java:1161)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
      	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:94)
      	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504)
      	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.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620)
      	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
      	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:502)
      	at org.apache.coyote.ajp.AbstractAjpProcessor.process(AbstractAjpProcessor.java:877)
      	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:684)
      	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:283)
      	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:748)
      Caused by: java.lang.ClassCastException: org.sakaiproject.announcement.impl.BaseAnnouncementService$BaseAnnouncementMessageEdit cannot be cast to org.sakaiproject.announcement.tool.AnnouncementAction$AnnouncementWrapper
      	at org.sakaiproject.announcement.tool.AnnouncementComparator.compare(AnnouncementComparator.java:19)
      	at java.util.TimSort.countRunAndMakeAscending(TimSort.java:355)
      	at java.util.TimSort.sort(TimSort.java:234)
      	at java.util.Arrays.sort(Arrays.java:1512)
      	at java.util.Vector.sort(Vector.java:1319)
      	at java.util.Collections.sort(Collections.java:175)
      	at org.sakaiproject.util.SortedIterator.<init>(SortedIterator.java:60)
      	at org.sakaiproject.announcement.tool.AnnouncementAction.doReorderUpdate(AnnouncementAction.java:4531)
      	... 55 more
      

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  ncaidin Neal Caidin
                  Reporter:
                  austinUH Austin
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  5 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Git Source Code