You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Fernando Silva Lozano (JIRA)" <de...@myfaces.apache.org> on 2009/11/04 02:05:49 UTC

[jira] Created: (MYFACES-2395) Cant' run two JSF portlets on the same portal page

Cant' run two JSF portlets on the same portal page
--------------------------------------------------

                 Key: MYFACES-2395
                 URL: https://issues.apache.org/jira/browse/MYFACES-2395
             Project: MyFaces Core
          Issue Type: Bug
          Components: Portlet_Support
         Environment: JDK 1.5, JBoss AS 4.2.3, eXo PC 2.0.5 or eXO WCM 1.0 or eXO WCM 1.2
            Reporter: Fernando Silva Lozano


Running two portlets in the same portal page, using JSF and the MyFaces Portlet Bridge (which is the RI for JSR-301, the JSF Portlet Bridge)  yelds the error bellow for the second portlet:

19:31:39,704 ERROR [portletcontainer] exception returned by processAction() or render() methods
javax.portlet.PortletException: doBridgeDispatch failed:  error from Bridge in executing the request
     at javax.portlet.faces.GenericFacesPortlet.doBridgeDispatch(GenericFacesPortlet.java:504)
     at javax.portlet.faces.GenericFacesPortlet.doRenderDispatchInternal(GenericFacesPortlet.java:456)
     at javax.portlet.faces.GenericFacesPortlet.doView(GenericFacesPortlet.java:231)
     at javax.portlet.GenericPortlet.doDispatch(GenericPortlet.java:354)
     at javax.portlet.faces.GenericFacesPortlet.doDispatch(GenericFacesPortlet.java:202)
     at javax.portlet.GenericPortlet.render(GenericPortlet.java:259)
     at org.exoplatform.services.portletcontainer.plugins.pc.aop.PortletMethodCommand.render(PortletMethod Command.java:62)
    at org.exoplatform.services.portletcontainer.plugins.pc.aop.BaseCommandUnit.execute(BaseCommandUnit.java:46)
...
 Caused by: javax.portlet.faces.BridgeException: java.lang.ClassCastException: org.apache.myfaces.renderkit.RenderKitFactoryImpl
     at org.apache.myfaces.portlet.faces.bridge.BridgeImpl.doFacesRender(BridgeImpl.java:654)
     at org.apache.myfaces.portlet.faces.bridge.BridgeImpl.doFacesRequest(BridgeImpl.java:544)
     at javax.portlet.faces.GenericFacesPortlet.doBridgeDispatch(GenericFacesPortlet.java:501)
     ... 63 more
Caused by: java.lang.ClassCastException: org.apache.myfaces.renderkit.RenderKitFactoryImpl
     at org.apache.myfaces.shared_impl.renderkit.RendererUtils.getResponseStateManager(RendererUtils.java: 1158)
     at org.apache.myfaces.lifecycle.DefaultRestoreViewSupport.isPostback(DefaultRestoreViewSupport.java:127)
     at org.apache.myfaces.lifecycle.RestoreViewExecutor.execute(RestoreViewExecutor.java:80)
     at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:103)
     at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:76)
     at org.apache.myfaces.portlet.faces.bridge.BridgeImpl.doFacesRender(BridgeImpl.java:640)
     ... 65 more


This exception allways happen with the second portlet on the page, whichever it is. I tried with many portlets, but so you can reproduce the problem I'm attaching the wars for two very simple portlets.

I'm filling this under MyFaces Core instead of Portlet Bridge because the same applications, if deployed to use Mojarra (included in JBoss AS 4.2) and the same portelt bridge jars, work fine.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Reopened: (MYFACES-2395) Cant' run two JSF portlets on the same portal page

