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

Attachments can't be removed from assessment questions

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: CLOSED
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 19.0, 20.0
    • Fix Version/s: 19.0, 20.0
    • Labels:
      None
    • 19 status:
      Resolved
    • Test Plan:
      Hide

      1 Add an attachment to a question and save it.

      2 Edit the question, remove the attachment and save it.

      3 Check if the attachment is still there.

      Show
      1 Add an attachment to a question and save it. 2 Edit the question, remove the attachment and save it. 3 Check if the attachment is still there.

      Description

      Attachments are not being removed from Samigo questions, it seems the content is deleted but the link isn't. This is the related stack trace:

       

      26-Oct-2018 03:48:51.931 WARN [http-nio-20013-exec-17] org.sakaiproject.tool.assessment.facade.ItemFacadeQueries.saveItems saveitems - problem save or update itemdata: Removing a detached instance org.sakaiproject.tool.assessment.data.dao.assessment.ItemAttachment#2
      26-Oct-2018 03:48:51.932 WARN [http-nio-20013-exec-17] org.sakaiproject.tool.assessment.services.PersistenceHelper.retryDeadlock Error saving to db...retry again....
      26-Oct-2018 03:48:51.932 WARN [http-nio-20013-exec-17] org.sakaiproject.tool.assessment.services.PersistenceHelper.retryDeadlock Removing a detached instance org.sakaiproject.tool.assessment.data.dao.assessment.ItemAttachment#2
      26-Oct-2018 03:48:51.958 ERROR [http-nio-20013-exec-17] org.sakaiproject.tool.assessment.services.ItemService.saveItem Removing a detached instance org.sakaiproject.tool.assessment.data.dao.assessment.ItemAttachment#2
      java.lang.IllegalArgumentException: Removing a detached instance org.sakaiproject.tool.assessment.data.dao.assessment.ItemAttachment#2
      	at org.hibernate.jpa.event.internal.core.JpaDeleteEventListener.performDetachedEntityDeletionCheck(JpaDeleteEventListener.java:69)
      	at org.hibernate.event.internal.DefaultDeleteEventListener.onDelete(DefaultDeleteEventListener.java:106)
      	at org.hibernate.internal.SessionImpl.fireDelete(SessionImpl.java:965)
      	at org.hibernate.internal.SessionImpl.delete(SessionImpl.java:909)
      	at org.hibernate.engine.internal.Cascade.deleteOrphans(Cascade.java:437)
      	at org.hibernate.engine.internal.Cascade.cascadeCollectionElements(Cascade.java:410)
      	at org.hibernate.engine.internal.Cascade.cascadeCollection(Cascade.java:319)
      	at org.hibernate.engine.internal.Cascade.cascadeAssociation(Cascade.java:296)
      	at org.hibernate.engine.internal.Cascade.cascadeProperty(Cascade.java:161)
      	at org.hibernate.engine.internal.Cascade.cascade(Cascade.java:118)
      	at org.hibernate.event.internal.AbstractFlushingEventListener.cascadeOnFlush(AbstractFlushingEventListener.java:167)
      	at org.hibernate.event.internal.AbstractFlushingEventListener.prepareEntityFlushes(AbstractFlushingEventListener.java:158)
      	at org.hibernate.event.internal.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:91)
      	at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:55)
      	at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1258)
      	at org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:425)
      	at org.hibernate.engine.transaction.internal.jdbc.JdbcTransaction.beforeTransactionCommit(JdbcTransaction.java:101)
      	at org.hibernate.engine.transaction.spi.AbstractTransactionImpl.commit(AbstractTransactionImpl.java:177)
      	at org.springframework.orm.hibernate4.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:584)
      	at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:765)
      	at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:734)
      	at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:518)
      	at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:292)
      	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:213)
      	at com.sun.proxy.$Proxy152.saveItem(Unknown Source)
      	at org.sakaiproject.tool.assessment.services.ItemService.saveItem(ItemService.java:209)
      	at org.sakaiproject.tool.assessment.ui.listener.author.ItemAddListener.saveItem(ItemAddListener.java:1084)
      	at org.sakaiproject.tool.assessment.ui.listener.author.ItemAddListener.processAction(ItemAddListener.java:331)
      	at javax.faces.event.ActionEvent.processListener(ActionEvent.java:96)
      	at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:839)
      	at javax.faces.component.UICommand.broadcast(UICommand.java:315)
      	at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:870)
      	at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1418)
      	at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
      	at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
      	at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:201)
      	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:670)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      	at com.corejsf.UploadFilter.doFilter(UploadFilter.java:109)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      	at org.sakaiproject.util.RequestFilter.doFilter(RequestFilter.java:426)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:712)
      	at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:459)
      	at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:384)
      	at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:312)
      	at org.sakaiproject.jsf.util.SamigoJsfTool.dispatch(SamigoJsfTool.java:360)
      	at org.sakaiproject.jsf2.util.JsfTool.doPost(JsfTool.java:250)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:660)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:712)
      	at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:459)
      	at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:352)
      	at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:312)
      	at org.sakaiproject.tool.impl.ActiveToolComponent$MyActiveTool.forward(ActiveToolComponent.java:513)
      	at org.sakaiproject.portal.charon.SkinnableCharonPortal.forwardTool(SkinnableCharonPortal.java:1487)
      	at org.sakaiproject.portal.charon.handlers.SiteHandler.doToolBuffer(SiteHandler.java:1228)
      	at org.sakaiproject.portal.charon.handlers.SiteHandler.bufferContent(SiteHandler.java:1062)
      	at org.sakaiproject.portal.charon.handlers.SiteHandler.doSite(SiteHandler.java:491)
      	at org.sakaiproject.portal.charon.handlers.SiteHandler.doGet(SiteHandler.java:267)
      	at org.sakaiproject.portal.charon.handlers.SiteHandler.doGet(SiteHandler.java:155)
      	at org.sakaiproject.portal.charon.handlers.WorksiteHandler.doPost(WorksiteHandler.java:69)
      	at org.sakaiproject.portal.charon.SkinnableCharonPortal.doPost(SkinnableCharonPortal.java:1171)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:660)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      	at org.sakaiproject.util.RequestFilter.doFilter(RequestFilter.java:475)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
      	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
      	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:491)
      	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
      	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
      	at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:685)
      	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
      	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
      	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408)
      	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
      	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:764)
      	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1388)
      	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      	at java.lang.Thread.run(Thread.java:748)
      

        Gliffy Diagrams

          Zeplin

            Attachments

              Issue Links

                Activity

                  People

                  Assignee:
                  bergarvi Bernardo Garcia Vila
                  Reporter:
                  bergarvi Bernardo Garcia Vila
                  Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                    Dates

                    Created:
                    Updated:
                    Resolved:

                      Git Integration