Uploaded image for project: 'Pluto'
  1. Pluto
  2. PLUTO-238

Wrapping RenderResponse causes ClassCastException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Won't Fix
    • 1.0.1
    • unspecified
    • portlet container
    • None

    Description

      I have a portlet that is attempting to wrap the RenderResponse to capture data written to the PrintWriter or OutputStream to do some more advanced caching. It appears that pluto depends on the implementation of the RenderResponse that is passed into the PortletRequestDispatcher. I don't think this is required by the portlet specification as the portlet request/response objects are defined by interfaces implying the implementation should not matter. The stack trace I get is:

      java.lang.ClassCastException: edu.wisc.my.portlet.caching.support.CachingRenderResponse
      at org.apache.pluto.core.CoreUtils.getInternalResponse(CoreUtils.java:46)
      at org.apache.pluto.core.impl.PortletRequestDispatcherImpl.include(PortletRequestDispatcherImpl.java:45)
      at org.springframework.web.portlet.DispatcherPortlet.render(DispatcherPortlet.java:948)
      at edu.wisc.my.portlet.caching.CacheManagingDispatcherPortlet.render(CacheManagingDispatcherPortlet.java:209)
      at org.springframework.web.portlet.DispatcherPortlet.doRenderService(DispatcherPortlet.java:726)
      at edu.wisc.my.portlet.caching.CacheManagingDispatcherPortlet.doRenderService(CacheManagingDispatcherPortlet.java:179)
      at org.springframework.web.portlet.FrameworkPortlet.processRequest(FrameworkPortlet.java:420)
      at org.springframework.web.portlet.FrameworkPortlet.doDispatch(FrameworkPortlet.java:391)
      at javax.portlet.GenericPortlet.render(GenericPortlet.java:178)
      at org.apache.pluto.core.PortletServlet.dispatch(PortletServlet.java:205)
      at org.apache.pluto.core.PortletServlet.doGet(PortletServlet.java:145)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
      at org.apache.pluto.core.PortletServlet.service(PortletServlet.java:140)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
      at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:574)
      at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:499)
      at org.apache.pluto.invoker.impl.PortletInvokerImpl.invoke(PortletInvokerImpl.java:120)
      at org.apache.pluto.invoker.impl.PortletInvokerImpl.render(PortletInvokerImpl.java:73)
      at org.apache.pluto.PortletContainerImpl.renderPortlet(PortletContainerImpl.java:105)
      at org.jasig.portal.channels.portlet.CPortletAdapter.getMarkup(CPortletAdapter.java:690)
      at org.jasig.portal.channels.portlet.CPortletAdapter.renderCharacters(CPortletAdapter.java:593)
      at org.jasig.portal.MultithreadedCharacterChannelAdapter.renderCharacters(MultithreadedCharacterChannelAdapter.java:41)
      at org.jasig.portal.ChannelRenderer$Worker.execute(ChannelRenderer.java:603)
      at org.jasig.portal.utils.threading.BaseTask.run(BaseTask.java:27)
      at edu.emory.mathcs.backport.java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:431)
      at edu.emory.mathcs.backport.java.util.concurrent.FutureTask.run(FutureTask.java:166)
      at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:643)
      at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:668)
      at java.lang.Thread.run(Thread.java:595)

      Attachments

        1. CacheManagingDispatcherPortlet.java
          12 kB
          Eric Dalquist
        2. CachingHttpServletResponse.java
          4 kB
          Eric Dalquist
        3. PLUTO238-01.patch
          10 kB
          Elliot Metsger

        Activity

          People

            emetsger Elliot Metsger
            edalquist Eric Dalquist
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: