1 Reply Latest reply on May 7, 2009 8:11 AM by ilya_shaikovsky

    Problem integrating Richfaces with Weblogic JSF Portlets in

    prakash.parvath

      We are trying to integrate Richfaces with Weblogic JSF portlets on WeblogicPortal 10.3.

      1) The JSF version used is JSF 1.1, RichFaces 3.2 GA.

      The portlet does not render correctly in the weblogic portal server. The following exception is thrown/displayed in the browser:
      java.lang.NullPointerException at com.bea.portlet.adapter.faces.FacesContentStubImpl.save(FacesContentStubImpl.java:483)
      at com.bea.portlet.adapter.faces.FacesContentStubImpl.processAction(FacesContentStubImpl.java:272)
      at com.bea.netuix.servlets.controls.content.FacesContent.raiseFacesAction(FacesContent.java:264)
      at com.bea.netuix.servlets.controls.content.FacesContent.preRender(FacesContent.java:206)
      at com.bea.netuix.nf.ControlLifecycle$6.visit(ControlLifecycle.java:429)
      Truncated. see log file for complete stacktrace"
      .....

      When we tried to configure the portal project with the Jboss Portlet Bridge, the following exception is thrown:

      java.lang.NoClassDefFoundError: org/jboss/portletbridge/application/PortletStateManager : javax/faces/application/StateManagerWrapper
      at java.lang.ClassLoader.defineClass1(Native Method)
      at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
      at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)

      2) If we use Richfaces 3.1 GA , we were able to get the RichFaces component displayed in the portlet but the ajax calls are not updating /rerendering the response received from the server.
      When the portlet is resized, then the response is updated. No exceptions are thrown. In this case, the STATE_SAVING_METHOD in the web.xml is set to ‘client’.
      If we use the STATE_SAVING_METHOD as ‘server’ (which is good from performance point of view),
      the ajax calls do NOT update the data entered in the UI to the backing bean. The server response is not updated in the UI.

      Could you please provide us with any pointers regarding the above?

      For the reference im pasting my web.xml and faces-config.xml

      Web.xml


      <?xml version="1.0" encoding="UTF-8"?>
      <web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
      <display-name>myPortal3WebProject</display-name>
      <context-param>
      <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
      <param-value>client</param-value>
      <!--<description>
      State saving method: "client" or "server" (= default)
      See JSF Specification 2.5.2
      </description>-->
      </context-param>
      <listener>
      <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
      </listener>

      <servlet>
      <servlet-name>faces</servlet-name>
      <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
      <load-on-startup>1</load-on-startup>
      </servlet>

      <servlet-mapping>
      <servlet-name>faces</servlet-name>
      <url-pattern>*.jsf</url-pattern>
      </servlet-mapping>

      <servlet-mapping>
      <servlet-name>faces</servlet-name>
      <url-pattern>*.faces</url-pattern>
      </servlet-mapping>

      <welcome-file-list>
      <welcome-file>index.html</welcome-file>
      <welcome-file>index.htm</welcome-file>
      <welcome-file>index.jsp</welcome-file>
      <welcome-file>default.html</welcome-file>
      <welcome-file>default.htm</welcome-file>
      <welcome-file>default.jsp</welcome-file>
      </welcome-file-list>
      <filter>
      <filter-name>PageFlowJspFilter</filter-name>
      <filter-class>org.apache.beehive.netui.pageflow.PageFlowJspFilter</filter-class>
      </filter>
      <filter>
      <filter-name>PageFlowForbiddenFilter</filter-name>
      <filter-class>org.apache.beehive.netui.pageflow.PageFlowForbiddenFilter</filter-class>
      <init-param>
      <param-name>response-code</param-name>
      <param-value>404</param-value>
      </init-param>
      </filter>
      <filter-mapping>
      <filter-name>PageFlowJspFilter</filter-name>
      <url-pattern>*.jsp</url-pattern>
      <dispatcher>FORWARD</dispatcher>
      <dispatcher>REQUEST</dispatcher>
      <dispatcher>INCLUDE</dispatcher>
      </filter-mapping>
      <filter-mapping>
      <filter-name>PageFlowJspFilter</filter-name>
      <url-pattern>*.jspx</url-pattern>
      <dispatcher>FORWARD</dispatcher>
      <dispatcher>REQUEST</dispatcher>
      <dispatcher>INCLUDE</dispatcher>
      </filter-mapping>
      <filter-mapping>
      <filter-name>PageFlowForbiddenFilter</filter-name>
      <url-pattern>*.java</url-pattern>
      <dispatcher>REQUEST</dispatcher>
      </filter-mapping>
      <filter-mapping>
      <filter-name>PageFlowForbiddenFilter</filter-name>
      <url-pattern>*.jsfb</url-pattern>
      <dispatcher>REQUEST</dispatcher>
      </filter-mapping>
      <filter-mapping>
      <filter-name>PageFlowForbiddenFilter</filter-name>
      <url-pattern>*.jpfs</url-pattern>
      <dispatcher>REQUEST</dispatcher>
      </filter-mapping>
      <listener>
      <listener-class>org.apache.beehive.netui.pageflow.PageFlowContextListener</listener-class>
      </listener>
      <listener>
      <listener-class>org.apache.beehive.netui.pageflow.HttpSessionMutexListener</listener-class>
      </listener>
      <servlet>
      <servlet-name>action</servlet-name>
      <servlet-class>org.apache.beehive.netui.pageflow.PageFlowActionServlet</servlet-class>
      <init-param>
      <param-name>config</param-name>
      <param-value>/_pageflow/struts-config.xml</param-value>
      </init-param>
      <init-param>
      <param-name>debug</param-name>
      <param-value>2</param-value>
      </init-param>
      <init-param>
      <param-name>detail</param-name>
      <param-value>2</param-value>
      </init-param>
      <load-on-startup>2</load-on-startup>
      </servlet>
      <servlet>
      <servlet-name>XmlHttpRequestServlet</servlet-name>
      <servlet-class>org.apache.beehive.netui.pageflow.xmlhttprequest.XmlHttpRequestServlet</servlet-class>
      </servlet>
      <servlet-mapping>
      <servlet-name>action</servlet-name>
      <url-pattern>*.jpf</url-pattern>
      </servlet-mapping>
      <servlet-mapping>
      <servlet-name>action</servlet-name>
      <url-pattern>*.do</url-pattern>
      </servlet-mapping>
      <servlet-mapping>
      <servlet-name>XmlHttpRequestServlet</servlet-name>
      <url-pattern>*.xhr</url-pattern>
      </servlet-mapping>
      <servlet-mapping>
      <servlet-name>XmlHttpRequestServlet</servlet-name>
      <url-pattern>*.render</url-pattern>
      </servlet-mapping>
      <filter>
      <filter-name>PageFlowFacesFilter</filter-name>
      <filter-class>org.apache.beehive.netui.pageflow.PageFlowFacesFilter</filter-class>
      </filter>
      <filter-mapping>
      <filter-name>PageFlowFacesFilter</filter-name>
      <url-pattern>*.faces</url-pattern>
      <dispatcher>FORWARD</dispatcher>
      <dispatcher>REQUEST</dispatcher>
      <dispatcher>INCLUDE</dispatcher>
      </filter-mapping>
      <filter-mapping>
      <filter-name>PageFlowFacesFilter</filter-name>
      <url-pattern>*.jsf</url-pattern>
      <dispatcher>FORWARD</dispatcher>
      <dispatcher>REQUEST</dispatcher>
      <dispatcher>INCLUDE</dispatcher>
      </filter-mapping>

      <login-config>
      <auth-method>FORM</auth-method>
      <realm-name>myrealm</realm-name>
      <form-login-config>
      <form-login-page>/portlets/Login.jsp</form-login-page>
      <form-error-page>/portlets/LoginError.jsp</form-error-page>
      </form-login-config>
      </login-config>
      <security-constraint>
      <web-resource-collection>
      <web-resource-name>SecurePages</web-resource-name>
      <description>Security constraint /secure</description>
      <url-pattern>/*</url-pattern>
      <http-method>POST</http-method>
      <http-method>GET</http-method>
      </web-resource-collection>
      <auth-constraint>
      <!--
      '*' for a <role-name> means "authenticated user with any role"
      The user must be logged in with some kind of role to access
      the home page.
      -->
      <role-name>*</role-name>
      </auth-constraint>
      </security-constraint>

      <context-param>
      <param-name>org.richfaces.SKIN</param-name>
      <param-value>blueSky</param-value>
      </context-param>
      <context-param>
      <param-name>org.richfaces.CONTROL_SKINNING</param-name>
      <param-value>enable</param-value>
      </context-param>
      <filter>
      <display-name>RichFaces Filter</display-name>
      <filter-name>richfaces</filter-name>
      <filter-class>org.ajax4jsf.Filter</filter-class>
      </filter>
      <filter-mapping>
      <filter-name>richfaces</filter-name>
      <servlet-name>Faces Servlet</servlet-name>
      <dispatcher>REQUEST</dispatcher>
      <dispatcher>FORWARD</dispatcher>
      <dispatcher>INCLUDE</dispatcher>
      </filter-mapping>

      <!-- Faces Servlet -->
      <servlet>
      <servlet-name>Faces Servlet</servlet-name>
      <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
      <load-on-startup>1</load-on-startup>
      </servlet>
      <!-- Faces Servlet Mapping -->
      <servlet-mapping>
      <servlet-name>Faces Servlet</servlet-name>
      <url-pattern>*.jsf</url-pattern>
      </servlet-mapping>
      </web-app>


      Faces-config.xml


      <?xml version="1.0" encoding="UTF-8"?>
      <!--
      Copyright 2003 Sun Microsystems, Inc. All rights reserved.
      SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
      -->
      <!DOCTYPE faces-config PUBLIC
      "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
      "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">

      <faces-config>
      <application>
      <locale-config>
      <default-locale>en</default-locale>
      </locale-config>
      </application>

      <factory>
      <application-factory>
      org.apache.beehive.netui.pageflow.faces.PageFlowApplicationFactory
      </application-factory>
      </factory>
      <managed-bean>
      <managed-bean-name>personBean</managed-bean-name>
      <managed-bean-class>bean.PersonBean</managed-bean-class>
      <managed-bean-scope>request</managed-bean-scope>
      </managed-bean>

      <managed-bean>
      <description>UsernName Bean</description>
      <managed-bean-name>userBean</managed-bean-name>
      <managed-bean-class>bean.UserBean</managed-bean-class>
      <managed-bean-scope>request</managed-bean-scope>
      <managed-property>
      <property-name>name</property-name>
      <property-class>java.lang.String</property-class>
      <value/>
      </managed-property>
      </managed-bean>


      <navigation-rule>
      <from-view-id>/portlets/RegisterPage.jsp</from-view-id>
      <navigation-case>
      <from-outcome>registration</from-outcome>
      <to-view-id>/portlets/ResultsPage.jsp</to-view-id>
      </navigation-case>
      </navigation-rule>
      </faces-config>


      Any response / solution is much appreciated

      ~ Prakash.