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

Spring Java Discussion :

"Servlet.init()" pour la servlet Inscription a généré une exception


Sujet :

Spring Java

  1. #1
    Membre averti
    Femme Profil pro
    etudiant
    Inscrit en
    Février 2013
    Messages
    16
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : Algérie

    Informations professionnelles :
    Activité : etudiant
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Février 2013
    Messages : 16
    Par défaut "Servlet.init()" pour la servlet Inscription a généré une exception
    Bonjour à tous,
    S'il vous plaît, j'ai un probleme lors d'execution d'une servlet inscription.
    j'ai l'erreur suivante "message "Servlet.init()" pour la servlet Inscription a généré une exception"
    sachant que ma fonction init() contient l'instruction suivante
    this.utilisateurDao = ( (DAOFactory) getServletContext().getAttribute( CONF_DAO_FACTORY )).getUtilisateurDao();
    merci d'avance de votre attention

  2. #2
    Expert éminent
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 482
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 46
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 482
    Par défaut
    Citation Envoyé par Angel_flower Voir le message
    "Servlet.init()" pour la servlet Inscription a généré une exception"
    Ben tu nous poste l'exception complète et on t'aidera

  3. #3
    Membre averti
    Femme Profil pro
    etudiant
    Inscrit en
    Février 2013
    Messages
    16
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : Algérie

    Informations professionnelles :
    Activité : etudiant
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Février 2013
    Messages : 16
    Par défaut
    Etat HTTP 500 - "Servlet.init()" pour la servlet Inscription a généré une exception

    --------------------------------------------------------------------------------

    type Rapport d'exception

    message "Servlet.init()" pour la servlet Inscription a généré une exception

    description Le serveur a rencontré une erreur interne qui l'a empêché de satisfaire la requête.

    exception

    javax.servlet.ServletException: "Servlet.init()" pour la servlet Inscription a généré une exception
    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
    org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
    org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
    org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)
    org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
    java.lang.Thread.run(Unknown Source)


    cause mère

    java.lang.NullPointerException
    com.sdzee.servlets.Inscription.init(Inscription.java:22)
    javax.servlet.GenericServlet.init(GenericServlet.java:212)
    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
    org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
    org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
    org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)
    org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
    java.lang.Thread.run(Unknown Source)


    note La trace complète de la cause mère de cette erreur est disponible dans les fichiers journaux de Apache Tomcat/6.0.36.


    --------------------------------------------------------------------------------

    Apache Tomcat/6.0.36

  4. #4
    Membre averti
    Femme Profil pro
    etudiant
    Inscrit en
    Février 2013
    Messages
    16
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : Algérie

    Informations professionnelles :
    Activité : etudiant
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Février 2013
    Messages : 16
    Par défaut
    j'ai réglé ce probleme c'était un probleme 2 listner.il falait rajouter la commande suivante au fichier .xml
    "<listener>
    <listener-class>com.sdzee.config.InitialisationDaoFactory</listener-class>
    </listener>"

    Mais cette fois j'ai une autre erreur lors de l'inscription

    Etat HTTP 404 -

    --------------------------------------------------------------------------------

    type Rapport d'état

    message

    description La ressource demandée n'est pas disponible.

  5. #5
    Expert éminent
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 482
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 46
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 482
    Par défaut
    Tu demande une page qui n'existe pas dans ton application, simplement.

  6. #6
    Membre averti
    Femme Profil pro
    etudiant
    Inscrit en
    Février 2013
    Messages
    16
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : Algérie

    Informations professionnelles :
    Activité : etudiant
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Février 2013
    Messages : 16
    Par défaut
    Voiçi le fichier web.xml normalement j'ai toutes les classes
    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
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app 
    xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
    http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
    version="3.0">
    <listener>
     <listener-class>com.sdzee.config.InitialisationDaoFactory</listener-class>
    </listener>
    <jsp-config>
    <jsp-property-group>
    <url-pattern>*.jsp</url-pattern>
    <el-ignored>false</el-ignored>
    </jsp-property-group>
    </jsp-config>
    <servlet>
    <servlet-name>Inscription</servlet-name>
    <servlet-class>com.sdzee.servlets.Inscription</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>Inscription</servlet-name>
    <url-pattern>/inscription</url-pattern>
    </servlet-mapping>
    </web-app>

  7. #7
    Expert éminent
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 482
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 46
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 482
    Par défaut
    C'est la page que tu demande qui n'existe pas, ça n'a rien à voir avec tes classes normalement, c'est juste que tu pointe ton browser sur un document inexistant => 404

  8. #8
    Membre averti
    Femme Profil pro
    etudiant
    Inscrit en
    Février 2013
    Messages
    16
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : Algérie

    Informations professionnelles :
    Activité : etudiant
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Février 2013
    Messages : 16
    Par défaut
    je suis vraiment dsl pour le dérangement mais la page q j'ai demandée
    "http://localhost:8080/prjDAO/inscription"
    sachant que j'ai la page jsp
    inscription.jsp

  9. #9
    Expert éminent
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 482
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 46
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 482
    Par défaut
    Tu a des messages d'erreur? On peux voir le code de ta servlet inscription?

  10. #10
    Membre averti
    Femme Profil pro
    etudiant
    Inscrit en
    Février 2013
    Messages
    16
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : Algérie

    Informations professionnelles :
    Activité : etudiant
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Février 2013
    Messages : 16
    Par défaut
    bon, premièrement, quand j'ai fait la servlet Inscription et inscription.jsp sans acceder à la base de donnée tout marche bien mais le probleme vient quand je suis passé au DAO et j'ai essayé d'effectuer l'opération d'inscription sur la BDD

    voila le code inscription.jsp

    Code html : 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
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    <%@ page pageEncoding="UTF-8" %>
    <%@ page isELIgnored ="false" %>
    <%@page import="com.sdzee.bean.Utilisateur" %>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="utf-8" />
    <title>Inscription</title>
    <link type="text/css" rel="stylesheet" href="form.css" />
    </head>
    <body>
    <form method="post" action="inscription">
    <fieldset>
    <legend>Inscription</legend>
    <p>Vous pouvez vous inscrire via ce formulaire.</p>
    <label for="email">Adresse email <span
    class="requis">*</span></label>
    <input type="email" id="email" name="email"
    value="" size="20"
    maxlength="60" />
    <span class="erreur">${form.erreurs['email']}</span>
    <br />
    <label for="motdepasse">Mot de passe <span
    class="requis">*</span></label>
    <input type="password" id="motdepasse"
    name="motdepasse" value="" size="20" maxlength="20" />
    <span
    class="erreur">${form.erreurs['motdepasse']}</span>
    <br />
    <label for="confirmation">Confirmation du mot de
    passe <span class="requis">*</span></label>
    <input type="password" id="confirmation"
    name="confirmation" value="" size="20" maxlength="20" />
    <span
    class="erreur">${form.erreurs['confirmation']}</span>
    <br />
    <label for="nom">Nom d'utilisateur</label>
    <input type="text" id="nom" name="nom" value="<c:out
    value="${utilisateur.nom}"/>" size="20" maxlength="20" />
    <span class="erreur">${form.erreurs['nom']}</span>
    <br />
    <input type="submit" value="Inscription"
    class="sansLabel" />
    <br />
    <p class="${empty form.erreurs ? 'succes' :'erreur'}">${form.resultat}</p>
    </fieldset>
    </form>
    </body>
    </html>





    la trace de l'erreur est la suivante:
    Code x : 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
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    févr. 06, 2013 9:10:39 PM org.apache.catalina.core.AprLifecycleListener init
    Infos: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre7\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files/Java/jre7/bin/client;C:/Program Files/Java/jre7/bin;C:/Program Files/Java/jre7/lib/i386;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\oraclexe\app\oracle\product\11.2.0\server\bin;;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Windows Live\Shared;C:\Users\acer\Desktop\eclipse;;.
    févr. 06, 2013 9:10:39 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
    Avertissement: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:projet' did not find a matching property.
    févr. 06, 2013 9:10:39 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
    Avertissement: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:prjDAO' did not find a matching property.
    févr. 06, 2013 9:10:39 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
    Avertissement: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:prj' did not find a matching property.
    févr. 06, 2013 9:10:39 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
    Avertissement: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:projetfin' did not find a matching property.
    févr. 06, 2013 9:10:39 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
    Avertissement: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.j2ee.server:GestionAnnonces' did not find a matching property.
    févr. 06, 2013 9:10:40 PM org.apache.coyote.http11.Http11Protocol init
    Infos: Initialisation de Coyote HTTP/1.1 sur http-8080
    févr. 06, 2013 9:10:40 PM org.apache.catalina.startup.Catalina load
    Infos: Initialization processed in 884 ms
    févr. 06, 2013 9:10:40 PM org.apache.catalina.core.StandardService start
    Infos: Démarrage du service Catalina
    févr. 06, 2013 9:10:40 PM org.apache.catalina.core.StandardEngine start
    Infos: Starting Servlet Engine: Apache Tomcat/6.0.36
    févr. 06, 2013 9:10:40 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
    Infos: validateJarFile(E:\apache6\webapps\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\prjDAO\WEB-INF\lib\servlet-api.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
    févr. 06, 2013 9:10:41 PM org.apache.catalina.core.StandardContext listenerStart
    Grave: Exception lors de l'envoi de l'évènement contexte initialisé (context initialized) à l'instance de classe d'écoute (listener) com.sdzee.config.InitialisationDaoFactory
    com.sdzee.dao.DAOConfigurationException: Le fichier properties /com/sdzee/dao/dao.properties est introuvable.
    	at com.sdzee.dao.DAOFactory.getInstance(DAOFactory.java:42)
    	at com.sdzee.config.InitialisationDaoFactory.contextInitialized(InitialisationDaoFactory.java:17)
    	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4206)
    	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4705)
    	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
    	at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
    	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
    	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
    	at org.apache.catalina.core.StandardService.start(StandardService.java:525)
    	at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
    	at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    	at java.lang.reflect.Method.invoke(Unknown Source)
    	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
    	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
    
    févr. 06, 2013 9:10:41 PM org.apache.catalina.core.StandardContext start
    Grave: Error listenerStart
    févr. 06, 2013 9:10:41 PM org.apache.catalina.core.StandardContext start
    Grave: Erreur de démarrage du contexte [/prjDAO] suite aux erreurs précédentes
    févr. 06, 2013 9:10:41 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
    Infos: validateJarFile(E:\apache6\webapps\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\projetfin\WEB-INF\lib\servlet-api.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
    févr. 06, 2013 9:10:41 PM org.apache.coyote.http11.Http11Protocol start
    Infos: Démarrage de Coyote HTTP/1.1 sur http-8080
    févr. 06, 2013 9:10:41 PM org.apache.jk.common.ChannelSocket init
    Infos: JK: ajp13 listening on /0.0.0.0:8009
    févr. 06, 2013 9:10:41 PM org.apache.jk.server.JkMain start
    Infos: Jk running ID=0 time=0/40  config=null
    févr. 06, 2013 9:10:41 PM org.apache.catalina.startup.Catalina start
    Infos: Server startup in 1237 ms

    je pense que la cause de l'erreur est là dans la classe inscription qui contient cette méthode

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    public void init() throws ServletException {
    		/* Récupération d'une instance de notre DAO Utilisateur */
    this.utilisateurDao = ( (DAOFactory) getServletContext().getAttribute( CONF_DAO_FACTORY )).getUtilisateurDao();
    	}
    merci d'avance

  11. #11
    Expert éminent
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 482
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 46
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 482
    Par défaut
    Cette erreur
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    com.sdzee.dao.DAOConfigurationException: Le fichier properties /com/sdzee/dao/dao.properties est introuvable.
    	at com.sdzee.dao.DAOFactory.getInstance(DAOFactory.java:42)
    	at com.sdzee.config.InitialisationDaoFactory.contextInitialized(InitialisationDaoFactory.java:17)
    Empêche ton application de démarrer.

    La raison y est indiquée.

  12. #12
    Membre averti
    Femme Profil pro
    etudiant
    Inscrit en
    Février 2013
    Messages
    16
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : Algérie

    Informations professionnelles :
    Activité : etudiant
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Février 2013
    Messages : 16
    Par défaut
    merci beaucoup pour votre aide monsieur, c'est bon j'ai réglé le problème;
    la cause est qu'avant il arrive pas a accéder au fichier propreties qui contient les informations d'acces a la BDD. j'ai totalement enlevé et j'ai directement mis url et les autre information dans la classe
    merci une autre fois c'est trés gentil

  13. #13
    Membre averti
    Femme Profil pro
    etudiant
    Inscrit en
    Février 2013
    Messages
    16
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : Algérie

    Informations professionnelles :
    Activité : etudiant
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Février 2013
    Messages : 16
    Par défaut
    Encore désolé
    cette fois j'ai l'erreur suivante lors de l'accées a la BDD
    Etat HTTP 500 - org.postgresql.util.PSQLException: FATAL: authentification par mot de passe �chou�e pour l'utilisateur � postgres �
    Est-ce que je me suis trompé dans le mot de passe !!

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

Discussions similaires

  1. Réponses: 1
    Dernier message: 10/04/2012, 20h12
  2. Servlet.service() a généré une exception
    Par M.a.n.u. dans le forum JSF
    Réponses: 8
    Dernier message: 23/03/2009, 16h11
  3. [Servlet]init param context de servlet
    Par david06600 dans le forum Servlets/JSP
    Réponses: 1
    Dernier message: 10/08/2006, 11h12
  4. la servlet action a généré une exception
    Par tdudouet dans le forum Servlets/JSP
    Réponses: 4
    Dernier message: 12/05/2006, 22h11

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