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

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

JSF Java Discussion :

Erreur "java.lang.StackOverflowError" avec Eclipse


Sujet :

JSF Java

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre averti
    Homme Profil pro
    Inscrit en
    Janvier 2012
    Messages
    49
    Détails du profil
    Informations personnelles :
    Sexe : Homme

    Informations forums :
    Inscription : Janvier 2012
    Messages : 49
    Par défaut Erreur "java.lang.StackOverflowError" avec Eclipse
    Bonjour;
    Je développe une application web.Le problème c'est que lorsque j’exécute le code facture.xhtml(et uniquement ce code) je reçois l'erreur suivante: java.lang.StackOverflowError.J'ai essaye de redémarrer le serveur, mais l'erreur persiste
    le fichier facture.xhtml est le suivant:
    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
     
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     
    <html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:composite="http://java.sun.com/jsf/composite">
    <head>
    </head>
    <body>
    <center>
    <h2>    FACTURE   </h2>
    </center> 
    <hr /><hr />
    <h:form>
        <br />
    		<h:panelGrid columns="2">
    FOURNISSEUR: <h:selectOneMenu value="#{factu.nomf}">
           <f:selectItems value="#{factu.listElements}" />
                </h:selectOneMenu>
     
         	</h:panelGrid> 
     REFERENCE : <h:inputText   value ="#{factu.reference}"/>
        <br />
         	    <br />
     		<h:panelGrid columns="4" >
     PRODUIT : <h:selectOneMenu value="#{factu.prodnom}">
           <f:selectItems value="#{factu.listElementsprod}" />
                </h:selectOneMenu>
                    <br />
     QUANTITE : <h:inputText  value ="#{factu.p.quantité}"/>
         <br />
    PRIX_PRODUIT : <h:inputText   value ="#{factu.pu}"/>
        <br />
     TOTAL : <h:inputText  value ="#{factu.total}"/>
         		</h:panelGrid> 
          <br />
      <h:commandButton value=" + " action="#{factu.add }"/>
     
      <h:commandButton value="Ajouter" action="#{factu.ajouter }"/>
     
    </h:form> 
    </body>
    </html>
    Le bean factureBean.java :
    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
     
    package com.xxx.facturation.controlleur;
     
    import java.util.ArrayList;
    import java.util.List;
     
    import javax.faces.bean.ManagedBean;
    import javax.faces.bean.SessionScoped;
    import javax.faces.model.SelectItem;
     
    import com.xxx.facturation.dao.FactureDAO;
    import com.xxx.facturation.dao.FournisseurDAO;
    import com.xxx.facturation.dao.LignecomdDAO;
    import com.xxx.facturation.dao.ProduitDAO;
    import com.xxx.facturation.persistance.Facture;
    import com.xxx.facturation.persistance.Fournisseur;
    import com.xxx.facturation.persistance.Lignecomd;
    import com.xxx.facturation.persistance.Produit;
     
     
    @ManagedBean(name="factu")
    @SessionScoped
    public class FactureBean{
     
    	  private String nomf;
    	  private String prodnom;
    	  private float total ;
    	  private float pu;
    	  private int qte;
          Lignecomd lcd= new Lignecomd();
    	  private List<Lignecomd> listlcd= new ArrayList<Lignecomd>();
    	  private List<Fournisseur> fs = new ArrayList<Fournisseur>();
    	  private List<SelectItem>listElements;
    	  private List<Produit> prdt= new ArrayList<Produit>();
    	  private List<SelectItem>listElementsprod;
     
    /********************************************************/
    	  private Facture fac = new  Facture();
    	  private Produit p = new  Produit();
    	  private Fournisseur f = new  Fournisseur();
    	  FactureDAO factdao= new FactureDAO();
    	  LignecomdDAO lcdao =new LignecomdDAO();
    	  FournisseurDAO frndao= new FournisseurDAO(); 
    	  ProduitDAO pdao=new ProduitDAO();
     /*********************************************************/
    	  public String ajouter(){
    		  fac.setLcde(listlcd);
              factdao.ajouter(fac);	
              return null;
              }
     
    	public String getNomf() {
    		return nomf;
    	}
    	public void setNomf(String nomf) {
    		this.nomf = nomf;
    	}
    	public String getProdnom() {
    		return prodnom;
    	}
    	public void setProdnom(String prodnom) {
    		this.prodnom = prodnom;
    	}
    	public float getTotal() {
    		return total;
    	}
    	public void setTotal(float total) {
    		this.total = total;
    	}
    	public float getPu() {
    		return pu;
    	}
    	public void setPu(float pu) {
    		this.pu = pu;
    	}
    	public int getQte() {
    		return qte;
    	}
    	public void setQte(int qte) {
    		this.qte = qte;
    	}
    	public List<Lignecomd> getListlcd() {
    		return listlcd;
    	}
    	public void setListlcd(List<Lignecomd> listlcd) {
    		this.listlcd = listlcd;
    	}
    	public Facture getFac() {
    		return fac;
    	}
    	public void setFac(Facture fac) {
    		this.fac = fac;
    	}
     
    	public List<Fournisseur> getFs() {
    		return fs;
    	}
     
    	public void setFs(List<Fournisseur> fs) {
    		this.fs = fs;
    	}
    	            /* affichage de la liste du fournisseur */
    	/*******************************************************************/
    	public List<SelectItem> getListElements() {
    		listElements=new ArrayList<SelectItem>();
    		for(Fournisseur frn:frndao.selectAll())
    			listElements.add(new SelectItem(frn.getPrenom()));
    		return listElements;
    	}
     
    	public void setListElements(List<SelectItem> listElements) {
    		this.listElements = listElements;
    	}
     
    	public Produit getP() {
    		return p;
    	}
     
    	public void setP(Produit p) {
    		this.p = p;
    	}
     
    	public List<Produit> getPrdt() {
    		return prdt;
    	}
     
    	public void setPrdt(List<Produit> prdt) {
    		this.prdt = prdt;
    	}
    	            /*affichage de la liste du produit */
    	/*********************************************************************/
    	public List<SelectItem> getListElementsprod() {
    		 listElementsprod=new ArrayList<SelectItem>();
    		for(Produit prod:pdao.selectAll())
    			 listElementsprod.add(new SelectItem(prod.getNom()));
    		return listElementsprod;
     
    	}
     
    	public void setListElementsprod(List<SelectItem> listElementsprod) {
    		this.listElementsprod = listElementsprod;
    	}
    	public String add(){
     
    		/*****************    Selection Produit      ************************/
    				p=pdao.selectBynom(prodnom);
    				prdt.add(p);
    				p=new Produit();
    				prodnom=new String();
    		/*****************   Selection Fournisseur       ************************/
    				f=frndao.selectBynom(nomf);
    				fs.add(f);
    				f=new Fournisseur();
    				nomf=new String();
    		/****************    Selection Ligne de commande     *************************/
    				listlcd.add(lcd);
    				fac.setLcde(listlcd);
    				lcd=new Lignecomd();
    				return null;
    				}
     
    }
    Merci d'avance pour votre aide.

  2. #2
    Membre très actif
    Homme Profil pro
    Développeur .NET
    Inscrit en
    Mai 2014
    Messages
    153
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Nord (Nord Pas de Calais)

    Informations professionnelles :
    Activité : Développeur .NET

    Informations forums :
    Inscription : Mai 2014
    Messages : 153
    Par défaut
    Vérifie ta couche dao en particulier ton implémentation de ton interface des méthodes requises.
    Je pense que ton souci se situe dans la transaction bdd (metier->dao->bdd) et pas localement.

    Teste avec junit.
    Bonne continuation.

  3. #3
    Membre averti
    Homme Profil pro
    Inscrit en
    Janvier 2012
    Messages
    49
    Détails du profil
    Informations personnelles :
    Sexe : Homme

    Informations forums :
    Inscription : Janvier 2012
    Messages : 49
    Par défaut
    Merci pour votre réponse, c bon j'ai pu résoudre le problème.Il a été un problème de récursivité, qui a fait le débordement.

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

Discussions similaires

  1. [XSLT] [XalanJava] Erreur-XSLT (java.lang.StackOverflowError): null
    Par sylvie dans le forum Format d'échange (XML, JSON...)
    Réponses: 1
    Dernier message: 24/08/2010, 09h52
  2. erreur java.lang.StackOverflowError
    Par titio04 dans le forum AWT/Swing
    Réponses: 1
    Dernier message: 13/09/2009, 21h34
  3. une erreur horreure java.lang.StackOverFlowError
    Par mahmoud_mahmoud dans le forum Débuter avec Java
    Réponses: 4
    Dernier message: 04/03/2008, 11h20
  4. Réponses: 2
    Dernier message: 15/03/2007, 14h00

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