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 "org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'toto'"


Sujet :

Spring Java

  1. #1
    Candidat au Club
    Homme Profil pro
    Développeur Java
    Inscrit en
    Mai 2012
    Messages
    4
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Développeur Java
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Mai 2012
    Messages : 4
    Points : 3
    Points
    3
    Par défaut Erreur "org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'toto'"
    Bonjour,

    J'ai rencontré un problème en compilant mon Projet Java et j'ai eu le message d'erreur suivant :

    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'toto': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.

    Quelq'un pourait m'expliquer cette erreur et comment la corriger ? Me manque-t-il une lib ???


    Merci.

  2. #2
    Membre expérimenté
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2004
    Messages
    1 184
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Ingénieur développement logiciels

    Informations forums :
    Inscription : Avril 2004
    Messages : 1 184
    Points : 1 745
    Points
    1 745
    Par défaut
    Bonjour,
    Tu dois avoir une propriété marquée par @AutoWired qui ne peut pas être résolue. Pour te dire pourquoi, il faudrait voir l'ensemble de la trace. Le message que tu as mis n'est pas suffisant.

  3. #3
    Candidat au Club
    Homme Profil pro
    Développeur Java
    Inscrit en
    Mai 2012
    Messages
    4
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Développeur Java
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Mai 2012
    Messages : 4
    Points : 3
    Points
    3
    Par défaut
    Merci Mathieu de m'avoir répondu

    Je te passe une grande partie de message :

    Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'totoBS': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private transient fr.xxx.jk.iad.ds.totoDS fr.xxx.jk.metier.business.impl.totoBSImpl.totoDS; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'totoDS': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private transient fr.xxx.a5.iad.jdbc.db.totoDB fr.xxx.jk.iad.jdbc.ds.impl.totoDSImpl.totoDB; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'totoDB' defined in class path resource [conf/beans-metier-jdbc-test.xml]: Cannot resolve reference to bean 'dataSource' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [conf/beans-metier-jdbc-test.xml]: Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:
    PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'driverClassName' threw exception; nested exception is java.lang.IllegalStateException: Could not load JDBC driver class [oracle.jdbc.driver.OracleDriver]
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:285)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1074)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
    at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:84)
    at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:1)
    at org.springframework.test.context.TestContext.loadApplicationContext(TestContext.java:280)
    at org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:304)
    ... 24 more
    Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private transient fr.xxx.jk.iad.ds.totoDS fr.xxx.jk.metier.business.impl.totoBSImpl.totoDS; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'totoDS': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private transient fr.xxx.a5.iad.jdbc.db.totoDB fr.xxx.jk.iad.jdbc.ds.impl.totoDSImpl.totoDB; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'totoDB' defined in class path resource [conf/beans-metier-jdbc-test.xml]: Cannot resolve reference to bean 'dataSource' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [conf/beans-metier-jdbc-test.xml]: Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:
    PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'driverClassName' threw exception; nested exception is java.lang.IllegalStateException: Could not load JDBC driver class [oracle.jdbc.driver.OracleDriver]
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:502)
    at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:84)
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:282)
    ... 38 more


    Je souhaiterais seulement comprendre l'erreur car je suis débutant sur Spring et j'ai de mal à déchiffrer les messages d'erreur. Je travaille sur un projet qui existe déjà que je dois compiler et bien sûr faire fonctionner!!!

    Merci d'avance.

  4. #4
    Candidat au Club
    Homme Profil pro
    Développeur Java
    Inscrit en
    Mai 2012
    Messages
    4
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Développeur Java
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Mai 2012
    Messages : 4
    Points : 3
    Points
    3
    Par défaut
    Bien j'ai trouvé le problème en effet il me manquait le jdbc.

Discussions similaires

  1. Réponses: 1
    Dernier message: 04/06/2015, 13h54
  2. 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, 10h39
  3. Réponses: 4
    Dernier message: 17/08/2013, 08h52
  4. Réponses: 0
    Dernier message: 29/04/2010, 15h50

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