7 Replies Latest reply on Nov 26, 2009 1:16 AM by MJ CJ

    ClassCastException when using MyFacesGenericPortlet

    Jacob Boje Newbie

      We're about to upgrade our portal application from Portal 2.4 to 2.6. In the portlet.xml, the portlets uses the portlet-class org.apache.myfaces.portlet.MyFacesGenericPortlet

      We've tried with version 1.1.1 and 1.1.5 of MyFaces.

      When accessing the portal application we faces a ClassCastException when the MyFacesGenericPortlet attempts to get a handle to the FacesContext in the facesContext method:

      java.lang.ClassCastException: org.jboss.portal.portlet.impl.jsr168.api.PortletContextImpl

      It seems like that the PortletContextImpl is different in version 2.4 and 2.6 and that MyFacesGenericPortlet is unable to handle the 2.6 version. In fact there is a small difference in which package the PortletContextImpl is a part of:

      In 2.6 org.jboss.portal.portlet.impl.jsr168.api.PortletContextImpl
      In 2.4: org.jboss.portal.portlet.impl.jsr168.PortletContextImpl

      Does anyone know why MyFaces can't use the portlet context from Portal 2.6 and what we need to change to make it work?