Posted by "Fernando Silva Lozano (JIRA)" <de...@myfaces.apache.org>.
     [ https://issues.apache.org/jira/browse/MYFACES-2395?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Fernando Silva Lozano reopened MYFACES-2395:
--------------------------------------------


I don't think this is a problem related to classpath. Maybe you was too quick in dismissing this bug. Do you have any evidence this isactually a classpath problem? Because my evidence tells it isn't.

JBoss supports the use of alternative JSF implementations, provided inside the application WAR package. See that my both test apps include, on web.xml 

<context-param>
    <param-name>org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL</param-name>
    <param-value>true</param-value>
</context-param>

If you do that, JBoss bundled Mojarra is not visible inside the web app classloader.

The jboss logs show that the MyFaces classes are being initialized for both apps. And the error stack traces does not includes any Mojarra classes, only MyFaces, eXo, Tomcat and JBoss AS ones, as expected.

By the way other portal software don't support MyFaces, telling it won't work inside portlets without giving details. For example, Oracle iAS uses MyFaces as the bundled JSF implementation, but Oracle Portal states you have to use the Sun RI instead of MyFaces.

I guess this is the issue behind supporting MyFaces on portlets, because everything I tried worked as long as there where only one JSF portlet on the same portal page. But nothing works when there are more than one, if I do use MyFaces.


> Cant' run two JSF portlets on the same portal page
> --------------------------------------------------
>
>                 Key: MYFACES-2395
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2395
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: Portlet_Support
>         Environment: JDK 1.5, JBoss AS 4.2.3, eXo PC 2.0.5 or eXO WCM 1.0 or eXO WCM 1.2
>            Reporter: Fernando Silva Lozano
>            Assignee: Leonardo Uribe
>         Attachments: hora-mundo-jsf.war, todo-jsf.war
>
>
> Running two portlets in the same portal page, using JSF and the MyFaces Portlet Bridge (which is the RI for JSR-301, the JSF Portlet Bridge)  yelds the error bellow for the second portlet:
> 19:31:39,704 ERROR [portletcontainer] exception returned by processAction() or render() methods
> javax.portlet.PortletException: doBridgeDispatch failed:  error from Bridge in executing the request
>      at javax.portlet.faces.GenericFacesPortlet.doBridgeDispatch(GenericFacesPortlet.java:504)
>      at javax.portlet.faces.GenericFacesPortlet.doRenderDispatchInternal(GenericFacesPortlet.java:456)
>      at javax.portlet.faces.GenericFacesPortlet.doView(GenericFacesPortlet.java:231)
>      at javax.portlet.GenericPortlet.doDispatch(GenericPortlet.java:354)
>      at javax.portlet.faces.GenericFacesPortlet.doDispatch(GenericFacesPortlet.java:202)
>      at javax.portlet.GenericPortlet.render(GenericPortlet.java:259)
>      at org.exoplatform.services.portletcontainer.plugins.pc.aop.PortletMethodCommand.render(PortletMethod Command.java:62)
>     at org.exoplatform.services.portletcontainer.plugins.pc.aop.BaseCommandUnit.execute(BaseCommandUnit.java:46)
> ...
>  Caused by: javax.portlet.faces.BridgeException: java.lang.ClassCastException: org.apache.myfaces.renderkit.RenderKitFactoryImpl
>      at org.apache.myfaces.portlet.faces.bridge.BridgeImpl.doFacesRender(BridgeImpl.java:654)
>      at org.apache.myfaces.portlet.faces.bridge.BridgeImpl.doFacesRequest(BridgeImpl.java:544)
>      at javax.portlet.faces.GenericFacesPortlet.doBridgeDispatch(GenericFacesPortlet.java:501)
>      ... 63 more
> Caused by: java.lang.ClassCastException: org.apache.myfaces.renderkit.RenderKitFactoryImpl
>      at org.apache.myfaces.shared_impl.renderkit.RendererUtils.getResponseStateManager(RendererUtils.java: 1158)
>      at org.apache.myfaces.lifecycle.DefaultRestoreViewSupport.isPostback(DefaultRestoreViewSupport.java:127)
>      at org.apache.myfaces.lifecycle.RestoreViewExecutor.execute(RestoreViewExecutor.java:80)
>      at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:103)
>      at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:76)
>      at org.apache.myfaces.portlet.faces.bridge.BridgeImpl.doFacesRender(BridgeImpl.java:640)
>      ... 65 more
> This exception allways happen with the second portlet on the page, whichever it is. I tried with many portlets, but so you can reproduce the problem I'm attaching the wars for two very simple portlets.
> I'm filling this under MyFaces Core instead of Portlet Bridge because the same applications, if deployed to use Mojarra (included in JBoss AS 4.2) and the same portelt bridge jars, work fine.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (MYFACES-2395) Cant' run two JSF portlets on the same portal page

