0 Replies Latest reply on Sep 30, 2008 3:35 AM by Supriya S

    Cannot find FacesContext - Runtime Exception

    Supriya S Newbie

      Hi all ,

      I am new to richfaces and am trying to deploy my app in jboss. It deploys complelty , but while i try to open the page , it gives me runtime exception.
      here are my web.xml, faces-config.xml and the jspx page.

      web.xml
      <?xml version="1.0" encoding="UTF-8"?>
      <web-app 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>a4jEchoText</display-name>
      <context-param>
      <param-name>org.richfaces.SKIN</param-name>
      <param-value>blueSky</param-value>
      </context-param>

      <context-param>
      <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
      <param-value>server</param-value>
      </context-param>


      <display-name>RichFaces Filter</display-name>
      <filter-name>richfaces</filter-name>
      <filter-class>org.ajax4jsf.Filter</filter-class>


      <filter-mapping>
      <filter-name>richfaces</filter-name>
      <servlet-name>Faces Servlet</servlet-name>
      REQUEST
      FORWARD
      INCLUDE
      </filter-mapping>


      <display-name>Ajax4jsf Filter</display-name>
      <filter-name>ajax4jsf</filter-name>
      <filter-class>org.ajax4jsf.Filter</filter-class>


      <filter-mapping>
      <filter-name>ajax4jsf</filter-name>
      <servlet-name>Faces Servlet</servlet-name>
      FORWARD
      REQUEST
      INCLUDE
      </filter-mapping>


      <listener-class>com.sun.faces.config.ConfigureListener</listener-class>

      <!-- Faces Servlet -->


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


      <!-- Faces Servlet Mapping -->
      <servlet-mapping>
      <servlet-name>Faces Servlet</servlet-name>
      <url-pattern>*.jsf</url-pattern>
      </servlet-mapping>

      <!-- Welcome files -->
      <welcome-file-list>
      <welcome-file>echo.jspx</welcome-file>

      </welcome-file-list>

      </web-app>

      faces-config.xml

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN" "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
      <faces-config>
      <managed-bean>
      <managed-bean-name>userBean</managed-bean-name>
      <managed-bean-class>com.richfacedemo.beans.UserBean</managed-bean-class>
      <managed-bean-scope>request</managed-bean-scope>
      </managed-bean>

      <navigation-rule>
      <from-view-id>*</from-view-id>
      <navigation-case>

      <to-view-id>echo.jspx</to-view-id>
      </navigation-case>
      </navigation-rule>

      </faces-config>


      echo.jspx

      <ui:composition xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:a4j="http://richfaces.org/a4j"
      xmlns:rich="http://richfaces.org/rich">

      <h:form>
      <rich:panel bodyClass="rich-laguna-panel-no-header">
      <a4j:commandButton value="Set Name to Alex" reRender="rep" >
      <a4j:actionparam name="username" value="Alex" assignTo="#{userBean.name}"/>
      </a4j:commandButton>
      <rich:spacer width="20" />
      <a4j:commandButton value="Set Name to John" reRender="rep" >
      <a4j:actionparam name="username" value="John" assignTo="#{userBean.name}"/>
      </a4j:commandButton>
      </rich:panel>
      <rich:spacer height="1" />
      <rich:panel bodyClass="rich-laguna-panel-no-header">
      <h:outputText id="rep" value="Selected Name:#{userBean.name}"/>
      </rich:panel>
      </h:form>
      </ui:composition>

      ------------------
      can anyone please help me to know about the exact problem?

      Thanks in advance
      Supriya