Pluto
  1. Pluto
  2. PLUTO-463

java.lang.ClassCastException: org.apache.pluto.internal.impl.PortletSessionImpl with Pluto 2.0 and Jetty

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0
    • Fix Version/s: 2.0.0
    • Component/s: portlet container
    • Labels:
      None
    • Environment:
      Pluto 2.0 trunk, Jetty 6.1.7, jdk 1.5.0_14

      Description

      I'm trying to create an embedded version of pluto 2.0 using Jetty, and I've encountered this error:

      java.lang.ClassCastException: org.apache.pluto.internal.impl.PortletSessionImpl
      at org.mortbay.jetty.servlet.AbstractSessionManager.access(AbstractSessionManager.java:106)
      at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:162)
      at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:726)
      at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
      at org.mortbay.jetty.servlet.Dispatcher.include(Dispatcher.java:192)
      at org.apache.pluto.internal.impl.PortletRequestDispatcherImpl.internalInclude(PortletRequestDispatcherImpl.java:178)
      at org.apache.pluto.internal.impl.PortletRequestDispatcherImpl.include(PortletRequestDispatcherImpl.java:127)

      The same setup used to work with pluto 1.1.4, and it appears that a change in org.apache.pluto.internal.impl.PortletRequestImpl is the reason for the error. In 1.1.4, the method getHttpSession() was not overridden, but in 2.0 it is overriden like this:

      @Override
      public HttpSession getSession() {
      if (isIncluded() || isForwarded())

      { PortletSession session = getPortletSession(); return (HttpSession)session; }

      return super.getSession();
      }

      And aparently, the HttpSession instance that is returned by getPortletSession() is not compatible with the internal HttpSession type that Jetty expects (org.mortbay.jetty.servlet.AbstractSessionManager.access(AbstractSessionManager.java:106).

        Activity

        Hide
        Ate Douma added a comment -

        PortletSession no longer implements ServletSession

        Show
        Ate Douma added a comment - PortletSession no longer implements ServletSession

          People

          • Assignee:
            Unassigned
            Reporter:
            Nils-Helge Garli
          • Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development