Posted by "Leonardo Uribe (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/MYFACES-2395?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12873797#action_12873797 ] 

Leonardo Uribe commented on MYFACES-2395:
-----------------------------------------

Note the param:

org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL

just prevent init RI but does not remove from the classpath (but that's enought for most applications).

> Cant' run two JSF portlets on the same portal page
> --------------------------------------------------
>
>                 Key: MYFACES-2395
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2395
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: Portlet_Support
>         Environment: JDK 1.5, JBoss AS 4.2.3, eXo PC 2.0.5 or eXO WCM 1.0 or eXO WCM 1.2
>            Reporter: Fernando Silva Lozano
>            Assignee: Leonardo Uribe
>         Attachments: hora-mundo-jsf.war, todo-jsf.war
>
>
> Running two portlets in the same portal page, using JSF and the MyFaces Portlet Bridge (which is the RI for JSR-301, the JSF Portlet Bridge)  yelds the error bellow for the second portlet:
> 19:31:39,704 ERROR [portletcontainer] exception returned by processAction() or render() methods
> javax.portlet.PortletException: doBridgeDispatch failed:  error from Bridge in executing the request
>      at javax.portlet.faces.GenericFacesPortlet.doBridgeDispatch(GenericFacesPortlet.java:504)
>      at javax.portlet.faces.GenericFacesPortlet.doRenderDispatchInternal(GenericFacesPortlet.java:456)
>      at javax.portlet.faces.GenericFacesPortlet.doView(GenericFacesPortlet.java:231)
>      at javax.portlet.GenericPortlet.doDispatch(GenericPortlet.java:354)
>      at javax.portlet.faces.GenericFacesPortlet.doDispatch(GenericFacesPortlet.java:202)
>      at javax.portlet.GenericPortlet.render(GenericPortlet.java:259)
>      at org.exoplatform.services.portletcontainer.plugins.pc.aop.PortletMethodCommand.render(PortletMethod Command.java:62)
>     at org.exoplatform.services.portletcontainer.plugins.pc.aop.BaseCommandUnit.execute(BaseCommandUnit.java:46)
> ...
>  Caused by: javax.portlet.faces.BridgeException: java.lang.ClassCastException: org.apache.myfaces.renderkit.RenderKitFactoryImpl
>      at org.apache.myfaces.portlet.faces.bridge.BridgeImpl.doFacesRender(BridgeImpl.java:654)
>      at org.apache.myfaces.portlet.faces.bridge.BridgeImpl.doFacesRequest(BridgeImpl.java:544)
>      at javax.portlet.faces.GenericFacesPortlet.doBridgeDispatch(GenericFacesPortlet.java:501)
>      ... 63 more
> Caused by: java.lang.ClassCastException: org.apache.myfaces.renderkit.RenderKitFactoryImpl
>      at org.apache.myfaces.shared_impl.renderkit.RendererUtils.getResponseStateManager(RendererUtils.java: 1158)
>      at org.apache.myfaces.lifecycle.DefaultRestoreViewSupport.isPostback(DefaultRestoreViewSupport.java:127)
>      at org.apache.myfaces.lifecycle.RestoreViewExecutor.execute(RestoreViewExecutor.java:80)
>      at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:103)
>      at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:76)
>      at org.apache.myfaces.portlet.faces.bridge.BridgeImpl.doFacesRender(BridgeImpl.java:640)
>      ... 65 more
> This exception allways happen with the second portlet on the page, whichever it is. I tried with many portlets, but so you can reproduce the problem I'm attaching the wars for two very simple portlets.
> I'm filling this under MyFaces Core instead of Portlet Bridge because the same applications, if deployed to use Mojarra (included in JBoss AS 4.2) and the same portelt bridge jars, work fine.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (MYFACES-2395) Cant' run two JSF portlets on the same portal page

Posted by "Leonardo Uribe (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/MYFACES-2395?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12873796#action_12873796 ] 

Leonardo Uribe commented on MYFACES-2395:
-----------------------------------------

Both portlet wars has myfaces on its WEB-INF/lib folder. The problem here is the classpath should be the same for all portlets, so in fact in this case we have two myfaces impls on the same classpath. The stack trace shows it:

java.lang.ClassCastException: org.apache.myfaces.renderkit.RenderKitFactoryImpl 

Now take a look at:

org.apache.myfaces.shared_impl.renderkit.RendererUtils.getResponseStateManager(RendererUtils.java: 1158) 

Says this:

            RenderKitFactory factory = (RenderKitFactory) requestMap.get(RENDER_KIT_IMPL);

The only way this could happen is if other portlet has already set this param before. The failure is seen when the second portlet is rendered.

Note the param:



> Cant' run two JSF portlets on the same portal page
> --------------------------------------------------
>
>                 Key: MYFACES-2395
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2395
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: Portlet_Support
>         Environment: JDK 1.5, JBoss AS 4.2.3, eXo PC 2.0.5 or eXO WCM 1.0 or eXO WCM 1.2
>            Reporter: Fernando Silva Lozano
>            Assignee: Leonardo Uribe
>         Attachments: hora-mundo-jsf.war, todo-jsf.war
>
>
> Running two portlets in the same portal page, using JSF and the MyFaces Portlet Bridge (which is the RI for JSR-301, the JSF Portlet Bridge)  yelds the error bellow for the second portlet:
> 19:31:39,704 ERROR [portletcontainer] exception returned by processAction() or render() methods
> javax.portlet.PortletException: doBridgeDispatch failed:  error from Bridge in executing the request
>      at javax.portlet.faces.GenericFacesPortlet.doBridgeDispatch(GenericFacesPortlet.java:504)
>      at javax.portlet.faces.GenericFacesPortlet.doRenderDispatchInternal(GenericFacesPortlet.java:456)
>      at javax.portlet.faces.GenericFacesPortlet.doView(GenericFacesPortlet.java:231)
>      at javax.portlet.GenericPortlet.doDispatch(GenericPortlet.java:354)
>      at javax.portlet.faces.GenericFacesPortlet.doDispatch(GenericFacesPortlet.java:202)
>      at javax.portlet.GenericPortlet.render(GenericPortlet.java:259)
>      at org.exoplatform.services.portletcontainer.plugins.pc.aop.PortletMethodCommand.render(PortletMethod Command.java:62)
>     at org.exoplatform.services.portletcontainer.plugins.pc.aop.BaseCommandUnit.execute(BaseCommandUnit.java:46)
> ...
>  Caused by: javax.portlet.faces.BridgeException: java.lang.ClassCastException: org.apache.myfaces.renderkit.RenderKitFactoryImpl
>      at org.apache.myfaces.portlet.faces.bridge.BridgeImpl.doFacesRender(BridgeImpl.java:654)
>      at org.apache.myfaces.portlet.faces.bridge.BridgeImpl.doFacesRequest(BridgeImpl.java:544)
>      at javax.portlet.faces.GenericFacesPortlet.doBridgeDispatch(GenericFacesPortlet.java:501)
>      ... 63 more
> Caused by: java.lang.ClassCastException: org.apache.myfaces.renderkit.RenderKitFactoryImpl
>      at org.apache.myfaces.shared_impl.renderkit.RendererUtils.getResponseStateManager(RendererUtils.java: 1158)
>      at org.apache.myfaces.lifecycle.DefaultRestoreViewSupport.isPostback(DefaultRestoreViewSupport.java:127)
>      at org.apache.myfaces.lifecycle.RestoreViewExecutor.execute(RestoreViewExecutor.java:80)
>      at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:103)
>      at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:76)
>      at org.apache.myfaces.portlet.faces.bridge.BridgeImpl.doFacesRender(BridgeImpl.java:640)
>      ... 65 more
> This exception allways happen with the second portlet on the page, whichever it is. I tried with many portlets, but so you can reproduce the problem I'm attaching the wars for two very simple portlets.
> I'm filling this under MyFaces Core instead of Portlet Bridge because the same applications, if deployed to use Mojarra (included in JBoss AS 4.2) and the same portelt bridge jars, work fine.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (MYFACES-2395) Cant' run two JSF portlets on the same portal page

