5 Replies Latest reply on Jun 29, 2006 6:36 AM by niki todorov

    ERROR [UIComponentTag] Faces context not found. getResponseW

    Jose Antonio Alarcon Newbie

      Hi

      I'm making my first application with jfs. But I have got errors when I try to open the pages

      I'm using jboss-4.0.4RC1 with Myfaces.

      My jsp file is

      <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
      <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
      pageEncoding="ISO-8859-1"%>
      <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
      <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>


      <%//@ taglib uri="/WEB-INF/lib/html_basic.tld" prefix="h"%>
      <%//@ taglib uri="/WEB-INF/lib/jsf_core.tld" prefix="f"%>




      <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
      propiedad


      <f:view>
      <h:form id="Propiedad List">

      <h:outputLabel for="address">
      <h:outputText id="addressLabel"
      value="User Home Address"/>
      </h:outputLabel>

      </h:form>

      </f:view>





      the file faces-config.xml


      <?xml version="1.0"?>
      <!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>


      <message-bundle>com.jboss.jose.web</message-bundle>
      <locale-config>
      <default-locale>es</default-locale>
      <supported-locale>en</supported-locale>
      </locale-config>


      <!--
      - managed beans
      -->
      <managed-bean>
      <managed-bean-name>PropiedadesBean</managed-bean-name>
      <managed-bean-class>org.jboss.jose.db.PropiedadesBean</managed-bean-class>
      <managed-bean-scope>session</managed-bean-scope>
      <managed-property>
      <property-name>propiedadesBean</property-name>
      #{propiedad}
      </managed-property>
      </managed-bean>


      <!--
      - navigation rules
      -->
      <navigation-rule>
      <from-view-id>/paginas/propiedades.jsp</from-view-id>
      </navigation-rule>
      </faces-config>




      the files web.xml

      <?xml version="1.0"?>

      <!--
      * Copyright 2004 The Apache Software Foundation.
      *
      * Licensed under the Apache License, Version 2.0 (the "License");
      * you may not use this file except in compliance with the License.
      * You may obtain a copy of the License at
      *
      * http://www.apache.org/licenses/LICENSE-2.0
      *
      * Unless required by applicable law or agreed to in writing, software
      * distributed under the License is distributed on an "AS IS" BASIS,
      * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
      * See the License for the specific language governing permissions and
      * limitations under the License.
      -->

      <!DOCTYPE web-app PUBLIC
      "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
      "http://java.sun.com/dtd/web-app_2_3.dtd">

      <web-app>

      <!-- <context-param>
      <param-name>javax.faces.CONFIG_FILES</param-name>
      <param-value>
      /WEB-INF/examples-config.xml
      </param-value>

      Comma separated list of URIs of (additional) faces config files.
      (e.g. /WEB-INF/my-config.xml)
      See JSF 1.0 PRD2, 10.3.2

      </context-param>
      -->


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

      State saving method: "client" or "server" (= default)
      See JSF Specification 2.5.2

      </context-param>

      <context-param>
      <param-name>org.apache.myfaces.ALLOW_JAVASCRIPT</param-name>
      <param-value>true</param-value>

      This parameter tells MyFaces if javascript code should be allowed in the
      rendered HTML output.
      If javascript is allowed, command_link anchors will have javascript code
      that submits the corresponding form.
      If javascript is not allowed, the state saving info and nested parameters
      will be added as url parameters.
      Default: "true"

      </context-param>

      <context-param>
      <param-name>org.apache.myfaces.DETECT_JAVASCRIPT</param-name>
      <param-value>false</param-value>

      This parameter tells MyFaces if javascript code should be allowed in the
      rendered HTML output.
      If javascript is allowed, command_link anchors will have javascript code
      that submits the corresponding form.
      If javascript is not allowed, the state saving info and nested parameters
      will be added as url parameters.
      Default: "false"

      Setting this param to true should be combined with STATE_SAVING_METHOD "server" for
      best results.

      This is an EXPERIMENTAL feature. You also have to enable the detector filter/filter mapping below to get
      JavaScript detection working.

      </context-param>

      <context-param>
      <param-name>org.apache.myfaces.PRETTY_HTML</param-name>
      <param-value>true</param-value>

      If true, rendered HTML code will be formatted, so that it is "human readable".
      i.e. additional line separators and whitespace will be written, that do not
      influence the HTML code.
      Default: "true"

      </context-param>

      <context-param>
      <param-name>org.apache.myfaces.AUTO_SCROLL</param-name>
      <param-value>true</param-value>

      If true, a javascript function will be rendered that is able to restore the
      former vertical scroll on every request. Convenient feature if you have pages
      with long lists and you do not want the browser page to always jump to the top
      if you trigger a link or button action that stays on the same page.
      Default: "false"

      </context-param>


      <!-- WelcomeFile Filter -->
      <!--

      <filter-name>WelcomeFile Filter</filter-name>
      <filter-class>org.apache.myfaces.webapp.filter.WelcomeFileFilter</filter-class>

      Due to the manner in which the JSP / servlet lifecycle
      functions, it is not currently possible to specify default
      welcome files for a web application and map them to the
      MyFacesServlet. Normally they will be mapped to the
      default servlet for the JSP container. To offset this
      shortcoming, we utilize a servlet Filter which examines
      the URI of all incoming requests.


      -->

      <!-- JavaScriptDetector Filter -->
      <!-- -->
      <!-- <filter-name>javascriptDetector</filter-name>-->
      <!-- <filter-class>org.apache.myfaces.webapp.filter.JavaScriptDetectorFilter</filter-class>-->
      <!-- -->


      <!-- Extensions Filter -->

      <filter-name>extensionsFilter</filter-name>
      <filter-class>org.apache.myfaces.component.html.util.ExtensionsFilter</filter-class>
      <init-param>
      <param-name>uploadMaxFileSize</param-name>
      <param-value>100m</param-value>
      Set the size limit for uploaded files.
      Format: 10 - 10 bytes
      10k - 10 KB
      10m - 10 MB
      1g - 1 GB

      </init-param>
      <init-param>
      <param-name>uploadThresholdSize</param-name>
      <param-value>100k</param-value>
      Set the threshold size - files
      below this limit are stored in memory, files above
      this limit are stored on disk.

      Format: 10 - 10 bytes
      10k - 10 KB
      10m - 10 MB
      1g - 1 GB

      </init-param>
      <!-- <init-param>
      <param-name>uploadRepositoryPath</param-name>
      <param-value>/temp</param-value>
      Set the path where the intermediary files will be stored.

      </init-param>-->



      <!-- Filter Mappings -->

      <!-- see MyFaces Filter above for a description -->
      <!--
      <filter-mapping>
      <filter-name>WelcomeFile Filter</filter-name>
      <url-pattern>/*</url-pattern>
      </filter-mapping>
      -->

      <!-- <filter-mapping>-->
      <!-- <filter-name>javascriptDetector</filter-name>-->
      <!-- <url-pattern>/_javascriptDetector_</url-pattern>-->
      <!-- </filter-mapping>-->


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



      <!-- Listener, that does all the startup work (configuration, init). -->



      <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>


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

      <!-- virtual path mapping -->

      <servlet-mapping>
      <servlet-name>Faces Servlet</servlet-name>
      <url-pattern>/faces/*</url-pattern>
      </servlet-mapping>

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


      <!-- Welcome files -->

      <welcome-file-list>
      <welcome-file>index.jsf</welcome-file>
      <welcome-file>index.jsp</welcome-file>
      <welcome-file>index.html</welcome-file>
      </welcome-file-list>


      </web-app>




      the errors show me


      13:37:03,801 ERROR [UIComponentTag] Faces context not found. getResponseWriter will fail. Check if the FacesServlet has been initialized at all in your web.xml.
      13:37:03,821 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception
      java.lang.NullPointerException
      at javax.faces.webapp.UIComponentTag.setupResponseWriter(UIComponentTag.java:615)
      at javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:217)
      at org.apache.myfaces.taglib.core.ViewTag.doStartTag(ViewTag.java:71)
      at org.apache.jsp.paginas.propiedades_jsp._jspx_meth_f_view_0(org.apache.jsp.paginas.propiedades_jsp:117)
      at org.apache.jsp.paginas.propiedades_jsp._jspService(org.apache.jsp.paginas.propiedades_jsp:92)
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
      at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
      at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
      at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
      at org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:693)
      at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:660)
      at org.apache.jsp.index_jsp._jspService(org.apache.jsp.index_jsp:49)
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
      at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:54)
      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:174)
      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:868)
      at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:663)
      at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
      at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
      at java.lang.Thread.run(Unknown Source)
      13:37:03,831 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception
      java.lang.NullPointerException
      at javax.faces.webapp.UIComponentTag.setupResponseWriter(UIComponentTag.java:615)
      at javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:217)
      at org.apache.myfaces.taglib.core.ViewTag.doStartTag(ViewTag.java:71)
      at org.apache.jsp.paginas.propiedades_jsp._jspx_meth_f_view_0(org.apache.jsp.paginas.propiedades_jsp:117)
      at org.apache.jsp.paginas.propiedades_jsp._jspService(org.apache.jsp.paginas.propiedades_jsp:92)
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
      at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
      at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
      at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
      at org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:693)
      at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:660)
      at org.apache.jsp.index_jsp._jspService(org.apache.jsp.index_jsp:49)
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
      at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:54)
      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:174)
      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:868)
      at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:663)
      at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
      at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
      at java.lang.Thread.run(Unknown Source)




      I don't undestand this error. Can anyone help me?

      Regards

      Thank you very much.