6 Replies Latest reply on Apr 13, 2006 12:03 AM by noicangi

    JBoss Portal and MyFacesGenericPortlet

    dunks80 Newbie

      I posted this question to the myfaces users mailing list but I'll post it here as well in the hope that someone from the Jboss community could shed some light on the issue...

      I'm using JBoss Portal 2.0.1 RC1 with the latest nightly build of MyFaces. If I use the default portal and create a new portlet using MyFacesGenericPortlet the interface renders, I can navigate to my portlet page, everything works great. If I declare a separate portal instance within the portal server (so i now have a *-portal.xml configuration file) and I say I want to use one of my MyFacesGenericPortlet's as the default portlet on the default portlet page and I navigate to the portal using a url like http://localhost:8080/portal/myportal/ i get the following exception....

      javax.portlet.PortletException: value must not be null
      org.apache.myfaces.portlet.MyFacesGenericPortlet.handleExceptionFromLifecycle(MyFacesGenericPortlet.java:254)
      org.apache.myfaces.portlet.MyFacesGenericPortlet.processAction
      (MyFacesGenericPortlet.java:233)

      snipped...


      However, if I put the entire url in like this http://localhost:8080/portal/myportal/?ctrl:id=page.myportal.myTest it once again renders fine. I did some debugging through the code and it seems that when I use the first url to navigate to the portal the processAction method is called on MyFacesGenericPortlet. It blows up because no viewId has been set in the view root. However if I navigate to the portal using the second url the nonFacesRequest(RenderRequest request, RenderResponse response) method is called which of course sets the viewId of the view root and it renders fine.

      So my question is why when trying to navigate to the default page does the portal call processAction on MyFacesGenericPortlet? Is this a JBoss Portal problem or a MyFacesGenericPortlet problem? Does anyone know a fix for this?

        • 1. Re: JBoss Portal and MyFacesGenericPortlet
          Viet Master

          I got the same issue using JSF (I am a beginner :-)) and I havent figured out yet, has anyone an answer for this ? Stan ?

          • 2. Re: JBoss Portal and MyFacesGenericPortlet
            dunks80 Newbie

            As a work around I simpliy extended MyFacesGenericPortlet and overrode the processAction method like this...

            /**
             * Called by the portlet container to allow the portlet to process an action request.
             */
             public void processAction(ActionRequest request, ActionResponse response)
             throws PortletException, IOException
             {
             if (log.isTraceEnabled()) log.trace("called processAction");
            
             if (sessionTimedOut(request)) return;
            
             setPortletRequestFlag(request);
            
             FacesContext facesContext = facesContext(request, response);
            
            
             try
             {
             lifecycle.execute(facesContext);
             //check to see if id is null is so set default view as id
             if(facesContext.getViewRoot().getViewId()==null)
             {
             facesContext.getViewRoot().setViewId(this.defaultView);
             }
             if (!facesContext.getResponseComplete())
             {
             response.setRenderParameter(VIEW_ID, facesContext.getViewRoot().getViewId());
             }
            
             request.getPortletSession().setAttribute(CURRENT_FACES_CONTEXT, facesContext);
             }
             catch (Throwable e)
             {
             facesContext.release();
             handleExceptionFromLifecycle(e);
             }
             }


            I don't have enough experience with the portal yet to know if this fix will have adverse effects yet but it seems ok so far. If anyone has any information on this issue I would appreciate it.

            • 3. Re: JBoss Portal and MyFacesGenericPortlet
              Viet Master

              I have a similar stack trace with myfaces :

              javax.portlet.PortletException: java.lang.NullPointerException
               at org.apache.myfaces.portlet.MyFacesGenericPortlet.handleExceptionFromLifecycle(MyFacesGenericPortlet.java:257)
               at org.apache.myfaces.portlet.MyFacesGenericPortlet.facesRender(MyFacesGenericPortlet.java:400)
               at org.apache.myfaces.portlet.MyFacesGenericPortlet.doView(MyFacesGenericPortlet.java:266)
               at javax.portlet.GenericPortlet.doDispatch(GenericPortlet.java:154)
               at javax.portlet.GenericPortlet.render(GenericPortlet.java:394)
               at org.jboss.portal.portlet.aspects.component.PortletDispatcherInterceptor.invokeRender(PortletDispatcherInterceptor.java:169)
               at org.jboss.portal.portlet.aspects.component.PortletDispatcherInterceptor.invoke(PortletDispatcherInterceptor.java:89)
               at org.jboss.portal.server.app.ComponentInterceptor.invoke(ComponentInterceptor.java:24)
               at org.jboss.portal.server.invocation.Invocation.invokeNext(Invocation.java:107)
               at org.jboss.portal.core.aspects.component.TransactionInterceptor.invoke(TransactionInterceptor.java:56)
               at org.jboss.portal.server.app.ComponentInterceptor.invoke(ComponentInterceptor.java:24)
               at org.jboss.portal.server.invocation.Invocation.invokeNext(Invocation.java:107)
               at org.jboss.portal.portlet.aspects.component.PreferencesInterceptor.invoke(PreferencesInterceptor.java:88)
               at org.jboss.portal.server.app.ComponentInterceptor.invoke(ComponentInterceptor.java:24)
               at org.jboss.portal.server.invocation.Invocation.invokeNext(Invocation.java:107)
               at org.jboss.portal.server.aspects.component.NavigationInterceptor.invoke(NavigationInterceptor.java:60)
               at org.jboss.portal.server.app.ComponentInterceptor.invoke(ComponentInterceptor.java:24)
               at org.jboss.portal.server.invocation.Invocation.invokeNext(Invocation.java:107)
               at org.jboss.portal.server.aspects.component.CacheInterceptor.invoke(CacheInterceptor.java:95)
               at org.jboss.portal.server.app.ComponentInterceptor.invoke(ComponentInterceptor.java:24)
               at org.jboss.portal.server.invocation.Invocation.invokeNext(Invocation.java:107)
               at org.jboss.portal.server.aspects.component.ModesInterceptor.invoke(ModesInterceptor.java:36)
               at org.jboss.portal.server.app.ComponentInterceptor.invoke(ComponentInterceptor.java:24)
               at org.jboss.portal.server.invocation.Invocation.invokeNext(Invocation.java:107)
               at org.jboss.portal.server.aspects.component.WindowStatesInterceptor.invoke(WindowStatesInterceptor.java:29)
               at org.jboss.portal.server.app.ComponentInterceptor.invoke(ComponentInterceptor.java:24)
               at org.jboss.portal.server.invocation.Invocation.invokeNext(Invocation.java:107)
               at org.jboss.portal.portlet.aspects.component.SessionPostDispatchInterceptor.invoke(SessionPostDispatchInterceptor.java:68)
               at org.jboss.portal.server.app.ComponentInterceptor.invoke(ComponentInterceptor.java:24)
               at org.jboss.portal.server.invocation.Invocation.invokeNext(Invocation.java:107)
              


              • 4. Re: JBoss Portal and MyFacesGenericPortlet
                amgad mosleh Newbie

                Me too I am having a similar problem :

                javax.portlet.PortletException
                 at org.apache.myfaces.portlet.MyFacesGenericPortlet.handleExceptionFromLifecycle(MyFacesGenericPortlet.java:257)
                 at org.apache.myfaces.portlet.MyFacesGenericPortlet.processAction(MyFacesGenericPortlet.java:233)
                 at com.liferay.portal.shared.servlet.PortletServlet.service(PortletServlet.java:88)
                 at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                 at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
                 at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:574)
                 at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:499)
                 at com.liferay.portlet.CachePortlet._invoke(CachePortlet.java:297)
                 at com.liferay.portlet.CachePortlet.processAction(CachePortlet.java:144)
                 at com.liferay.portal.action.LayoutAction._processPortletRequest(LayoutAction.java:231)
                 at com.liferay.portal.action.LayoutAction._processActionRequest(LayoutAction.java:249)
                 at com.liferay.portal.action.LayoutAction.execute(LayoutAction.java:86)
                 at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
                 at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
                 at com.liferay.portal.struts.PortalRequestProcessor.process(PortalRequestProcessor.java:183)
                 at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
                 at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
                 at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
                 at com.liferay.portal.servlet.MainServlet.callParentService(MainServlet.java:426)
                 at com.liferay.portal.servlet.MainServlet.service(MainServlet.java:830)
                 at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                 at com.liferay.filters.strip.StripFilter.doFilter(StripFilter.java:94)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                 at com.liferay.filters.secure.SecureFilter.doFilter(SecureFilter.java:134)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                 at com.liferay.filters.compression.CompressionFilter.doFilter(CompressionFilter.java:116)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                 at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
                 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
                 at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
                 at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:159)
                 at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:407)
                 at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
                 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
                 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
                 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
                 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
                 at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
                 at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
                 at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
                 at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
                 at java.lang.Thread.run(Thread.java:595)


                Please help

                • 5. Re: JBoss Portal and MyFacesGenericPortlet
                  Viet Master

                  yes but you posted in the wrong forum...

                  "Amgad" wrote:
                  Me too I am having a similar problem :
                  javax.portlet.PortletException
                   at org.apache.myfaces.portlet.MyFacesGenericPortlet.handleExceptionFromLifecycle(MyFacesGenericPortlet.java:257)
                   at org.apache.myfaces.portlet.MyFacesGenericPortlet.processAction(MyFacesGenericPortlet.java:233)
                   at com.liferay.portal.shared.servlet.PortletServlet.service(PortletServlet.java:88)
                   at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
                   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
                   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                   at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
                   at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:574)
                   at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:499)
                   at com.liferay.portlet.CachePortlet._invoke(CachePortlet.java:297)
                   at com.liferay.portlet.CachePortlet.processAction(CachePortlet.java:144)
                   at com.liferay.portal.action.LayoutAction._processPortletRequest(LayoutAction.java:231)
                   at com.liferay.portal.action.LayoutAction._processActionRequest(LayoutAction.java:249)
                   at com.liferay.portal.action.LayoutAction.execute(LayoutAction.java:86)
                   at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
                   at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
                   at com.liferay.portal.struts.PortalRequestProcessor.process(PortalRequestProcessor.java:183)
                   at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
                   at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
                   at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
                   at com.liferay.portal.servlet.MainServlet.callParentService(MainServlet.java:426)
                   at com.liferay.portal.servlet.MainServlet.service(MainServlet.java:830)
                   at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
                   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
                   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                   at com.liferay.filters.strip.StripFilter.doFilter(StripFilter.java:94)
                   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                   at com.liferay.filters.secure.SecureFilter.doFilter(SecureFilter.java:134)
                   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                   at com.liferay.filters.compression.CompressionFilter.doFilter(CompressionFilter.java:116)
                   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                   at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
                   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
                   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
                   at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
                   at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:159)
                   at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:407)
                   at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
                   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
                   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
                   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
                   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
                   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
                   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
                   at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
                   at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
                   at java.lang.Thread.run(Thread.java:595)


                  Please help


                  • 6. Re: JBoss Portal and MyFacesGenericPortlet
                    noicangi Novice

                    hi, i'm starting in portlt development, i i would like to know more about myJSF portlets, julien where do you start?

                    please any link, information would be great. this portal r0X!!