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

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

Spring Java Discussion :

Erreur "Error creating bean" [Data]


Sujet :

Spring Java

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre actif
    Homme Profil pro
    Étudiant
    Inscrit en
    Mars 2011
    Messages
    48
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Mars 2011
    Messages : 48
    Par défaut Erreur "Error creating bean"
    Bonjour,

    J'ai un problème au niveau de configuration Hibernate.

    J'ai créé le fichier de configuration Hibernate applicationContext-dao.xml et le fichier de configuration Spring applicationContext.xml.

    Lors de l'exécution, ça m'affiche l'erreur suivante au niveau de références entre les beans créés:
    Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateTemplate' defined in ServletContext resource [/WEB-INF/classes/applicationContext-dao.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/classes/applicationContext-dao.xml]: Invocation of init method failed; nested exception is org.hibernate.PropertyNotFoundException: Could not find a getter for oLancement in class com.sevil.entities.Operation
    Quelqu'un saurait-il m'indiquer d'où peut venir ce problème ?

    Merci d'avance pour votre aide.

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

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

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 482
    Par défaut
    nested exception is org.hibernate.PropertyNotFoundException: Could not find a getter for oLancement in class com.sevil.entities.Operation
    Tu as un micmac dans ta configuration hibernate apparament. Tu références des propriétés (ici oLancement) qui n'existent pas.

  3. #3
    Rédacteur/Modérateur
    Avatar de andry.aime
    Homme Profil pro
    Inscrit en
    Septembre 2007
    Messages
    8 391
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Ile Maurice

    Informations forums :
    Inscription : Septembre 2007
    Messages : 8 391
    Par défaut
    Ou le getter est n'existe pas ou invalide.

  4. #4
    Membre actif
    Homme Profil pro
    Étudiant
    Inscrit en
    Mars 2011
    Messages
    48
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Mars 2011
    Messages : 48
    Par défaut
    Citation Envoyé par andry.aime Voir le message
    Ou le getter est n'existe pas ou invalide.
    non pas de tout, je fait le getter et le setter de oLancement dans com.sevil.entitiés.Operation

    et la même erreur

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

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

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 482
    Par défaut
    vérifie que ces getters / setters sont du type correct et orthographiés correctement. Car manifestement, hibernate ne les trouve pas.

  6. #6
    Membre actif
    Homme Profil pro
    Étudiant
    Inscrit en
    Mars 2011
    Messages
    48
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Mars 2011
    Messages : 48
    Par défaut
    Citation Envoyé par tchize_ Voir le message
    vérifie que ces getters / setters sont du type correct et orthographiés correctement. Car manifestement, hibernate ne les trouve pas.
    voila mon fichier Operation.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
    package com.sevil.entities;
    import java.io.Serializable;
    import com.sevil.entities.OrdreLancement;
    public class Operation implements Serializable {
     
    private static final long serialVersionUID = 1L;
     
        private int entre;
    	private int perte;
    	private int retard;
    	private String date;
    	private String dateHeure;
    	private int idOperation;
    	private String numChaine;
    	private OrdreLancement oLancement;
     
    	public Operation() {
     
    	}
    	public int getIdOperation(){
    		return idOperation;
    	}
    	public void setIdOperation(int idoperation){
    		this.idOperation=idoperation;
    	}
     
    	public String getNumChaine() {
    		return numChaine;
    	}
     
     
    	public void setNumChaine(String numChaine) {
    		this.numChaine = numChaine;
    	}
     
    	public OrdreLancement getOLancement() {
    		return oLancement;
    	}
    	public void setOLancement(OrdreLancement oLancement) {
    		this.oLancement = oLancement;
    	}
     
    	public int getEntre() {
    		return entre;
    	}
        public void setEntre(int entre) {
    		this.entre = entre;
    	}
     
    	public int getPerte() {
    		return perte;
    	}
       public void setPerte(int perte) {
    		this.perte = perte;
    	}
     
       public int getRetard() {
    		return retard;
    	}
      public void setRetard(int retard) {
    		this.retard = retard;
    	}
     
      public String getDate() {
    		return date;
    	}
    	public void setDate(String date) {
    		this.date = date;
    	}
     
    	public String getDateHeure() {
    		return dateHeure;
    	}
    	public void setDateHeure(String dateHeure) {
    		this.dateHeure = dateHeure;
    	}
     
     
    }

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

Discussions similaires

  1. Erreur "BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext
    Par ichoualane dans le forum Plateformes (Java EE, Jakarta EE, Spring) et Serveurs
    Réponses: 1
    Dernier message: 26/05/2015, 09h39
  2. Réponses: 3
    Dernier message: 25/07/2012, 13h40
  3. [Data] Error creating bean with name 'entityManagerFactory'
    Par olivier57b dans le forum Spring
    Réponses: 0
    Dernier message: 27/09/2009, 14h47
  4. Réponses: 1
    Dernier message: 15/04/2009, 21h06
  5. Error creating bean with name
    Par MASSAKA dans le forum Spring
    Réponses: 1
    Dernier message: 07/05/2008, 19h32

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