5 Replies Latest reply: Dec 8, 2011 5:03 AM by Eduardo Mello Cantú RSS

Is it possible to make a richfaces 3.3.3 module on Jboss 7?

Eduardo Mello Cantú Newbie

I'm migrating an application (JBoss Seam 2.2.2.Final + JBoss Richfaces 3.3.3 (JSF 1.2)) from JBoss 4.2.3.GA to JBoss 7.1.0.Beta1.

 

The main purpose of doing this migration is that my application uses JBoss Portlet Container to show some Portlets (Seam 2.2.2 + Richfaces 3.3.3) and I'm facing a ClassCastException when my Portlet try to render some Richfaces tag.

 

The only solution that I've found on JBoss 4.2.3.GA was to share the classloaders between Portal and Portlets, but it wasn't very practical.

 

Reading about JBoss 7 module classloader I thought that I would be abble to turn richfaces into a module and then share it between Portal and portlet but until now I wasn't abble to to it so.

 

Can someone please help me?

  • 1. Re: Is it possible to make a richfaces 3.3.3 module on Jboss 7?
    Eduardo Mello Cantú Newbie

    Just to add some info, the ClassCastException also occurs on JBoss AS 7.1.0.Beta1 when I pack both application (Portal) and portlet with richfaces (api, imp and ui) jars.

  • 2. Re: Is it possible to make a richfaces 3.3.3 module on Jboss 7?
    jaikiran pai Master

    You'll have to post the exception stacktrace and also explain a bit more about your packaging.

  • 3. Re: Is it possible to make a richfaces 3.3.3 module on Jboss 7?
    Eduardo Mello Cantú Newbie

    As I said on the first post, I've an issue running my portal application along with portlets developed with seam, richfaces and portlet bridge. Going deep I've figure it out that my problem was that the portal was loaded by a different classloader than the portlet, so as the classcastexception.

     

    That's why I've tried to turn richfaces into a module so both application and portlet could use from there instead packing then with it.

     

    Here's my packages:

     

    Portal application:

     

    app.ear

    -lib

    --hibernate.3.4.0.GA-stuff.jar

    --commons-*.jar

    --portletcontainer-stuff.jar

    --richfaces.3.3.3.Final-api.jar

    -jboss-seam.2.2.2.Final.jar

    -app.jar

    -app.war

    --WEB-INF

    ---lib

    ----portletcontainer-stuff.jar

    ----jboss-microkernel-stuff.jar

    ----richfaces.3.3.3.Final-impl.jar

    ----richfaces.3.3.3.Final-ui.jar

    ----jsf-facelets.1.1.15.B1.jar

    ----jboss-seam-ui.2.2.2.Final

     

    Portlet application:

     

    portlet.ear

    -lib

    --hibernate.3.4.0.GA-stuff.jar

    --commons-*.jar

    --richfaces.3.3.3.Final-api.jar

    -jboss-seam.2.2.2.Final.jar

    -portlet.jar

    -portlet.war

    --WEB-INF

    ---lib

    ----portletbridge-api-2.2.0.FINAL.jar

    ----portletbridge-impl-2.2.0.FINAL.jar

    ----richfaces.3.3.3.Final-impl.jar

    ----richfaces.3.3.3.Final-ui.jar

    ----jsf-facelets.1.1.15.B1.jar

    ----jboss-seam-ui.2.2.2.Final

     

     

    And here's my stacktrace:

     

    10:22:15,948 ERROR [org.gatein.pc.container.javax_portlet_faces_GenericFacesPortlet] (http--0.0.0.0-8080-5) The portlet threw an exception: javax.portlet.PortletException: Error process faces request

              at javax.portlet.faces.GenericFacesPortlet.doFacesDispatch(GenericFacesPortlet.java:630) [portletbridge-api-2.2.0.FINAL.jar:]

              at javax.portlet.faces.GenericFacesPortlet.doView(GenericFacesPortlet.java:518) [portletbridge-api-2.2.0.FINAL.jar:]

              at javax.portlet.GenericPortlet.doDispatch(GenericPortlet.java:328) [portlet-api.jar:]

              at javax.portlet.faces.GenericFacesPortlet.doDispatch(GenericFacesPortlet.java:489) [portletbridge-api-2.2.0.FINAL.jar:]

              at javax.portlet.GenericPortlet.render(GenericPortlet.java:233) [portlet-api.jar:]

              at org.gatein.pc.portlet.impl.jsr168.PortletContainerImpl$Invoker.doFilter(PortletContainerImpl.java:568) [pc-portlet.jar:]

              at org.gatein.pc.portlet.impl.jsr168.api.FilterChainImpl.doFilter(FilterChainImpl.java:159) [pc-portlet.jar:]

              at org.gatein.pc.portlet.impl.jsr168.api.FilterChainImpl.doFilter(FilterChainImpl.java:80) [pc-portlet.jar:]

              at org.gatein.pc.portlet.impl.jsr168.PortletContainerImpl.dispatch(PortletContainerImpl.java:505) [pc-portlet.jar:]

              at org.gatein.pc.portlet.container.ContainerPortletDispatcher.invoke(ContainerPortletDispatcher.java:42) [pc-portlet.jar:]

              at org.gatein.pc.portlet.PortletInvokerInterceptor.invoke(PortletInvokerInterceptor.java:87) [pc-portlet.jar:]

              at org.gatein.pc.portlet.aspects.EventPayloadInterceptor.invoke(EventPayloadInterceptor.java:196) [pc-portlet.jar:]

              at org.gatein.pc.portlet.PortletInvokerInterceptor.invoke(PortletInvokerInterceptor.java:87) [pc-portlet.jar:]

              at org.gatein.pc.portlet.aspects.RequestAttributeConversationInterceptor.invoke(RequestAttributeConversationInterceptor.java:119) [pc-portlet.jar:]

              at org.gatein.pc.portlet.PortletInvokerInterceptor.invoke(PortletInvokerInterceptor.java:87) [pc-portlet.jar:]

              at org.gatein.pc.portlet.aspects.CCPPInterceptor.invoke(CCPPInterceptor.java:65) [pc-portlet.jar:]

              at org.gatein.pc.portlet.PortletInvokerInterceptor.invoke(PortletInvokerInterceptor.java:87) [pc-portlet.jar:]

              at org.gatein.pc.portlet.PortletInvokerInterceptor.invoke(PortletInvokerInterceptor.java:87) [pc-portlet.jar:]

              at org.gatein.pc.portlet.aspects.ContextDispatcherInterceptor.access$001(ContextDispatcherInterceptor.java:49) [pc-portlet.jar:]

              at org.gatein.pc.portlet.aspects.ContextDispatcherInterceptor$1.doCallback(ContextDispatcherInterceptor.java:123) [pc-portlet.jar:]

              at org.gatein.wci.command.CommandDispatcher$CallbackCommand.execute(CommandDispatcher.java:82) [wci-wci.jar:]

              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_16]

              at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) [:1.6.0_16]

              at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) [:1.6.0_16]

              at java.lang.reflect.Method.invoke(Unknown Source) [:1.6.0_16]

              at org.gatein.wci.command.CommandServlet.doGet(CommandServlet.java:135) [wci-wci.jar:]

              at javax.servlet.http.HttpServlet.service(HttpServlet.java:734) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:]

              at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:]

              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.3.Final.jar:]

              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.3.Final.jar:]

              at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:734) [jbossweb-7.0.3.Final.jar:]

              at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:639) [jbossweb-7.0.3.Final.jar:]

              at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:576) [jbossweb-7.0.3.Final.jar:]

              at org.gatein.wci.command.CommandServlet.include(CommandServlet.java:84) [wci-wci.jar:]

              at org.gatein.wci.command.CommandDispatcher.include(CommandDispatcher.java:58) [wci-wci.jar:]

              at org.gatein.wci.tomcat.TC6ServletContainerContext.include(TC6ServletContainerContext.java:87) [wci-tomcat.jar:]

              at org.gatein.wci.impl.DefaultServletContainer.include(DefaultServletContainer.java:191) [wci-wci.jar:]

              at org.gatein.pc.portlet.impl.spi.AbstractServerContext.dispatch(AbstractServerContext.java:69) [pc-portlet.jar:]

              at org.gatein.pc.portlet.aspects.ContextDispatcherInterceptor.invoke(ContextDispatcherInterceptor.java:77) [pc-portlet.jar:]

              at org.gatein.pc.portlet.PortletInvokerInterceptor.invoke(PortletInvokerInterceptor.java:87) [pc-portlet.jar:]

              at org.gatein.pc.portlet.aspects.SecureTransportInterceptor.invoke(SecureTransportInterceptor.java:69) [pc-portlet.jar:]

              at org.gatein.pc.portlet.PortletInvokerInterceptor.invoke(PortletInvokerInterceptor.java:87) [pc-portlet.jar:]

              at org.gatein.pc.portlet.aspects.ValveInterceptor.invoke(ValveInterceptor.java:75) [pc-portlet.jar:]

              at org.gatein.pc.portlet.PortletInvokerInterceptor.invoke(PortletInvokerInterceptor.java:87) [pc-portlet.jar:]

              at org.gatein.pc.portlet.container.ContainerPortletInvoker.invoke(ContainerPortletInvoker.java:117) [pc-portlet.jar:]

              at org.gatein.pc.portlet.PortletInvokerInterceptor.invoke(PortletInvokerInterceptor.java:87) [pc-portlet.jar:]

              at org.gatein.pc.portlet.state.producer.ProducerPortletInvoker.invoke(ProducerPortletInvoker.java:230) [pc-portlet.jar:]

              at org.gatein.pc.portlet.PortletInvokerInterceptor.invoke(PortletInvokerInterceptor.java:87) [pc-portlet.jar:]

              at org.gatein.pc.portlet.aspects.PortletCustomizationInterceptor.invoke(PortletCustomizationInterceptor.java:76) [pc-portlet.jar:]

              at org.gatein.pc.portlet.PortletInvokerInterceptor.invoke(PortletInvokerInterceptor.java:87) [pc-portlet.jar:]

              at org.gatein.pc.portlet.aspects.ConsumerCacheInterceptor.invoke(ConsumerCacheInterceptor.java:162) [pc-portlet.jar:]

              at org.gatein.pc.portlet.PortletInvokerInterceptor.invoke(PortletInvokerInterceptor.java:87) [pc-portlet.jar:]

              at org.gatein.pc.portal.jsp.PagePortletControllerContext.invoke(PagePortletControllerContext.java:117)

              at org.gatein.pc.controller.impl.AbstractPortletControllerContext.invoke(AbstractPortletControllerContext.java:191)

              at org.gatein.pc.controller.PortletController.render(PortletController.java:235)

              at org.gatein.pc.portal.jsp.PortalRenderResponse.render(PortalRenderResponse.java:121)

              at org.gatein.pc.portal.jsp.PortalRenderResponse.render(PortalRenderResponse.java:138)

              at org.gatein.pc.portal.jsp.PortalRenderResponse.<init>(PortalRenderResponse.java:91)

              at org.gatein.pc.portal.jsp.ControllerFilter.doFilter(ControllerFilter.java:272)

              at org.gatein.pc.portal.jsp.ControllerFilter.doFilter(ControllerFilter.java:92)

              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.3.Final.jar:]

              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.3.Final.jar:]

              at org.gatein.pc.portal.ErrorHandlingFilter.doFilter(ErrorHandlingFilter.java:61)

              at org.gatein.pc.portal.ErrorHandlingFilter.doFilter(ErrorHandlingFilter.java:53)

              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.3.Final.jar:]

              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.3.Final.jar:]

              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83) [jboss-seam.jar:]

              at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40) [jboss-seam.jar:]

              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) [jboss-seam.jar:]

              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73) [jboss-seam.jar:]

              at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64) [jboss-seam.jar:]

              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) [jboss-seam.jar:]

              at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45) [jboss-seam.jar:]

              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) [jboss-seam.jar:]

              at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:206) [richfaces-impl.jar:]

              at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290) [richfaces-impl.jar:]

              at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388) [richfaces-impl.jar:]

              at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515) [richfaces-impl.jar:]

              at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56) [jboss-seam.jar:]

              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) [jboss-seam.jar:]

              at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60) [jboss-seam.jar:]

              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) [jboss-seam.jar:]

              at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158) [jboss-seam.jar:]

              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.3.Final.jar:]

              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.3.Final.jar:]

              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.3.Final.jar:]

              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.3.Final.jar:]

              at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:397) [jbossweb-7.0.3.Final.jar:]

              at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50) [jboss-as-jpa-7.1.0.Beta1.jar:]

              at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:151) [jboss-as-web-7.1.0.Beta1.jar:]

              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.3.Final.jar:]

              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.3.Final.jar:]

              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.3.Final.jar:]

              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362) [jbossweb-7.0.3.Final.jar:]

              at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.3.Final.jar:]

              at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671) [jbossweb-7.0.3.Final.jar:]

              at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) [jbossweb-7.0.3.Final.jar:]

              at java.lang.Thread.run(Unknown Source) [:1.6.0_16]

    Caused by: javax.portlet.faces.BridgeException: javax.faces.FacesException: java.lang.ClassCastException: org.ajax4jsf.webapp.FilterServletResponseWrapper cannot be cast to org.ajax4jsf.webapp.FilterServletResponseWrapper

              at org.jboss.portletbridge.SeamExceptionHandlerImpl.handleException(SeamExceptionHandlerImpl.java:123) [portletbridge-impl-2.2.0.FINAL.jar:]

              at org.jboss.portletbridge.SeamExceptionHandlerImpl.processException(SeamExceptionHandlerImpl.java:63) [portletbridge-impl-2.2.0.FINAL.jar:]

              at org.jboss.portletbridge.ExceptionHandlerBase.processRenderException(ExceptionHandlerBase.java:62) [portletbridge-impl-2.2.0.FINAL.jar:]

              at org.jboss.portletbridge.AjaxPortletBridge.doFacesRequest(AjaxPortletBridge.java:695) [portletbridge-impl-2.2.0.FINAL.jar:]

              at javax.portlet.faces.GenericFacesPortlet.doFacesDispatch(GenericFacesPortlet.java:628) [portletbridge-api-2.2.0.FINAL.jar:]

              ... 97 more

    Caused by: javax.faces.FacesException: java.lang.ClassCastException: org.ajax4jsf.webapp.FilterServletResponseWrapper cannot be cast to org.ajax4jsf.webapp.FilterServletResponseWrapper

              at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:128) [jsf-impl-1.2_15-jbossorg-2.jar:]

              at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139) [jsf-impl-1.2_15-jbossorg-2.jar:]

              at org.jboss.portletbridge.AjaxPortletBridge.render(AjaxPortletBridge.java:1290) [portletbridge-impl-2.2.0.FINAL.jar:]

              at org.jboss.portletbridge.AjaxPortletBridge.doFacesRequest(AjaxPortletBridge.java:658) [portletbridge-impl-2.2.0.FINAL.jar:]

              ... 98 more

    Caused by: java.lang.ClassCastException: org.ajax4jsf.webapp.FilterServletResponseWrapper cannot be cast to org.ajax4jsf.webapp.FilterServletResponseWrapper

              at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:184) [richfaces-impl.jar:]

              at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:110) [jsf-impl-1.2_15-jbossorg-2.jar:]

              at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100) [jsf-impl-1.2_15-jbossorg-2.jar:]

              ... 101 more

     

     

    Anyway, I don't even know if what I'm trying to do is possible or if I'm on the right forum.

  • 4. Re: Is it possible to make a richfaces 3.3.3 module on Jboss 7?
    Marek Novotny Apprentice

    You should follow http://community.jboss.org/blogs/marek-novotny/2011/07/29/seam-2-booking-example-on-jboss-as-7. This is mainly for seam 2, but as you are using exactly same Seam it should help you.

  • 5. Re: Is it possible to make a richfaces 3.3.3 module on Jboss 7?
    Eduardo Mello Cantú Newbie

    Actually I did.

     

    My problem is that my application is a portal and when render a portlet I got the classcastexception. The other functionalities are working correctly (the ones that don't depend on the dashboard).