1 Reply Latest reply on Jan 8, 2008 12:37 PM by Kenny A. Chaffin

    PROBLEM: Cannot find FacesContext while accessing the page w

    Pawel Radecki Newbie

      Hi there,

      When I hit my JSF application (URL: http://localhost:8080/myapp/index.jsf) deployed to Jboss-portal I get Exception below.

      My environment:
      + jboss-portal-2.6.2.GA
      + jdk1.6.0_03
      + Windows XP

      2008-01-01 12:51:30,703 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/myapp].[jsp]] Servlet.service() for servlet jsp threw exception
      java.lang.RuntimeException: Cannot find FacesContext
      at javax.faces.webapp.UIComponentClassicTagBase.getFacesContext(UIComponentClassicTagBase.java:1796)


      My faces-config.xml:
      ------------------------
      <?xml version="1.0"?>
      <!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>

      <managed-bean>
      <managed-bean-name>bean</managed-bean-name>
      <managed-bean-class>SampleBean</managed-bean-class>
      <managed-bean-scope>session</managed-bean-scope>
      </managed-bean>

      <managed-bean>
      <managed-bean-name>bean2</managed-bean-name>
      <managed-bean-class>SampleBean2</managed-bean-class>
      <managed-bean-scope>session</managed-bean-scope>
      </managed-bean>

      </faces-config>


      My web.xml:
      --------------
      <?xml version="1.0"?>
      <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>


      <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>

      <login-config>
      <auth-method>BASIC</auth-method>
      </login-config>

      </web-app>

      Any ideas why is this exception thrown...?

      Looking forward to any answer.
      Thanks in advance!

      --
      Pawe? Radecki
      e: pawel.j.radecki@gmail.com
      w: http://radeckimarch.blogspot.com/