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

NullPointerException with sakai.iframe.annotatedurl tool

    Details

    • Type: Bug
    • Status: OPEN
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 11.4, 12.0
    • Fix Version/s: None
    • Component/s: Web Content
    • Labels:
      None
    • Test Plan:
      Hide
      • Login as Admin
      • Open Administration Worksite
      • Open Sites tool
      • Search for your existing site by site ID and open it
      • Add a new page
      • Add a new tool to the page
      • Select the sakai.iframe.annotatedurl tool
      • Save
      • Goto your site
      • Open the annotatedUrl tool
      • Nullpointer exception occurs
      Show
      Login as Admin Open Administration Worksite Open Sites tool Search for your existing site by site ID and open it Add a new page Add a new tool to the page Select the sakai.iframe.annotatedurl tool Save Goto your site Open the annotatedUrl tool Nullpointer exception occurs

      Description

      NullPointerException occurs with sakai.iframe.annotatedurl tool

       
      Debugging the code it looks like these lines are causing the failure:
       
      IFrameAction.java:393

      392:  String filePath = getServletConfig().getServletContext().getRealPath( ".."+localizedFile );
      393:  if ( (new File(filePath)).exists() )

       
       
      where filePath is being set to null, so the "new File(filePath)).exists()" throws the NPE.  I double checked 10.7 and that line returns a valid filepath.  Is there something in my config that I'm missing that causes filePath to be set to null?  Or is some change/bug in the .getRealPath()
       
      I can probably work around it by checking for null, but I was wondering why 10.7 vs 11.4 fails to set filePath.
       

      07-Dec-2017 13:45:43.228 WARN [ajp-bio-8009-exec-8] org.sakaiproject.portal.util.ErrorReporter.logAndMail Bug Report bug-id: 2fa04744-b013-4f47-aee7-f9a1c93c997f user: null usage-session: null time: Dec 7, 2017 13:45:43 user comment: null stack trace
      org.sakaiproject.portal.api.PortalHandlerException: java.lang.NullPointerException
          at org.sakaiproject.portal.charon.SkinnableCharonPortal.doGet(SkinnableCharonPortal.java:856)
      caused by: java.lang.NullPointerException
          at java.io.File.<init>(File.java:277)
          at org.sakaiproject.web.tool.IFrameAction.getLocalizedURL(IFrameAction.java:393)
          at org.sakaiproject.web.tool.IFrameAction.sourceUrl(IFrameAction.java:456)
          at org.sakaiproject.web.tool.IFrameAction.initState(IFrameAction.java:308)
          at org.sakaiproject.cheftool.VelocityPortletPaneledAction.initState(VelocityPortletPaneledAction.java:273)
          at org.sakaiproject.cheftool.ToolServlet.prepState(ToolServlet.java:498)
          at org.sakaiproject.cheftool.ToolServlet.doGet(ToolServlet.java:227)
          at org.sakaiproject.cheftool.VelocityPortletPaneledAction.doGet(VelocityPortletPaneledAction.java:1154)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
          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.ToolHandler.doTool(ToolHandler.java:204)
          at org.sakaiproject.portal.charon.handlers.ToolHandler.doGet(ToolHandler.java:100)
          at org.sakaiproject.portal.charon.SkinnableCharonPortal.doGet(SkinnableCharonPortal.java:856)
          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: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: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

          Attachments

            Activity

              People

              • Assignee:
                maintenanceteam Core Team
                Reporter:
                austinUH Austin
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Git Source Code