Foros de discusión

ClassCastException when navigating with RichFaces Libraries included

PortletFaces Community Member, modificado hace 12 años.

ClassCastException when navigating with RichFaces Libraries included

Regular Member Mensajes: 199 Fecha de incorporación: 3/04/12 Mensajes recientes
Hi,

I have a simple example of JSF navigation with a rule:

<h:commandLink action="#{workflowBean.loadWorkflow}">
<h:outputText value="navigate now" />
</h:commandLink>

The workflowBean call returns "processlist_workorder"; faces-config.xml contains:

<navigation-rule>
<navigation-case>
<from-outcome>processlist_workorder</from-outcome>
<to-view-id>/workorder.xhtml</to-view-id>
</navigation-case>
</navigation-rule>

Running this example works fine on Liferay 6.0.6 / Tomcat 6.0.29 with just jsf-2.0.6, jsf-facelets-1.1.15.B1 and portletfaces-bridge-2.0.0 .
Clicking the link navigates fine to workorder.xhtml.

But, I need to use RichFaces in this environment. Just by adding the RichFaces Jars richfaces-components-api-4.0.0.Final, richfaces-components-ui-4.0.0.Final, richfaces-core-api-4.0.0.Final and richfaces-core-impl-4.0.0.Final to WEB-INF/lib this example fails (not even using RichFaces on the pages). The result of clicking on the link is:

Servlet.service() for servlet demonavigation threw exception
org.portletfaces.bridge.BridgeException: java.lang.ClassCastException: org.richfaces.context.SkinningExternalContextFactory$ExternalContextWrapperImpl cannot be cast to org.portletfaces.bridge.context.ExternalContextImpl
at BridgeImpl.java.doFacesRequest(BridgeImpl.java:438)
at org.portletfaces.bridge.GenericFacesPortlet.doView(GenericFacesPortlet.java:181)
at javax.portlet.GenericPortlet.doDispatch(GenericPortlet.java:328)
at javax.portlet.GenericPortlet.render(GenericPortlet.java:233)
at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:101)
at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:64)
at com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:92)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:551)
at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:488)
at com.liferay.portlet.InvokerPortletImpl.invoke(InvokerPortletImpl.java:638)
at com.liferay.portlet.InvokerPortletImpl.invokeRender(InvokerPortletImpl.java:723)
at com.liferay.portlet.InvokerPortletImpl.render(InvokerPortletImpl.java:425)
at org.apache.jsp.html.portal.render_005fportlet_jsp._jspService(render_005fportlet_jsp.java:1440)

Is there anything I can do to get this to work?
Thank you!
thumbnail
Neil Griffin, modificado hace 12 años.

RE: ClassCastException when navigating with RichFaces Libraries included

Liferay Legend Mensajes: 2655 Fecha de incorporación: 27/07/05 Mensajes recientes
I just created issue FACES-254 in order to track this as a bug. Also I checked in a potential fix to BridgeImpl.java

My recommendation would be that you try the Sept 21 SNAPSHOT version of the bridge and let me know if it fixes the problem.