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

External Tool in newly-duplicated site produces NullPointerException

    XMLWordPrintable

    Details

    • 19 status:
      Resolved
    • 12 status:
      Resolved
    • Test Plan:
      Hide

      Please add a Test Plan here.

      Show
      Please add a Test Plan here.

      Description

      To replicate as instructor:

      1) Create new course site
      2) Go to Site Info -> External Tools
      3) Install LTI 1.x Tool
      4) Use fake values and Save
      5) Tool Links -> Create Tool Link -> Add the tool to the site
      6) Site Info -> Duplicate Site
      7) Create new site "a1" and view site
      8) Go to the duplicated LTI tool

      24-Apr-2019 10:05:09.834 ERROR [http-nio-9080-exec-3] org.sakaiproject.portlets.SakaiIFrame.doView
      java.lang.NullPointerException
              at org.sakaiproject.portlets.SakaiIFrame.doView(SakaiIFrame.java:201)
              at javax.portlet.GenericPortlet.doDispatch(GenericPortlet.java:397)
              at javax.portlet.GenericPortlet.render(GenericPortlet.java:291)
              at org.apache.pluto.core.PortletServlet.dispatch(PortletServlet.java:208)
              at org.apache.pluto.core.PortletServlet.doGet(PortletServlet.java:139)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:634)
              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: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.doInclude(ApplicationDispatcher.java:580)
              at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:516)
              at org.apache.pluto.core.DefaultPortletInvokerService.invoke(DefaultPortletInvokerService.java:167)
              at org.apache.pluto.core.DefaultPortletInvokerService.render(DefaultPortletInvokerService.java:101)
              at org.apache.pluto.core.PortletContainerImpl.doRender(PortletContainerImpl.java:172)
              at org.sakaiproject.portal.render.portlet.PortletToolRenderService$Sakai168RenderResult.renderResponse(PortletToolRenderService.java:283)
              at org.sakaiproject.portal.render.portlet.PortletToolRenderService$Sakai168RenderResult.getContent(PortletToolRenderService.java:319)
              at org.sakaiproject.portal.charon.SkinnableCharonPortal.includeTool(SkinnableCharonPortal.java:761)
              at org.sakaiproject.portal.charon.SkinnableCharonPortal.includeTool(SkinnableCharonPortal.java:590)
              at org.sakaiproject.portal.charon.handlers.PageHandler.includePage(PageHandler.java:232)
              at org.sakaiproject.portal.charon.handlers.WorksiteHandler.includeWorksite(WorksiteHandler.java:202)
              at org.sakaiproject.portal.charon.handlers.SiteHandler.doSite(SiteHandler.java:551)
              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.SkinnableCharonPortal.doGet(SkinnableCharonPortal.java:856)
      

      The NPE happens because of this code:

      private Map<String, Object> patchContentItem(Long key, Placement placement)
          ...
          // Look up the tool associated with the Content Item
          // checking Authz to see is we can touch this tool
          String siteId = placement.getContext();
          Map<String, Object> tool = m_ltiService.getTool(tool_id, siteId);
          if ( tool == null ) return null;
      

      So the tool_id in the new course still refers to the tool_id in the old course. And this new course doesn't have permission to get the old tool so it returns a null

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  ottenhoff Sam Ottenhoff
                  Reporter:
                  ottenhoff Sam Ottenhoff
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Git Source Code