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

NPE caused Forum messages not searchable under server-client search config

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: CLOSED
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.7.1, 2.7.2, 2.8.2, 2.9.0
    • Fix Version/s: 2.8.3, 2.9.0
    • Component/s: Messages Tool
    • Labels:
      None
    • 2.9 Status:
      Resolved
    • Previous Issue Keys:
      MSGCNTR-691

      Description

      UMich have server-client mode for searching with 2.7 Forums tool. Whenever there is a match of Forum message for the search query, there will be the following NPE on the search server log:

      2012-07-24 16:05:57,386 [TP-Processor180] ERROR org.sakaiproject.search.component.service.impl.SearchListResponseImpl - Error Message found from remote search java.lang.NullPointerException
      at org.sakaiproject.component.app.messageforums.ui.UIPermissionsManagerImpl.getContextId(UIPermissionsManagerImpl.java:1386)
      at org.sakaiproject.component.app.messageforums.ui.UIPermissionsManagerImpl.isRead(UIPermissionsManagerImpl.java:515)
      at org.sakaiproject.component.app.messageforums.ui.UIPermissionsManagerImpl.isRead(UIPermissionsManagerImpl.java:511)
      at org.sakaiproject.component.app.messageforums.entity.MessageForumsEntityContentProducer.canRead(MessageForumsEntityContentProducer.java:167)
      at org.sakaiproject.search.filter.impl.SearchSecurityFilter.filter(SearchSecurityFilter.java:109)
      at org.sakaiproject.search.component.service.impl.SearchListImpl$1.next(SearchListImpl.java:109)
      at org.sakaiproject.search.component.service.impl.SearchListImpl$1.next(SearchListImpl.java:89)
      at org.sakaiproject.search.component.service.impl.BaseSearchServiceImpl.searchXML(BaseSearchServiceImpl.java:774)
      at org.sakaiproject.search.tool.RestSearchServlet.execute(RestSearchServlet.java:103)
      at org.sakaiproject.search.tool.RestSearchServlet.doPost(RestSearchServlet.java:77)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
      at org.sakaiproject.util.RequestFilter.doFilter(RequestFilter.java:658)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
      at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:581)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
      at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:200)
      at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:291)
      at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:775)
      at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:704)
      at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:897)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
      at java.lang.Thread.run(Thread.java:662)

      The line corresponding to the following:

      private String getContextId()
      {
      LOG.debug("getContextId()");
      if (TestUtil.isRunningTests())

      { return "test-context"; }

      Placement placement = toolManager.getCurrentPlacement();
      String presentSiteId = placement.getContext(); <-----line 1386
      return presentSiteId;
      }

      So the search was done on search server, which is different from the client server where user submitted the search query. Hence toolManager.getCurrentPlacement() will return null on the search server, since the user session/site is not valid on the search server.

      Need to get the site id in other ways.

        Gliffy Diagrams

          Zeplin

            Attachments

              Activity

                People

                Assignee:
                baholladay Bryan Holladay
                Reporter:
                arwhyte Anthony Whyte
                Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved:

                    Git Integration