Posted by "Fernando Silva Lozano (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/MYFACES-2395?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12873809#action_12873809 ] 

Fernando Silva Lozano commented on MYFACES-2395:
------------------------------------------------

How can all portlets need to have the same classpath, if by the spec each package (WAR file) has its own classloader?

If you are correct I cannot have, on the same portal, two portlets using different JSF implementations. Actually I'll need to have the same release and implementation for any web framework on all portlets. For example I won't be able to have struts 1.2.7 on one portlet and struts 1.3.1 on another. But I could have this on servlet-based web apps.

Maybe people from the Portlet Bridge subproject can tell if you are correct or not.

Well, it won't hurt to remove mojarra and add myfaces to jboss lib just to see what happens. Thanks for the clarifications!

> Cant' run two JSF portlets on the same portal page
> --------------------------------------------------
>
>                 Key: MYFACES-2395
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2395
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: Portlet_Support
>         Environment: JDK 1.5, JBoss AS 4.2.3, eXo PC 2.0.5 or eXO WCM 1.0 or eXO WCM 1.2
>            Reporter: Fernando Silva Lozano
>            Assignee: Leonardo Uribe
>         Attachments: hora-mundo-jsf.war, todo-jsf.war
>
>
> Running two portlets in the same portal page, using JSF and the MyFaces Portlet Bridge (which is the RI for JSR-301, the JSF Portlet Bridge)  yelds the error bellow for the second portlet:
> 19:31:39,704 ERROR [portletcontainer] exception returned by processAction() or render() methods
> javax.portlet.PortletException: doBridgeDispatch failed:  error from Bridge in executing the request
>      at javax.portlet.faces.GenericFacesPortlet.doBridgeDispatch(GenericFacesPortlet.java:504)
>      at javax.portlet.faces.GenericFacesPortlet.doRenderDispatchInternal(GenericFacesPortlet.java:456)
>      at javax.portlet.faces.GenericFacesPortlet.doView(GenericFacesPortlet.java:231)
>      at javax.portlet.GenericPortlet.doDispatch(GenericPortlet.java:354)
>      at javax.portlet.faces.GenericFacesPortlet.doDispatch(GenericFacesPortlet.java:202)
>      at javax.portlet.GenericPortlet.render(GenericPortlet.java:259)
>      at org.exoplatform.services.portletcontainer.plugins.pc.aop.PortletMethodCommand.render(PortletMethod Command.java:62)
>     at org.exoplatform.services.portletcontainer.plugins.pc.aop.BaseCommandUnit.execute(BaseCommandUnit.java:46)
> ...
>  Caused by: javax.portlet.faces.BridgeException: java.lang.ClassCastException: org.apache.myfaces.renderkit.RenderKitFactoryImpl
>      at org.apache.myfaces.portlet.faces.bridge.BridgeImpl.doFacesRender(BridgeImpl.java:654)
>      at org.apache.myfaces.portlet.faces.bridge.BridgeImpl.doFacesRequest(BridgeImpl.java:544)
>      at javax.portlet.faces.GenericFacesPortlet.doBridgeDispatch(GenericFacesPortlet.java:501)
>      ... 63 more
> Caused by: java.lang.ClassCastException: org.apache.myfaces.renderkit.RenderKitFactoryImpl
>      at org.apache.myfaces.shared_impl.renderkit.RendererUtils.getResponseStateManager(RendererUtils.java: 1158)
>      at org.apache.myfaces.lifecycle.DefaultRestoreViewSupport.isPostback(DefaultRestoreViewSupport.java:127)
>      at org.apache.myfaces.lifecycle.RestoreViewExecutor.execute(RestoreViewExecutor.java:80)
>      at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:103)
>      at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:76)
>      at org.apache.myfaces.portlet.faces.bridge.BridgeImpl.doFacesRender(BridgeImpl.java:640)
>      ... 65 more
> This exception allways happen with the second portlet on the page, whichever it is. I tried with many portlets, but so you can reproduce the problem I'm attaching the wars for two very simple portlets.
> I'm filling this under MyFaces Core instead of Portlet Bridge because the same applications, if deployed to use Mojarra (included in JBoss AS 4.2) and the same portelt bridge jars, work fine.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.