3 Replies Latest reply on Jan 12, 2007 3:09 PM by Syed H

    javax.portlet.PortletException: INIT_VIEW_PARAMETER must be

    Syed H Newbie

      Hi,

      I have my Sun JSF application deployed successfully in my JBoss portal server 2.4.1

      While launching the portal application, I am getting an exception like,

      2007-01-12 09:38:40,729 ERROR [org.jboss.portal.portlet.container.com_sun_faces_portlet_FacesPortlet] The portlet threw an exception
      javax.portlet.PortletException: INIT_VIEW_PARAMETER must be specified

      at com.sun.faces.portlet.FacesPortlet.render(FacesPortlet.java:290)

      My portlet.xml file is,

      <portlet>
      <portlet-name>TestPortlet</portlet-name>
      <portlet-class>com.sun.faces.portlet.FacesPortlet</portlet-class>
      <init-param>
      <name>default-view</name>
      <value>/index.jsp</value>
      </init-param>
      <supports>
      <mime-type>text/html</mime-type>
      <portlet-mode>VIEW</portlet-mode>
      </supports>
      <portlet-info>
      <title>Test JSF Portlet</title>
      </portlet-info>
      </portlet>


      My -object.xml file is,

      <deployments>
      <deployment>
      <if-exists>overwrite</if-exists>
      <parent-ref>default.default</parent-ref>
      <window>
      <window-name>TestPortletWindow</window-name>
      <instance-ref>TestPortletInstance</instance-ref>
      <region>center</region>
      <height>1</height>
      </window>
      </deployment>
      </deployments>


      My portlet-instances.xml file is,

      <deployments>
      <deployment>
      <instance>
      <instance-id>TestPortletInstance</instance-id>
      <portlet-ref>TestPortlet</portlet-ref>
      </instance>
      </deployment>
      </deployments>


      Please help me in resolving this issue.

      Thanks.

        • 1. Re: javax.portlet.PortletException: INIT_VIEW_PARAMETER must
          Thomas Heute Master

          The init parameter for the Sun JSF implementation is:
          com.sun.faces.portlet.INIT_VIEW

          instead of "default-view" used by myFaces.

          so in your portlet.xml you would have:

          <init-param>
           <name>com.sun.faces.portlet.INIT_VIEW</name>
           <value>/index.jsp</value>
          </init-param>
          


          (Next time, please use "code" instead of "quote" to write done some XML so that it is not stripped.)

          Hope this helps.


          • 2. Re: javax.portlet.PortletException: INIT_VIEW_PARAMETER must
            Syed H Newbie

            Hi Thomas,

            Thanks for the help. The exception is gone now.

            However my JSF pages are not rendered, I simply get a blank screen.

            The Jboss portal server throws the following warnings,

            10:14:24,891 WARN [ViewHandlerImpl] Unable to determine FaceServlet mapping for
             servlet path 'null'.
            10:14:24,901 INFO [STDOUT] response content type text/html
            10:14:26,486 INFO [[/helloworldjsfportlet]] No state saving method defined, ass
            uming default server state saving
            10:14:26,765 INFO [MyfacesConfig] No context init parameter 'org.apache.myfaces
            .PRETTY_HTML' found, using default value true
            10:14:26,765 INFO [MyfacesConfig] No context init parameter 'org.apache.myfaces
            .ALLOW_JAVASCRIPT' found, using default value true
            10:14:26,765 INFO [MyfacesConfig] No context init parameter 'org.apache.myfaces
            .DETECT_JAVASCRIPT' found, using default value false
            10:14:26,765 INFO [MyfacesConfig] No context init parameter 'org.apache.myfaces
            .AUTO_SCROLL' found, using default value false
            10:14:35,089 WARN [ViewHandlerImpl] Unable to determine FaceServlet mapping for servlet path 'null'.


            Please help me to resolve this.

            • 3. Re: javax.portlet.PortletException: INIT_VIEW_PARAMETER must
              Syed H Newbie

              Hi Thomas,

              My JSP page has 3 frames in it. When I give the individual pages in my <init-param> setting, my pages get rendered, where as if the frame page is called, I simply get a blank page with no exceptions.

              Please let me know how to resolve this.

              Thanks