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

Servlets/JSP Java Discussion :

Erreur 404 pas d'accès a la servlet


Sujet :

Servlets/JSP Java

  1. #1
    Membre du Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Juin 2013
    Messages
    174
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Val d'Oise (Île de France)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Juin 2013
    Messages : 174
    Points : 51
    Points
    51
    Par défaut Erreur 404 pas d'accès a la servlet
    Bonjour ,

    Voila je suis le tuto celui de la programmation JEE , je suis dans le chapitre des DAO , j'ai tout mis en place , mais j'ai un problème dans la servlet "MembreInscription" quand je l'exécute pour aller vers le formulaire dans le WEB-INF ça me donne cette erreur :

    Etat HTTP 404 - /Projet/inscription
    type Rapport d''état

    message /Projet/inscription

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

    Apache Tomcat/7.0.41


    Pourtant , j'ai déclaré ma servlet dans le web.xml et le serveur Tomcat 7 est en mode Started,Synchronised , j'ai redemandé nombreuse fois mais le problème persiste , j'ai pensé que le problème viens de Init() que je viens d'ajouter

    Bref , voila le code du 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
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:jsp="http://java.sun.com/xml/ns/javaee/jsp" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
    **<jsp-config>
    ****<jsp-property-group>
    ******<url-pattern>*.jsp</url-pattern>
    ******<include-prelude>/inc/taglib_jstl.jsp</include-prelude>
    ****</jsp-property-group>
    **</jsp-config>
    **<servlet>
    ****<servlet-name>MembreInscription</servlet-name>
    ****<servlet-class>com.project.servlets.MembreInscription</servlet-class>
    **</servlet>
    **<servlet-mapping>
    ****<servlet-name>MembreInscription</servlet-name>
    ****<url-pattern>/inscription</url-pattern>
    **</servlet-mapping>
    **<listener>
    ****<listener-class>com.project.config.InitialisationDAOFactory</listener-class>
    **</listener>
    **
    *
    </web-app>
    Voila la servlet "MembreInscription" :

    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
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    public class MembreInscription extends HttpServlet {
    ****private static final long** serialVersionUID***** = 1L;
    *
    ****private static final String vue_membreInscription = "/WEB-INF/MembreFormulaire.jsp";
    ****private static final String att_formMembre******* = "MembreForm";
    ****private static final String att_membreBean******* = "MembreBean";
    ****public static final String* DAO_FACTORY********** = "daoFactory";
    *
    ****private MembreDAO********** membredao;
    *
    ****/**
    ****** @see HttpServlet#HttpServlet()
    ******/
    ****public MembreInscription() {
    ********super();
    ********// TODO Auto-generated constructor stub
    ****}
    *
    ****/**
    ****** @see Servlet#init(ServletConfig)
    ******/
    ****public void init( ServletConfig config ) throws ServletException {
    ********this.membredao = ( (DAOFactory) getServletContext().getAttribute( DAO_FACTORY ) ).getMembreDAO();
    ****}
    *
    ****/**
    ****** @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse
    *********** response)
    ******/
    ****protected void doGet( HttpServletRequest request, HttpServletResponse response ) throws ServletException,
    ************IOException {
    ********this.getServletContext().getRequestDispatcher( vue_membreInscription ).forward( request, response );
    *
    ****}
    *
    ****/**
    ****** @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse
    *********** response)
    ******/
    ****protected void doPost( HttpServletRequest request, HttpServletResponse response ) throws ServletException,
    ************IOException {
    *
    ********MembreForms formMembre = new MembreForms( membredao );
    *
    ********Membres membre = formMembre.FormMembre( request );
    *
    ********request.setAttribute( att_formMembre, formMembre );
    ********request.setAttribute( att_membreBean, membre );
    *
    ********this.getServletContext().getRequestDispatcher( vue_membreInscription ).forward( request, response );
    *
    ****}
    }
    L'arborescence de mon projet dans la pièce jointe et merci !
    Images attachées Images attachées  

  2. #2
    Membre actif
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Septembre 2011
    Messages
    196
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Hauts de Seine (Île de France)

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

    Informations forums :
    Inscription : Septembre 2011
    Messages : 196
    Points : 242
    Points
    242
    Par défaut
    Bonjour,
    Je ne suis pas certain mais essaye de mettre dans ton fichier web.xml la ligne suivante pour url-pattern
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <url-pattern>/Projet/inscription</url-pattern>

  3. #3
    Membre du Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Juin 2013
    Messages
    174
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Val d'Oise (Île de France)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Juin 2013
    Messages : 174
    Points : 51
    Points
    51
    Par défaut
    Citation Envoyé par oliv37 Voir le message
    Bonjour,
    Je ne suis pas certain mais essaye de mettre dans ton fichier web.xml la ligne suivante pour url-pattern
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <url-pattern>/Projet/inscription</url-pattern>
    Non ça marche pas , ça donne ce chemin : http://localhost:8080/Projet/Projet/inscription ce qui est pas correcte et j'ai toujours le même problème

  4. #4
    Expert éminent sénior
    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 : 45
    Localisation : Belgique

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

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 482
    Points : 48 804
    Points
    48 804
    Par défaut
    Les autres pages de ton application fonctionnent? Il n'y a pas d'erreur dans les logs de ton tomcat?

  5. #5
    Membre du Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Juin 2013
    Messages
    174
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Val d'Oise (Île de France)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Juin 2013
    Messages : 174
    Points : 51
    Points
    51
    Par défaut
    Bonjour,

    J'ai qu'une seule page jsp dans mon application c'est celle du formulaire d'inscription , dans les logs ça m'affiche ça :

    com.project.dao.DAOConfigurationException: Le fichier /com/project/dao/dao.properties est introuvable"

    Pourtant j'ai bien interger le fichier dao.properties dans le package com.project.dao (Regardez dans l'arborescence en haut) , et j'ai bien écris sont chemin avec l'extension .properties a la fin:

    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
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    public class DAOFactory {
     
        private static String fichier_connection     = "/com/project/dao/dao.properties";
     
        private static String proprieter_url         = "url";
        private static String proprieter_driver      = "driver";
        private static String proprieter_utilisateur = "nomutilisateur";
        private static String proprieter_motDePasse  = "motdepasse";
     
        private String        url;
        private String        utilisateur;
        private String        motDePasse;
     
        public DAOFactory( String url, String utilisateur, String motDePasse ) {
            super();
            this.url = url;
            this.utilisateur = utilisateur;
            this.motDePasse = motDePasse;
        }
     
        public static DAOFactory getInstance() throws DAOConfigurationException {
     
            Properties properties = new Properties();
     
            String url;
            String driver;
            String utilisateur;
            String motDePasse;
     
            ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
            InputStream fichierProperties = classLoader.getResourceAsStream( fichier_connection );
     
            if ( fichierProperties == null ) {
                throw new DAOConfigurationException( "Le fichier " + fichier_connection + " est introuvable" );
            }
     
            try {
                properties.load( fichierProperties );
                url = properties.getProperty( proprieter_url );
                driver = properties.getProperty( proprieter_driver );
                utilisateur = properties.getProperty( proprieter_utilisateur );
                motDePasse = properties.getProperty( proprieter_motDePasse );
     
            } catch ( IOException e ) {
                throw new DAOConfigurationException( "Impossible de charger le fichier properties " + fichier_connection, e );
            }
     
    ....
    Voila ce qu'il m'affiche dans toute la console :

    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
    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
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    juil. 23, 2013 3:22:28 PM org.apache.catalina.core.AprLifecycleListener init
     
    INFO: 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:\app\BilliJoe\product\11.2.0\dbhome_1\bin;C:\Program Files\Broadcom\Broadcom 802.11\Driver;;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Program Files (x86)\AMD APP\bin\x86_64;C:\Program Files (x86)\AMD APP\bin\x86;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\WIDCOMM\Bluetooth Software\;C:\Program Files\WIDCOMM\Bluetooth Software\syswow64;.
     
    juil. 23, 2013 3:22:28 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
     
    WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:Jsp' did not find a matching property.
     
    juil. 23, 2013 3:22:28 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
     
    WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:test' did not find a matching property.
     
    juil. 23, 2013 3:22:28 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
     
    WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:Commande_TP1' did not find a matching property.
     
    juil. 23, 2013 3:22:28 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
     
    WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:Jstl' did not find a matching property.
     
    juil. 23, 2013 3:22:28 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
     
    WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:test_news' did not find a matching property.
     
    juil. 23, 2013 3:22:28 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
     
    WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:jstl_exo1' did not find a matching property.
     
    juil. 23, 2013 3:22:28 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
     
    WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:Gestion_Bibliotheque' did not find a matching property.
     
    juil. 23, 2013 3:22:28 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
     
    WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:Xml' did not find a matching property.
     
    juil. 23, 2013 3:22:28 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
     
    WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:jstl_exo2' did not find a matching property.
     
    juil. 23, 2013 3:22:28 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
     
    WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:bonne_habitude' did not find a matching property.
     
    juil. 23, 2013 3:22:28 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
     
    WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:Pro' did not find a matching property.
     
    juil. 23, 2013 3:22:28 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
     
    WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:location_inscription' did not find a matching property.
     
    juil. 23, 2013 3:22:28 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
     
    WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:Etudiant_test' did not find a matching property.
     
    juil. 23, 2013 3:22:28 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
     
    WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:Session2' did not find a matching property.
     
    juil. 23, 2013 3:22:28 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
     
    WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:Commande2' did not find a matching property.
     
    juil. 23, 2013 3:22:28 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
     
    WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:voiture_location' did not find a matching property.
     
    juil. 23, 2013 3:22:28 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
     
    WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:Gestion_fichier' did not find a matching property.
     
    juil. 23, 2013 3:22:28 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
     
    WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:Gestion_Base' did not find a matching property.
     
    juil. 23, 2013 3:22:28 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
     
    WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:AvecDAO' did not find a matching property.
     
    juil. 23, 2013 3:22:28 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
     
    WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:Projet' did not find a matching property.
     
    juil. 23, 2013 3:22:30 PM org.apache.coyote.AbstractProtocol init
     
    INFO: Initializing ProtocolHandler ["http-bio-8080"]
     
    juil. 23, 2013 3:22:30 PM org.apache.coyote.AbstractProtocol init
     
    INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
     
    juil. 23, 2013 3:22:30 PM org.apache.catalina.startup.Catalina load
     
    INFO: Initialization processed in 2793 ms
     
    juil. 23, 2013 3:22:30 PM org.apache.catalina.core.StandardService startInternal
     
    INFO: Démarrage du service Catalina
     
    juil. 23, 2013 3:22:30 PM org.apache.catalina.core.StandardEngine startInternal
     
    INFO: Starting Servlet Engine: Apache Tomcat/7.0.41
     
    juil. 23, 2013 3:22:32 PM org.apache.catalina.core.StandardContext listenerStart
     
    SEVERE: Exception lors de l'envoi de l'évènement contexte initialisé (context initialized) à l'instance de classe d'écoute (listener) com.dao.config.InitialisationDaoFactory
     
    com.dao.dao.DAOConfigurationException: Le fichier properties /com/dao/dao/dao.properties est introuvable.
     
    at com.dao.dao.DAOFactory.getInstance(DAOFactory.java:43)
     
    at com.dao.config.InitialisationDaoFactory.contextInitialized(InitialisationDaoFactory.java:19)
     
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4887)
     
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5381)
     
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
     
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
     
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
     
    at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
     
    at java.util.concurrent.FutureTask.run(Unknown Source)
     
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
     
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
     
    at java.lang.Thread.run(Unknown Source)
     
    juil. 23, 2013 3:22:32 PM org.apache.catalina.core.StandardContext startInternal
     
    SEVERE: Error listenerStart
     
    juil. 23, 2013 3:22:32 PM org.apache.catalina.core.StandardContext startInternal
     
    SEVERE: Erreur de démarrage du contexte [/AvecDAO] suite aux erreurs précédentes
     
    juil. 23, 2013 3:22:35 PM org.apache.catalina.core.StandardContext listenerStart
     
    SEVERE: Exception lors de l'envoi de l'évènement contexte initialisé (context initialized) à l'instance de classe d'écoute (listener) com.project.config.InitialisationDAOFactory
     
    com.project.dao.DAOConfigurationException: Le fichier /com/project/dao/dao.properties est introuvable
     
    at com.project.dao.DAOFactory.getInstance(DAOFactory.java:43)
     
    at com.project.config.InitialisationDAOFactory.contextInitialized(InitialisationDAOFactory.java:20)
     
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4887)
     
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5381)
     
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
     
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
     
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
     
    at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
     
    at java.util.concurrent.FutureTask.run(Unknown Source)
     
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
     
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
     
    at java.lang.Thread.run(Unknown Source)
     
    juil. 23, 2013 3:22:35 PM org.apache.catalina.core.StandardContext startInternal
     
    SEVERE: Error listenerStart
     
    juil. 23, 2013 3:22:35 PM org.apache.catalina.core.StandardContext startInternal
     
    SEVERE: Erreur de démarrage du contexte [/Projet] suite aux erreurs précédentes
     
    juil. 23, 2013 3:22:36 PM org.apache.coyote.AbstractProtocol start
     
    INFO: Starting ProtocolHandler ["http-bio-8080"]
     
    juil. 23, 2013 3:22:36 PM org.apache.coyote.AbstractProtocol start
     
    INFO: Starting ProtocolHandler ["ajp-bio-8009"]
     
    juil. 23, 2013 3:22:36 PM org.apache.catalina.startup.Catalina start
     
    INFO: Server startup in 5950 ms
    Je pense aussi que peut être ça viens du listener ou de l'init() , car avant que j'ajoute cette derrière , je pouvais accéder a la servlet sans problème

    Et merci pour la réponse .

    Edit :

    J'ai essayer de virer le .txt de mon fichier du package com.project.dao , et ca m'as donner cette erreur :
    Images attachées Images attachées  

  6. #6
    Expert éminent sénior
    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 : 45
    Localisation : Belgique

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

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 482
    Points : 48 804
    Points
    48 804
    Par défaut
    Citation Envoyé par zikyoubi Voir le message

    Pourtant j'ai bien interger le fichier dao.properties dans le package com.project.dao (Regardez dans l'arborescence en haut)
    Quand je regarde ton arborescence, je vois un dao.properties.txt

  7. #7
    Membre du Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Juin 2013
    Messages
    174
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Val d'Oise (Île de France)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Juin 2013
    Messages : 174
    Points : 51
    Points
    51
    Par défaut
    Bug ..

  8. #8
    Membre du Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Juin 2013
    Messages
    174
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Val d'Oise (Île de France)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Juin 2013
    Messages : 174
    Points : 51
    Points
    51
    Par défaut
    J'ai essayer de virer le .txt de mon fichier du package com.project.dao , et ca m'as donner cette erreur (Regardez piece jointe) :

    Pour ce qu'il y as dans ma console voila :

    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
    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
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    juil. 24, 2013 8:52:11 AM org.apache.catalina.core.AprLifecycleListener init
    INFO: 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:\app\BilliJoe\product\11.2.0\dbhome_1\bin;C:\Program Files\Broadcom\Broadcom 802.11\Driver;;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Program Files (x86)\AMD APP\bin\x86_64;C:\Program Files (x86)\AMD APP\bin\x86;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\WIDCOMM\Bluetooth Software\;C:\Program Files\WIDCOMM\Bluetooth Software\syswow64;.
    juil. 24, 2013 8:52:11 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
    WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:Jsp' did not find a matching property.
    juil. 24, 2013 8:52:11 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
    WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:test' did not find a matching property.
    juil. 24, 2013 8:52:11 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
    WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:Commande_TP1' did not find a matching property.
    juil. 24, 2013 8:52:11 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
    WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:Jstl' did not find a matching property.
    juil. 24, 2013 8:52:11 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
    WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:test_news' did not find a matching property.
    juil. 24, 2013 8:52:11 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
    WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:jstl_exo1' did not find a matching property.
    juil. 24, 2013 8:52:11 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
    WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:Gestion_Bibliotheque' did not find a matching property.
    juil. 24, 2013 8:52:11 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
    WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:Xml' did not find a matching property.
    juil. 24, 2013 8:52:11 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
    WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:jstl_exo2' did not find a matching property.
    juil. 24, 2013 8:52:11 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
    WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:bonne_habitude' did not find a matching property.
    juil. 24, 2013 8:52:11 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
    WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:Pro' did not find a matching property.
    juil. 24, 2013 8:52:11 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
    WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:location_inscription' did not find a matching property.
    juil. 24, 2013 8:52:11 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
    WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:Etudiant_test' did not find a matching property.
    juil. 24, 2013 8:52:11 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
    WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:Session2' did not find a matching property.
    juil. 24, 2013 8:52:11 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
    WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:Commande2' did not find a matching property.
    juil. 24, 2013 8:52:11 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
    WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:voiture_location' did not find a matching property.
    juil. 24, 2013 8:52:11 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
    WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:Gestion_fichier' did not find a matching property.
    juil. 24, 2013 8:52:11 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
    WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:Gestion_Base' did not find a matching property.
    juil. 24, 2013 8:52:11 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
    WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:AvecDAO' did not find a matching property.
    juil. 24, 2013 8:52:11 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
    WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:Projet' did not find a matching property.
    juil. 24, 2013 8:52:11 AM org.apache.coyote.AbstractProtocol init
    INFO: Initializing ProtocolHandler ["http-bio-8080"]
    juil. 24, 2013 8:52:11 AM org.apache.coyote.AbstractProtocol init
    INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
    juil. 24, 2013 8:52:11 AM org.apache.catalina.startup.Catalina load
    INFO: Initialization processed in 555 ms
    juil. 24, 2013 8:52:11 AM org.apache.catalina.core.StandardService startInternal
    INFO: Démarrage du service Catalina
    juil. 24, 2013 8:52:11 AM org.apache.catalina.core.StandardEngine startInternal
    INFO: Starting Servlet Engine: Apache Tomcat/7.0.41
    juil. 24, 2013 8:52:12 AM org.apache.catalina.core.StandardContext listenerStart
    SEVERE: Exception lors de l'envoi de l'évènement contexte initialisé (context initialized) à l'instance de classe d'écoute (listener) com.dao.config.InitialisationDaoFactory
    com.dao.dao.DAOConfigurationException: Le fichier properties /com/dao/dao/dao.properties est introuvable.
    	at com.dao.dao.DAOFactory.getInstance(DAOFactory.java:43)
    	at com.dao.config.InitialisationDaoFactory.contextInitialized(InitialisationDaoFactory.java:19)
    	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4887)
    	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5381)
    	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
    	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
    	at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
    	at java.util.concurrent.FutureTask.run(Unknown Source)
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    	at java.lang.Thread.run(Unknown Source)
     
    juil. 24, 2013 8:52:12 AM org.apache.catalina.core.StandardContext startInternal
    SEVERE: Error listenerStart
    juil. 24, 2013 8:52:12 AM org.apache.catalina.core.StandardContext startInternal
    SEVERE: Erreur de démarrage du contexte [/AvecDAO] suite aux erreurs précédentes
    juil. 24, 2013 8:52:15 AM org.apache.coyote.AbstractProtocol start
    INFO: Starting ProtocolHandler ["http-bio-8080"]
    juil. 24, 2013 8:52:15 AM org.apache.coyote.AbstractProtocol start
    INFO: Starting ProtocolHandler ["ajp-bio-8009"]
    juil. 24, 2013 8:52:15 AM org.apache.catalina.startup.Catalina start
    INFO: Server startup in 3285 ms
    juil. 24, 2013 8:52:19 AM org.apache.catalina.core.ApplicationContext log
    SEVERE: StandardWrapper.Throwable
    java.lang.NullPointerException
    	at javax.servlet.GenericServlet.getServletContext(GenericServlet.java:125)
    	at com.project.servlets.MembreInscription.init(MembreInscription.java:44)
    	at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1280)
    	at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1193)
    	at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:865)
    	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:136)
    	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
    	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
    	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
    	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
    	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
    	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
    	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
    	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
    	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    	at java.lang.Thread.run(Unknown Source)
     
    juil. 24, 2013 8:52:19 AM org.apache.catalina.core.StandardWrapperValve invoke
    SEVERE: Exception lors de l'allocation pour la servlet MembreInscription
    java.lang.NullPointerException
    	at javax.servlet.GenericServlet.getServletContext(GenericServlet.java:125)
    	at com.project.servlets.MembreInscription.init(MembreInscription.java:44)
    	at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1280)
    	at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1193)
    	at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:865)
    	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:136)
    	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
    	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
    	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
    	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
    	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
    	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
    	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
    	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
    	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    	at java.lang.Thread.run(Unknown Source)
    Pardon pour le double post , je pense qu'il y avais un bug ..
    Images attachées Images attachées  

  9. #9
    Membre actif
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Septembre 2011
    Messages
    196
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Hauts de Seine (Île de France)

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

    Informations forums :
    Inscription : Septembre 2011
    Messages : 196
    Points : 242
    Points
    242
    Par défaut
    Tu as un NullPointerException à la ligne 44 du fichier MembreInscription.java.
    J'ai l'impression que c'est cette ligne là
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    MembreForms formMembre = new MembreForms( membredao );
    avec membredao qui est null.
    Passe en mode debug et met un point d'arrêt dans ta méthode init pour voir si la ligne suivante te renvoie quelque chose
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    this.membredao = ( (DAOFactory) getServletContext().getAttribute( DAO_FACTORY ) ).getMembreDAO();

  10. #10
    Membre du Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Juin 2013
    Messages
    174
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Val d'Oise (Île de France)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Juin 2013
    Messages : 174
    Points : 51
    Points
    51
    Par défaut
    En fait voila , le problème étais du init() , j'ai juste enlevé par curiosité le "ServletConfig config" :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    public void init( ServletConfig config ) throws ServletException {
    ********this.membredao = ( (DAOFactory) getServletContext().getAttribute( DAO_FACTORY ) ).getMembreDAO();
    ****}
    a :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    public void init() throws ServletException {
     
           this.membredao = ( (DAOFactory) getServletContext().getAttribute( DAO_FACTORY ) ).getMembreDAO();
     
       }
    Et c'as a marché ! ca m'affiche le formulaire et l'ajout ce fais dans la base de donnée , une explication svp ?

  11. #11
    Expert éminent sénior
    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 : 45
    Localisation : Belgique

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

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 482
    Points : 48 804
    Points
    48 804
    Par défaut
    init

    public void init(ServletConfig config)
    throws ServletException

    Called by the servlet container to indicate to a servlet that the servlet is being placed into service. See Servlet.init(javax.servlet.ServletConfig).

    This implementation stores the ServletConfig object it receives from the servlet container for later use. When overriding this form of the method, call super.init(config).
    Tu as oublié de mettre l'appel à super.init(config) dans ton code

  12. #12
    Membre du Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Juin 2013
    Messages
    174
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Val d'Oise (Île de France)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Juin 2013
    Messages : 174
    Points : 51
    Points
    51
    Par défaut
    Citation Envoyé par tchize_ Voir le message
    Tu as oublié de mettre l'appel à super.init(config) dans ton code
    Mais est ce que ce code :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    public void init( ServletConfig config ) throws ServletException {
            super.init( config );
            this.membredao = ( (DAOFactory) getServletContext().getAttribute( DAO_FACTORY ) ).getMembreDAO();
        }
    Est équivalent a celui la ? :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    public void init() throws ServletException {
     
           this.membredao = ( (DAOFactory) getServletContext().getAttribute( DAO_FACTORY ) ).getMembreDAO();
     
       }
    C'est quoi la différence car avec les deux code , ca marche ..

  13. #13
    Expert éminent sénior
    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 : 45
    Localisation : Belgique

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

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 482
    Points : 48 804
    Points
    48 804
    Par défaut
    init( ServletConfig config ), après l'initialisation de HttpServlet, fait l'appel à init().

    La différence entre les deux est juste le moment de l'appel. Si init() te conviens, utilise le

  14. #14
    Membre du Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Juin 2013
    Messages
    174
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Val d'Oise (Île de France)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Juin 2013
    Messages : 174
    Points : 51
    Points
    51
    Par défaut
    D'accord je vois , merci pour toutes les réponses !

Discussions similaires

  1. Réponses: 2
    Dernier message: 26/11/2012, 21h42
  2. Réponses: 18
    Dernier message: 27/04/2009, 18h11
  3. [Tomcat][Servlet] Erreur 404 lors d'accès distant
    Par Julaie95 dans le forum Tomcat et TomEE
    Réponses: 1
    Dernier message: 03/07/2006, 17h35
  4. [Tomcat] Erreur 404 si pas d'index.jsp
    Par Invité dans le forum Tomcat et TomEE
    Réponses: 5
    Dernier message: 08/06/2006, 11h22
  5. [struts]erreur 404:ne trouve pas l'action...
    Par questionneuse dans le forum Struts 1
    Réponses: 7
    Dernier message: 05/05/2006, 10h55

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