4 Replies Latest reply on Apr 16, 2013 6:19 AM by zsv

    Gatein 3.x jboss 6.1 jsf 2 portlet UnsupportedOperationException

    zsv

      Hello.

      I'm trying to write simple portlet using:

      portlet bridge 3.2.0.CR1

      richfaces 4.3.1.Final

      jsf 2 (v. 2.0.3 - native AS)

       

      for gatein 3.1.0 final on jboss 6.1

       

      when i accessing portlet, get exception :

       

      Caused by: java.lang.UnsupportedOperationException

              at javax.faces.context.FacesContext.getAttributes(FacesContext.java:137) [:2.0.3-]

              at com.sun.faces.application.ApplicationImpl.invokeViewListenersFor(ApplicationImpl.java:1953) [:2.0.3-]

              at com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:287) [:2.0.3-]

              at com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:242) [:2.0.3-]

              at javax.faces.application.ApplicationWrapper.publishEvent(ApplicationWrapper.java:666) [:2.0.3-]

              at javax.faces.application.ApplicationWrapper.publishEvent(ApplicationWrapper.java:666) [:2.0.3-]

              at org.jboss.portletbridge.PortletBridgeImpl.fireFacesSystemEvent(PortletBridgeImpl.java:356)

              at org.jboss.portletbridge.PortletBridgeImpl.releaseBridgeContext(PortletBridgeImpl.java:340)

              at org.jboss.portletbridge.PortletBridgeImpl.finalizeRequest(PortletBridgeImpl.java:335)

              at org.jboss.portletbridge.PortletBridgeImpl.doFacesRequest(PortletBridgeImpl.java:264)

              at javax.portlet.faces.GenericFacesPortlet.doFacesDispatch(GenericFacesPortlet.java:516)

              at javax.portlet.faces.GenericFacesPortlet.doView(GenericFacesPortlet.java:437)

              at javax.portlet.GenericPortlet.doDispatch(GenericPortlet.java:328) [:1.0-SNAPSHOT]

              at javax.portlet.faces.GenericFacesPortlet.doDispatch(GenericFacesPortlet.java:411)

              at javax.portlet.GenericPortlet.render(GenericPortlet.java:233) [:1.0-SNAPSHOT]

       

      sources and war in attachment

       

      please help find solution

      Thanks!

       

       

       

       

       

      web.xml content:

       

      <?xml version="1.0" encoding="UTF-8"?>

      <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5">

        <display-name>Sample RichFaces 4 Application</display-name>

        <!-- context-param>

            <param-name>org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL</param-name>

            <param-value>true</param-value>

      </context-param-->

       

        <context-param>

          <param-name>javax.faces.PROJECT_STAGE</param-name>

          <param-value>Development</param-value>

        </context-param>

        <context-param>

          <param-name>javax.faces.SKIP_COMMENTS</param-name>

          <param-value>true</param-value>

        </context-param>

        <servlet>

          <servlet-name>Faces Servlet</servlet-name>

          <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>

          <load-on-startup>1</load-on-startup>

        </servlet>

        <servlet-mapping>

          <servlet-name>Faces Servlet</servlet-name>

          <url-pattern>*.xhtml</url-pattern>

        </servlet-mapping>

        <servlet-mapping>

          <servlet-name>Faces Servlet</servlet-name>

          <url-pattern>/faces/*</url-pattern>

        </servlet-mapping>

        <servlet>

          <servlet-name>Resource Servlet</servlet-name>

          <servlet-class>org.richfaces.webapp.ResourceServlet</servlet-class>

          <load-on-startup>1</load-on-startup>

        </servlet>

        <servlet-mapping>

          <servlet-name>Resource Servlet</servlet-name>

          <url-pattern>/org.richfaces.resources/*</url-pattern>

        </servlet-mapping>

        <context-param>

          <param-name>org.richfaces.resourceMapping.enabled</param-name>

          <param-value>true</param-value>

        </context-param>

        <session-config>

          <session-timeout>30</session-timeout>

        </session-config>

        <welcome-file-list>

          <welcome-file>faces/index.xhtml</welcome-file>

        </welcome-file-list>

        <context-param>

          <param-name>javax.portlet.faces.renderPolicy</param-name>

          <param-value>NEVER_DELEGATE</param-value>

        </context-param>

      </web-app>

       

       

      portlet.xml content:

       

      <?xml version="1.0" encoding="UTF-8"?><portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"

          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

          xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"

          version="2.0">

       

          <portlet>

              <portlet-name>jsf2 test</portlet-name>

              <portlet-class>javax.portlet.faces.GenericFacesPortlet</portlet-class>

              <init-param>

                  <name>javax.portlet.faces.defaultViewId.view</name>

                  <value>/index.xhtml</value>

              </init-param>

              <init-param>

                  <name>javax.portlet.faces.preserveActionParams</name>

                  <value>true</value>

              </init-param>

              <init-param>

                  <name>javax.portlet.faces.autoDispatchEvents</name>

                  <value>true</value>

              </init-param>

              <expiration-cache>-0</expiration-cache>

              <supports>

                  <mime-type>text/html</mime-type>

                  <portlet-mode>VIEW</portlet-mode>

              </supports>

              <portlet-info>

                  <title>jsf2 test</title>

              </portlet-info>

          </portlet>

      </portlet-app>