Uploaded image for project: 'Apache Roller'
  1. Apache Roller
  2. ROL-1102

NPE in CommentServlet.doGet(CommentServlet.java:52)

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.2
    • Fix Version/s: 2.3
    • Component/s: Comments
    • Labels:
      None

      Description

      In the meantime I've deleted some old blogs and blog-entries and get the NPE below.

      I think with the following patch I will avoid the NPE, but I'm not sure if this is the correct way for roller.
      How can I better verify the following patch? What must the "old style" comment request look like?

      Index: C:/eclipse31t/wikispace/roller2/src/org/roller/presentation/velocity/CommentServlet.java
      ===================================================================
      — C:/eclipse31t/wikispace/roller2/src/org/roller/presentation/velocity/CommentServlet.java (revision 371404)
      +++ C:/eclipse31t/wikispace/roller2/src/org/roller/presentation/velocity/CommentServlet.java (working copy)
      @@ -49,6 +49,10 @@

      // calculate the location of the requested permalink
      RollerRequest rreq = RollerRequest.getRollerRequest(request);
      + if (rreq == null)

      { + response.sendError(HttpServletResponse.SC_NOT_FOUND); + return; + }

      WeblogEntryData entry = rreq.getWeblogEntry();
      if (entry != null)

      { forward += entry.getPermaLink(); @@ -68,6 +72,7 @@ // send an HTTP 301 response response.setStatus(response.SC_MOVED_PERMANENTLY); response.setHeader("Location", forward); + }

      ERROR 2006-03-31 07:25:17,144 StandardWrapperValve:invoke - Servlet.service() for servlet CommentsServlet threw exception
      java.lang.NullPointerException
      at org.roller.presentation.velocity.CommentServlet.doGet(CommentServlet.java:52)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.roller.presentation.filters.PersistenceSessionFilter.doFilter(PersistenceSessionFilter.java:43)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:292)
      at org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:108)
      at org.acegisecurity.intercept.web.SecurityEnforcementFilter.doFilter(SecurityEnforcementFilter.java:197)
      at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303)
      at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:143)
      at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303)
      at org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:50)
      at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303)
      at org.acegisecurity.securechannel.ChannelProcessingFilter.doFilter(ChannelProcessingFilter.java:168)
      at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303)
      at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:154)
      at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303)
      at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:246)
      at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303)
      at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:220)
      at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303)
      at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:173)
      at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:120)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.roller.presentation.filters.SchemeEnforcementFilter.doFilter(SchemeEnforcementFilter.java:104)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.roller.presentation.filters.CharEncodingFilter.doFilter(CharEncodingFilter.java:94)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
      at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
      at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
      at java.lang.Thread.run(Thread.java:595)

        Attachments

          Activity

            People

            • Assignee:
              djohnson David Johnson
              Reporter:
              axelclk Axel Kramer
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: