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

Développement Web en Java Discussion :

Null Pointer Exception


Sujet :

Développement Web en Java

  1. #1
    Membre du Club
    Profil pro
    Inscrit en
    Juin 2012
    Messages
    115
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juin 2012
    Messages : 115
    Points : 46
    Points
    46
    Par défaut Null Pointer Exception
    Bonjour,

    J'ai une catalogue et un panier. J'arrive afficher seulement la catalogue, quand je veux afficher en même temps le panier et la catalogue j'ai une NullPointerException. Un moment mon panier devient null, mais je n'arrive pas trouver où. Aidez-moi s'il vous plaît! Ca fait une journée que j'essaie résudre ce problème.
    Merci!

    Mon controleur:

    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
     
    if("catalogue".equals(request.getParameter("section"))){
    			 System.out.println("catalogue");
    	            MetierPanier mp=MetierPanier.getInstance();
    	            request.setAttribute("catalogue", mp.selectAll());
    	            System.out.println("catalogue2");
    	            url="/WEB-INF/pages/catalogue.jsp";
    	        }
     
    	        if("panier".equals(request.getParameter("section"))){
    	        	System.out.println("panier");
    	            if(session.getAttribute("panier")==null){
    	                beanPanier bp=new beanPanier();
    	            session.setAttribute("panier", bp);
    	            System.out.println("panier2");
    	            session.setAttribute("maList", bp.getMaList());
    	            }
    	            url="/WEB-INF/pages/catalogue.jsp";
    	        }
     
    	        if("achat".equals(request.getParameter("section"))){
    	        	System.out.println("achat");
    	            beanPanier bp=(beanPanier) session.getAttribute("panier");
    	            MetierPanier mp=MetierPanier.getInstance();           
    	            String ajouter = request.getParameter("ajouter");
    	            System.out.println("achat2");
    	            if(ajouter!=null){
    	                Produit prod=mp.selectProd(Integer.valueOf(ajouter));
    	                mp.add(bp, prod);
    	            }
    	        }
    La catalogue et le panier:

    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
     
    <div>
        <h3> Notre catalogue</h3>
        <table border='1'><tr><th>Produit</th><th>PrixHT</th><th></th></tr>
            <%
                List<Produit> tout = (List<Produit>) request.getAttribute("catalogue");
                for (Produit p : tout) {
                    out.println("<tr><td>" + p.getLibelProd() + "</td><td>"
                            + p.getPrixHT() + "</td><td><a href='Controleur?section=achat&ajouter="
                            + p.getIdProd() + "'>"
                            + "ajouter</a></td></tr>");
                }
            %>
        </table> 
        <hr />
    </div>
     
    <div id="panier">
        <h3> Contenu de votre panier</h3>
     
        <%
            HashSet<Article> maList = (HashSet<Article>) request.getAttribute("maList");
            if (maList.size() > 0) {
        %>
     
        <table border='1'><tr><th>Produit</th><th>Quantité</th><th colspan='3'>Options</th></tr>
     
            <%for (Article p : maList) {
                    out.println("<tr><td><label>" + p.getLibelProd() + "</label></td><td><label>" + p.getQte()
                            + "</label></td><td><a href='Controleur?section=achat&supprim=" + p.getIdProd() + "'>"
                            + "suppr</a></td>"
                            + "<td><a href='Controleur?section=achat&plus=" + p.getIdProd() + "'>"
                            + "plus</a></td>"
                            + "<td><a href='Controleur?section=achat&moins=" + p.getIdProd() + "'>"
                            + "moins</a></td></tr>");
                }
            %>
     
     
        </table>
        <a href="Controleur?section=achat&vider=ok">Vider Panier</a>
        <%
            } else {
                out.println("Votre panier est vide");
            }
        %>
    </div>

  2. #2
    Membre chevronné
    Avatar de fxrobin
    Homme Profil pro
    Architecte SI, Java Fan, API Manager
    Inscrit en
    Novembre 2007
    Messages
    875
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Ille et Vilaine (Bretagne)

    Informations professionnelles :
    Activité : Architecte SI, Java Fan, API Manager
    Secteur : Aéronautique - Marine - Espace - Armement

    Informations forums :
    Inscription : Novembre 2007
    Messages : 875
    Points : 2 112
    Points
    2 112
    Par défaut
    Salut,

    as-tu une stacktrace à montrer ?
    Car pour trouver une NPE, ça devient plus simple quand on a une stacktrace.
    Moins on code, moins il y a de bug ... et vice-versa ainsi qu'inversement ...

  3. #3
    Membre du Club
    Profil pro
    Inscrit en
    Juin 2012
    Messages
    115
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juin 2012
    Messages : 115
    Points : 46
    Points
    46
    Par défaut
    Merci pour ton réponse!

    Voici:

    Etat HTTP 500 - java.lang.NullPointerException

    type Rapport d''exception

    message java.lang.NullPointerException

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

    exception

    org.apache.jasper.JasperException: java.lang.NullPointerException
    org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:549)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:470)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    controleur.controleur.doGet(controleur.java:135)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:722)

    cause mère

    java.lang.NullPointerException
    org.apache.jsp.WEB_002dINF.pages.catalogue_jsp._jspService(catalogue_jsp.java:104)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    controleur.controleur.doGet(controleur.java:135)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:722)

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

  4. #4
    Membre chevronné
    Avatar de fxrobin
    Homme Profil pro
    Architecte SI, Java Fan, API Manager
    Inscrit en
    Novembre 2007
    Messages
    875
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Ille et Vilaine (Bretagne)

    Informations professionnelles :
    Activité : Architecte SI, Java Fan, API Manager
    Secteur : Aéronautique - Marine - Espace - Armement

    Informations forums :
    Inscription : Novembre 2007
    Messages : 875
    Points : 2 112
    Points
    2 112
    Par défaut
    tu peux montrer la stacktrace complète incluse dans le log de Tomcat.
    Moins on code, moins il y a de bug ... et vice-versa ainsi qu'inversement ...

  5. #5
    Membre chevronné
    Avatar de fxrobin
    Homme Profil pro
    Architecte SI, Java Fan, API Manager
    Inscrit en
    Novembre 2007
    Messages
    875
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Ille et Vilaine (Bretagne)

    Informations professionnelles :
    Activité : Architecte SI, Java Fan, API Manager
    Secteur : Aéronautique - Marine - Espace - Armement

    Informations forums :
    Inscription : Novembre 2007
    Messages : 875
    Points : 2 112
    Points
    2 112
    Par défaut
    ton URL de catalogue est invoquée avec un ResquestDispatcher ?

    tu peux montrer cette portion de code.

    à mon avis c'est ça qui est NULL :

    request.getAttribute("catalogue");


    fait un test avant, histoire de vérifier que c'est bien ça.
    Moins on code, moins il y a de bug ... et vice-versa ainsi qu'inversement ...

  6. #6
    Membre du Club
    Profil pro
    Inscrit en
    Juin 2012
    Messages
    115
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juin 2012
    Messages : 115
    Points : 46
    Points
    46
    Par défaut
    Voici:

    nov. 02, 2012 2:12:24 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:/Program Files/Java/jre7/bin/client;C:/Program Files/Java/jre7/bin;C:/Program Files/Java/jre7/lib/i386;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Dell\DW WLAN Card;C:\Users\khi\Downloads\eclipse-jee-juno-SR1-win32\eclipse;;.
    nov. 02, 2012 2:12:24 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
    WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:Catalogue' did not find a matching property.
    nov. 02, 2012 2:12:24 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
    WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:ApplicLogin' did not find a matching property.
    nov. 02, 2012 2:12:24 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
    WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:Application_WEB' did not find a matching property.
    nov. 02, 2012 2:12:24 PM org.apache.coyote.AbstractProtocol init
    INFO: Initializing ProtocolHandler ["http-bio-8080"]
    nov. 02, 2012 2:12:24 PM org.apache.coyote.AbstractProtocol init
    INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
    nov. 02, 2012 2:12:24 PM org.apache.catalina.startup.Catalina load
    INFO: Initialization processed in 497 ms
    nov. 02, 2012 2:12:24 PM org.apache.catalina.core.StandardService startInternal
    INFO: Démarrage du service Catalina
    nov. 02, 2012 2:12:24 PM org.apache.catalina.core.StandardEngine startInternal
    INFO: Starting Servlet Engine: Apache Tomcat/7.0.32
    nov. 02, 2012 2:12:29 PM org.apache.coyote.AbstractProtocol start
    INFO: Starting ProtocolHandler ["http-bio-8080"]
    nov. 02, 2012 2:12:30 PM org.apache.coyote.AbstractProtocol start
    INFO: Starting ProtocolHandler ["ajp-bio-8009"]
    nov. 02, 2012 2:12:30 PM org.apache.catalina.startup.Catalina start
    INFO: Server startup in 5384 ms
    connexion
    catalogue
    catalogue2
    nov. 02, 2012 2:12:38 PM org.apache.catalina.core.ApplicationDispatcher invoke
    SEVERE: "Servlet.service()" pour la servlet jsp a lancé une exception
    java.lang.NullPointerException
    at org.apache.jsp.WEB_002dINF.pages.catalogue_jsp._jspService(catalogue_jsp.java:104)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:749)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:487)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:412)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:339)
    at controleur.controleur.doGet(controleur.java:135)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
    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:168)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

    nov. 02, 2012 2:12:38 PM org.apache.catalina.core.StandardWrapperValve invoke
    SEVERE: Servlet.service() for servlet [form] in context with path [/ApplicLogin] threw exception [An exception occurred processing JSP page /WEB-INF/pages/catalogue.jsp at line 37

    34:
    35: <%
    36: HashSet<Article> maList = (HashSet<Article>) request.getAttribute("maList");
    37: if (maList.size() > 0) {
    38: %>
    39:
    40: <table border='1'><tr><th>Produit</th><th>Quantité</th><th colspan='3'>Options</th></tr>


    Stacktrace:] with root cause
    java.lang.NullPointerException
    at org.apache.jsp.WEB_002dINF.pages.catalogue_jsp._jspService(catalogue_jsp.java:104)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:749)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:487)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:412)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:339)
    at controleur.controleur.doGet(controleur.java:135)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
    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:168)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

  7. #7
    Membre du Club
    Profil pro
    Inscrit en
    Juin 2012
    Messages
    115
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juin 2012
    Messages : 115
    Points : 46
    Points
    46
    Par défaut
    Quand j'execute seulement ce code:
    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
     
    <div>
        <h3> Notre catalogue</h3>
        <table border='1'><tr><th>Produit</th><th>PrixHT</th><th></th></tr>
            <%
                List<Produit> tout = (List<Produit>) request.getAttribute("catalogue");
                for (Produit p : tout) {
                    out.println("<tr><td>" + p.getLibelProd() + "</td><td>"
                            + p.getPrixHT() + "</td><td><a href='Controleur?section=achat&ajouter="
                            + p.getIdProd() + "'>"
                            + "ajouter</a></td></tr>");
                }
            %>
        </table> 
        <hr />
    </div>
    Ca marche bien.

    C'est plante quand je veux executer ca aussi:

    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
     
    <div id="panier">
        <h3> Contenu de votre panier</h3>
     
        <%
            HashSet<Article> maList = (HashSet<Article>) request.getAttribute("maList");
            if (maList.size() > 0) {
        %>
     
        <table border='1'><tr><th>Produit</th><th>Quantité</th><th colspan='3'>Options</th></tr>
     
            <%for (Article p : maList) {
                    out.println("<tr><td><label>" + p.getLibelProd() + "</label></td><td><label>" + p.getQte()
                            + "</label></td><td><a href='Controleur?section=achat&supprim=" + p.getIdProd() + "'>"
                            + "suppr</a></td>"
                            + "<td><a href='Controleur?section=achat&plus=" + p.getIdProd() + "'>"
                            + "plus</a></td>"
                            + "<td><a href='Controleur?section=achat&moins=" + p.getIdProd() + "'>"
                            + "moins</a></td></tr>");
                }
            %>
     
     
        </table>
        <a href="Controleur?section=achat&vider=ok">Vider Panier</a>
        <%
            } else {
                out.println("Votre panier est vide");
            }
        %>
    </div>

  8. #8
    Membre chevronné
    Avatar de fxrobin
    Homme Profil pro
    Architecte SI, Java Fan, API Manager
    Inscrit en
    Novembre 2007
    Messages
    875
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Ille et Vilaine (Bretagne)

    Informations professionnelles :
    Activité : Architecte SI, Java Fan, API Manager
    Secteur : Aéronautique - Marine - Espace - Armement

    Informations forums :
    Inscription : Novembre 2007
    Messages : 875
    Points : 2 112
    Points
    2 112
    Par défaut
    simplement parce que request.getAttribute("maList");

    te renvoie NULL parce que tu l'as mise en session et pas en request :

    session.setAttribute("maList", bp.getMaList());


    passe ton request.getAttribute("maList");"
    en session.getAttribute("maList");
    Moins on code, moins il y a de bug ... et vice-versa ainsi qu'inversement ...

  9. #9
    Membre du Club
    Profil pro
    Inscrit en
    Juin 2012
    Messages
    115
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juin 2012
    Messages : 115
    Points : 46
    Points
    46
    Par défaut
    J'ai passé request.getAttribute("maList");"
    en session.getAttribute("maList");

    mais j'ai toujours l'exception.

    Etat HTTP 500 - An exception occurred processing JSP page /WEB-INF/pages/catalogue.jsp at line 37

    type Rapport d''exception

    message An exception occurred processing JSP page /WEB-INF/pages/catalogue.jsp at line 37

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

    exception

    org.apache.jasper.JasperException: An exception occurred processing JSP page /WEB-INF/pages/catalogue.jsp at line 37

    34:
    35: <%
    36: HashSet<Article> maList = (HashSet<Article>) session.getAttribute("maList");
    37: if (maList.size() > 0) {
    38: %>
    39:
    40: <table border='1'><tr><th>Produit</th><th>Quantité</th><th colspan='3'>Options</th></tr>


    Stacktrace:
    org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:568)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:470)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    controleur.controleur.doGet(controleur.java:134)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:722)

    cause mère

    java.lang.NullPointerException
    org.apache.jsp.WEB_002dINF.pages.catalogue_jsp._jspService(catalogue_jsp.java:104)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    controleur.controleur.doGet(controleur.java:134)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:722)

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

  10. #10
    Membre du Club
    Profil pro
    Inscrit en
    Juin 2012
    Messages
    115
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juin 2012
    Messages : 115
    Points : 46
    Points
    46
    Par défaut
    J'ai rien changé, et maintenant j'ai ça:

    Etat HTTP 500 - java.lang.NullPointerException

    type Rapport d''exception

    message java.lang.NullPointerException

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

    exception

    org.apache.jasper.JasperException: java.lang.NullPointerException
    org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:549)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:470)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    controleur.controleur.doGet(controleur.java:134)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:722)

    cause mère

    java.lang.NullPointerException
    org.apache.jsp.WEB_002dINF.pages.catalogue_jsp._jspService(catalogue_jsp.java:104)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    controleur.controleur.doGet(controleur.java:134)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:722)

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

  11. #11
    Membre chevronné
    Avatar de fxrobin
    Homme Profil pro
    Architecte SI, Java Fan, API Manager
    Inscrit en
    Novembre 2007
    Messages
    875
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Ille et Vilaine (Bretagne)

    Informations professionnelles :
    Activité : Architecte SI, Java Fan, API Manager
    Secteur : Aéronautique - Marine - Espace - Armement

    Informations forums :
    Inscription : Novembre 2007
    Messages : 875
    Points : 2 112
    Points
    2 112
    Par défaut
    tu ne dois pas passer dans le if qui met ta liste en session.
    en effet tu testes si le paramètre "section" est égal à "catalogue" ..
    puis si section est égal à "panier" ...

    c'est soit l'un, soit l'autre, pas les deux

    ton problème d'algorithme est là.

    est-ce que "section" peut avoir en même temps les deux valeurs ?
    si oui, comment les passes tu ? en lien d'URL ?
    Moins on code, moins il y a de bug ... et vice-versa ainsi qu'inversement ...

  12. #12
    Membre du Club
    Profil pro
    Inscrit en
    Juin 2012
    Messages
    115
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juin 2012
    Messages : 115
    Points : 46
    Points
    46
    Par défaut
    Je voudrais afficher en même temps une catalogue avec des produits et un panier qui est vide au début, et puis de catalogue ajouter des produits au panier.

    Comment je pourrai faire que les de sections affichent en même temps?

    Oui j'ai passé en url, en fait le même, parce que ils se trouvent dans la même page jsp

  13. #13
    Membre chevronné
    Avatar de fxrobin
    Homme Profil pro
    Architecte SI, Java Fan, API Manager
    Inscrit en
    Novembre 2007
    Messages
    875
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Ille et Vilaine (Bretagne)

    Informations professionnelles :
    Activité : Architecte SI, Java Fan, API Manager
    Secteur : Aéronautique - Marine - Espace - Armement

    Informations forums :
    Inscription : Novembre 2007
    Messages : 875
    Points : 2 112
    Points
    2 112
    Par défaut
    tu peux passer plusieurs sections en URL.

    par exemple "section=catalogue,panier"

    et faire un contains() au lieu de equals

    comme ça tu rentrerai dans tes deux "if".
    Moins on code, moins il y a de bug ... et vice-versa ainsi qu'inversement ...

  14. #14
    Membre du Club
    Profil pro
    Inscrit en
    Juin 2012
    Messages
    115
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juin 2012
    Messages : 115
    Points : 46
    Points
    46
    Par défaut
    Merci, je suis débutant, et je ne sais pas si j'ai bien compris ce que tu m'as conseillé. Ca ne fonctionne encore.

    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
     
    	if("section == catalogue, panier" != null){
     
    		 if("catalogue".contains(request.getParameter("section"))){
    			 System.out.println("catalogue");
    	            MetierPanier mp=MetierPanier.getInstance();
    	            request.setAttribute("catalogue", mp.selectAll());
    	            System.out.println("catalogue2");
    	            url="/WEB-INF/pages/catalogue.jsp";
    	        }
     
    	        if("panier".contains(request.getParameter("section"))){
    	        	System.out.println("panier");
    	            if(session.getAttribute("panier") == null){
    	                beanPanier bp=new beanPanier();
    	            session.setAttribute("panier", bp);
    	            System.out.println("panier2");
    	            session.setAttribute("maList", bp.getMaList());
    	            }
    	            url="/WEB-INF/pages/panier.jsp";
    	        }
    	}

  15. #15
    Membre chevronné
    Avatar de fxrobin
    Homme Profil pro
    Architecte SI, Java Fan, API Manager
    Inscrit en
    Novembre 2007
    Messages
    875
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Ille et Vilaine (Bretagne)

    Informations professionnelles :
    Activité : Architecte SI, Java Fan, API Manager
    Secteur : Aéronautique - Marine - Espace - Armement

    Informations forums :
    Inscription : Novembre 2007
    Messages : 875
    Points : 2 112
    Points
    2 112
    Par défaut
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    	if("section == catalogue, panier" != null){
    OUllaaa



    fais ça :

    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
     
     String section = request.getParameter("section");
     if (section == null)
     {
       // pas normal, on redirige vers une page d'erreur.
       url = "/WEB-INF/pages/erreur.jsp";
     } 
     else
     {
       if (section.contains("catalogue"))
       {
          // partie du catalogue
       }
     
       if (section.contains("panier"))
       {
          // partie du panier
       }
    }
    mais il faut que "panier" et "catalogue" soient passés dans une variable d'URL de ta requête HTTP: /monControleur?section=catalogue,panier
    Moins on code, moins il y a de bug ... et vice-versa ainsi qu'inversement ...

  16. #16
    Membre du Club
    Profil pro
    Inscrit en
    Juin 2012
    Messages
    115
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juin 2012
    Messages : 115
    Points : 46
    Points
    46
    Par défaut
    J'ai toujours une exception, ça ne rentre toujours pas dans le panier

    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
     
    	String section = request.getParameter("section");
    		if (section == null) {
    			url = "/WEB-INF/pages/erreur.jsp";
    		} else {
    			if (section.contains("catalogue")){
    				System.out.println("catalogue");
    				MetierPanier mp = MetierPanier.getInstance();
    				request.setAttribute("catalogue", mp.selectAll());
    				System.out.println("catalogue2");
    				url = "/WEB-INF/pages/catalogue.jsp";
    			}
     
    			if (section.contains("panier")) {
    				System.out.println("panier");
    				if (session.getAttribute("panier") == null) {
    					beanPanier bp = new beanPanier();
    					session.setAttribute("panier", bp);
    					System.out.println("panier2");
    					session.setAttribute("maList", bp.getMaList());
    				}
    				url = "/WEB-INF/pages/panier.jsp";
    			}
    		}

  17. #17
    Membre chevronné
    Avatar de fxrobin
    Homme Profil pro
    Architecte SI, Java Fan, API Manager
    Inscrit en
    Novembre 2007
    Messages
    875
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Ille et Vilaine (Bretagne)

    Informations professionnelles :
    Activité : Architecte SI, Java Fan, API Manager
    Secteur : Aéronautique - Marine - Espace - Armement

    Informations forums :
    Inscription : Novembre 2007
    Messages : 875
    Points : 2 112
    Points
    2 112
    Par défaut
    Quelle exception ?
    Tu as fait la page d'erreur ?
    Quelle est l'URL de ton navigateur ?
    Moins on code, moins il y a de bug ... et vice-versa ainsi qu'inversement ...

  18. #18
    Membre du Club
    Profil pro
    Inscrit en
    Juin 2012
    Messages
    115
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juin 2012
    Messages : 115
    Points : 46
    Points
    46
    Par défaut
    Oui, j'ai fais une page erreur.jsp

    L'exception est toujours la même :

    Etat HTTP 500 - java.lang.NullPointerException

    type Rapport d''exception

    message java.lang.NullPointerException

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

    exception

    org.apache.jasper.JasperException: java.lang.NullPointerException
    org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:549)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:470)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    controleur.controleur.doGet(controleur.java:105)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:722)

    cause mère

    java.lang.NullPointerException
    org.apache.jsp.WEB_002dINF.pages.catalogue_jsp._jspService(catalogue_jsp.java:104)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    controleur.controleur.doGet(controleur.java:105)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:722)

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

    Voici le controleur:

    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
     
    package controleur;
     
    import java.io.IOException;
    import java.util.ArrayList;
     
    import javax.servlet.ServletContext;
    import javax.servlet.ServletException;
    import javax.servlet.annotation.WebServlet;
    import javax.servlet.http.Cookie;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import javax.servlet.http.HttpSession;
     
    import metier.MetierPanier;
     
    import beans.beanPanier;
     
    import pojo.Produit;
     
    /**
     * Servlet implementation class Controleur
     */
    @WebServlet("/controleur")
    public class controleur extends HttpServlet {
     
    	private Cookie getCookie(Cookie cookies[], String name) {
    		if (cookies != null) {
    			for (Cookie c : cookies) {
    				if (c.getName().equals(name)) {
    					return c;
    				}
    			}
    		}
     
    		return null;
    	}
     
    	/**
             * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse
             *      response)
             */
    	protected void doGet(HttpServletRequest request,
    			HttpServletResponse response) throws ServletException, IOException {
    		// TODO Auto-generated method stub
     
    		response.setContentType("text/html;charset=ISO-8859-1");
    		HttpSession session = request.getSession();
     
    		String url = "/index.jsp";
     
    		if ("connexion".equalsIgnoreCase(request.getParameter("section"))) {
    			if (request.getParameter("doIt") != null
    					&& request.getParameter("login").trim().isEmpty() != true
    					&& request.getParameter("mdp").trim().isEmpty() != true
    					&& request.getParameter("compagnie").trim().isEmpty() != true) {
    				System.out.println("connexion");
     
    				url = "/WEB-INF/pages/bienvenue.jsp";
    			}
     
    			else {
    				System.out.println("erreur");
    				String er = "login ou mot de passe ou compagnie n'est pas renseigné";
    				request.setAttribute("erreur", er);
    			}
    		}
     
    		String section = request.getParameter("section");
    		if (section == null) {
    			url = "/WEB-INF/pages/erreur.jsp";
    		} else {
    			if (section.contains("catalogue")) {
    				System.out.println("catalogue");
    				MetierPanier mp = MetierPanier.getInstance();
    				request.setAttribute("catalogue", mp.selectAll());
    				System.out.println("catalogue2");
    				url = "/WEB-INF/pages/catalogue.jsp";
    			}
     
    			if (section.contains("panier")) {
    				System.out.println("panier");
    				if (session.getAttribute("panier") == null) {
    					beanPanier bp = new beanPanier();
    					session.setAttribute("panier", bp);
    					System.out.println("panier2");
    					session.setAttribute("maList", bp.getMaList());
    				}
    				url = "/WEB-INF/pages/panier.jsp";
    			}
     
     
    		if (section.contains("achat")) {
    			System.out.println("achat");
    			beanPanier bp = (beanPanier) session.getAttribute("panier");
    			MetierPanier mp = MetierPanier.getInstance();
    			String ajouter = request.getParameter("ajouter");
    			System.out.println("achat2");
    			if (ajouter != null) {
    				Produit prod = mp.selectProd(Integer.valueOf(ajouter));
    				mp.add(bp, prod);
    			}
    			url = "/WEB-INF/pages/catalogue.jsp";
    		}
     
    		}
     
    		if ("delogin".equals(request.getParameter("section")) == true) {
    			System.out.println("deconnexion");
    			if (request.getParameter("delogin") != null) {
    				// Cookie c = getCookie(request.getCookies(), "login");
    				// c.setMaxAge(0);
    				// response.addCookie(c);
    				url = "/index.jsp";
     
    			}
    		}
     
    		getServletContext().getRequestDispatcher(url)
    				.forward(request, response);
    	}
    }

  19. #19
    Membre chevronné
    Avatar de fxrobin
    Homme Profil pro
    Architecte SI, Java Fan, API Manager
    Inscrit en
    Novembre 2007
    Messages
    875
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Ille et Vilaine (Bretagne)

    Informations professionnelles :
    Activité : Architecte SI, Java Fan, API Manager
    Secteur : Aéronautique - Marine - Espace - Armement

    Informations forums :
    Inscription : Novembre 2007
    Messages : 875
    Points : 2 112
    Points
    2 112
    Par défaut
    et l'URL de ton navigateur ?
    et tu peux montrer ENCORE la trace complète, pour voir si elle a changé.
    Moins on code, moins il y a de bug ... et vice-versa ainsi qu'inversement ...

  20. #20
    Membre du Club
    Profil pro
    Inscrit en
    Juin 2012
    Messages
    115
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juin 2012
    Messages : 115
    Points : 46
    Points
    46
    Par défaut
    L'url: http://localhost:8080/ApplicLogin/ct...gue&cat=Ouvrir

    La trace complète:

    nov. 02, 2012 5:55:11 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:/Program Files/Java/jre7/bin/client;C:/Program Files/Java/jre7/bin;C:/Program Files/Java/jre7/lib/i386;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Dell\DW WLAN Card;C:\Users\khi\Downloads\eclipse-jee-juno-SR1-win32\eclipse;;.
    nov. 02, 2012 5:55:12 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
    WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:Catalogue' did not find a matching property.
    nov. 02, 2012 5:55:12 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
    WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:ApplicLogin' did not find a matching property.
    nov. 02, 2012 5:55:12 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
    WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:Application_WEB' did not find a matching property.
    nov. 02, 2012 5:55:12 PM org.apache.coyote.AbstractProtocol init
    INFO: Initializing ProtocolHandler ["http-bio-8080"]
    nov. 02, 2012 5:55:12 PM org.apache.coyote.AbstractProtocol init
    INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
    nov. 02, 2012 5:55:12 PM org.apache.catalina.startup.Catalina load
    INFO: Initialization processed in 445 ms
    nov. 02, 2012 5:55:12 PM org.apache.catalina.core.StandardService startInternal
    INFO: Démarrage du service Catalina
    nov. 02, 2012 5:55:12 PM org.apache.catalina.core.StandardEngine startInternal
    INFO: Starting Servlet Engine: Apache Tomcat/7.0.32
    nov. 02, 2012 5:55:17 PM org.apache.coyote.AbstractProtocol start
    INFO: Starting ProtocolHandler ["http-bio-8080"]
    nov. 02, 2012 5:55:17 PM org.apache.coyote.AbstractProtocol start
    INFO: Starting ProtocolHandler ["ajp-bio-8009"]
    nov. 02, 2012 5:55:17 PM org.apache.catalina.startup.Catalina start
    INFO: Server startup in 5256 ms
    connexion
    catalogue
    catalogue2
    nov. 02, 2012 5:55:25 PM org.apache.catalina.core.ApplicationDispatcher invoke
    SEVERE: "Servlet.service()" pour la servlet jsp a lancé une exception
    java.lang.NullPointerException
    at org.apache.jsp.WEB_002dINF.pages.catalogue_jsp._jspService(catalogue_jsp.java:104)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:749)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:487)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:412)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:339)
    at controleur.controleur.doGet(controleur.java:118)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
    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:168)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

    nov. 02, 2012 5:55:25 PM org.apache.catalina.core.StandardWrapperValve invoke
    SEVERE: Servlet.service() for servlet [form] in context with path [/ApplicLogin] threw exception [java.lang.NullPointerException] with root cause
    java.lang.NullPointerException
    at org.apache.jsp.WEB_002dINF.pages.catalogue_jsp._jspService(catalogue_jsp.java:104)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:749)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:487)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:412)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:339)
    at controleur.controleur.doGet(controleur.java:118)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
    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:168)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

+ Répondre à la discussion
Cette discussion est résolue.
Page 1 sur 2 12 DernièreDernière

Discussions similaires

  1. Tomcat 5.5 Null Pointer Exception
    Par nono44200 dans le forum Tomcat et TomEE
    Réponses: 2
    Dernier message: 07/04/2007, 10h00
  2. Null pointer Exception pour ma Fenetre
    Par LeXo dans le forum AWT/Swing
    Réponses: 2
    Dernier message: 22/01/2007, 09h17
  3. Null Pointer Exception
    Par gloglo dans le forum Langage
    Réponses: 4
    Dernier message: 20/12/2006, 11h32
  4. [Struts] Null Pointer Exception
    Par n@n¤u dans le forum Struts 1
    Réponses: 1
    Dernier message: 01/08/2006, 13h10
  5. Null Pointer Exception
    Par snouppy dans le forum JBuilder
    Réponses: 3
    Dernier message: 13/06/2006, 21h53

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