IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

JSF Java Discussion :

[Débutant][JSF]Faces context not found


Sujet :

JSF Java

  1. #1
    Membre averti
    Profil pro
    Inscrit en
    Décembre 2003
    Messages
    14
    Détails du profil
    Informations personnelles :
    Âge : 46
    Localisation : Belgique

    Informations forums :
    Inscription : Décembre 2003
    Messages : 14
    Par défaut [Débutant][JSF]Faces context not found
    Bonjour,
    Quand je tente d'utiliser des tag JSF dans mes JSP j'obtiens une exception.
    Voici la trace de l'exception reçue :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    13:24:34,732 ERROR [UIComponentTag] Faces context not found. getResponseWriter will fail. Check if the FacesServlet has been initialized at all in your web.xml.
    13:24:34,810 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception
    java.lang.NullPointerException
    	at javax.faces.webapp.UIComponentTag.setupResponseWriter(UIComponentTag.java:929)
    	at javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:310)
    	at org.apache.jsp.jsp.index_jsp._jspx_meth_h_outputText_0(index_jsp.java:85)
    	at org.apache.jsp.jsp.index_jsp._jspService(index_jsp.java:59)
    	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:334)
    	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.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
    	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.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
    	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:869)
    	at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
    	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(Thread.java:534)
    Voici mon fichier web.xml :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    <?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">
    	<!-- Configuration de JSF -->
    	<context-param>
    		<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
    		<param-value>client</param-value>
    	</context-param>	
    	<context-param>
    		<param-name>javax.faces.CONFIG_FILES</param-name>
    		<param-value>/WEB-INF/faces-config.xml</param-value>
    	</context-param>
     
    	<servlet>
    		<servlet-name>FacesServlet</servlet-name>
    		<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    		<load-on-startup>1</load-on-startup>
    	</servlet>
    	<servlet-mapping>
    		<servlet-name>FacesServlet</servlet-name>
    		<url-pattern>/faces/*</url-pattern>
    	</servlet-mapping>
    	<!-- Fin de la configuration de JSF -->
     
    	<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>
    </web-app>
    Voici mon fichier faces-config.xml :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    <?xml version="1.0"?>
    <!--
    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>fr</default-locale>
        </locale-config>
      </application>
    </faces-config>
    Voici enfin le code de ma page JSP :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    <%@ page contentType="text/html" %>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="core" %>
    <core:view>
    	<html:outputText value="Hello le World ! (en JSF !)" />
    </core:view>
    Avec ces informations, pouvez-vous me dire comment corriger le problème ?

    Merci d'avance.

    hubeaul

  2. #2
    Membre chevronné
    Profil pro
    Inscrit en
    Janvier 2006
    Messages
    511
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Janvier 2006
    Messages : 511
    Par défaut
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>

    <html:outputText value="Hello le World ! (en JSF !)" />

    Ton prefix c'est h et pas html...

    A part ça je ne vois rien qui me semble anormal

  3. #3
    Membre averti
    Profil pro
    Inscrit en
    Décembre 2003
    Messages
    14
    Détails du profil
    Informations personnelles :
    Âge : 46
    Localisation : Belgique

    Informations forums :
    Inscription : Décembre 2003
    Messages : 14
    Par défaut
    Bonjour,

    Je viens de corriger cette erreur, mais maintenant j'obtiens une StackOverflowError.
    Voici la trace de l'erreur :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    15:46:49,334 ERROR [[FacesServlet]] Servlet.service() for servlet FacesServlet threw exception
    java.lang.StackOverflowError
    15:46:49,334 ERROR [[FacesServlet]] Servlet.service() for servlet FacesServlet threw exception
    javax.faces.FacesException: javax.servlet.ServletException
    	at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:429)
    	at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:211)
    	at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41)
    	at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:132)
    	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:140)
    	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.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:419)
    	at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:211)
    	at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41)
    	at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:132)
    	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:140)
    	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.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:419)
    	at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:211)
    	at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41)
    	at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:132)
    	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:140)
    Quelqu'un aurait-il une idée pour corriger cette nouvelle erreur ?

    hubeaul

  4. #4
    Membre averti
    Profil pro
    Inscrit en
    Décembre 2003
    Messages
    14
    Détails du profil
    Informations personnelles :
    Âge : 46
    Localisation : Belgique

    Informations forums :
    Inscription : Décembre 2003
    Messages : 14
    Par défaut
    Le problème est résolu, mais je ne sais absolument pas quelle est la solution.

    hlionel

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Début Jsf Faces Contexte Sessions
    Par Bobble dans le forum JSF
    Réponses: 9
    Dernier message: 26/07/2010, 16h11
  2. Réponses: 2
    Dernier message: 19/02/2010, 16h55
  3. Réponses: 2
    Dernier message: 04/03/2009, 20h37
  4. JSF Faces Context
    Par sam.fet dans le forum JSF
    Réponses: 1
    Dernier message: 10/12/2007, 21h20
  5. [JSF] JspServlet class not found
    Par anitshka dans le forum Servlets/JSP
    Réponses: 5
    Dernier message: 22/07/2005, 10h44

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo