Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
2.0.0
-
None
-
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())
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).