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 :

No persistence exception translators found in bean factory


Sujet :

Spring Java

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre éprouvé
    Homme Profil pro
    Développeur .NET
    Inscrit en
    Janvier 2006
    Messages
    958
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 50
    Localisation : France, Moselle (Lorraine)

    Informations professionnelles :
    Activité : Développeur .NET
    Secteur : High Tech - Produits et services télécom et Internet

    Informations forums :
    Inscription : Janvier 2006
    Messages : 958
    Par défaut No persistence exception translators found in bean factory
    salut,

    voilà mon problème : une erreur dans le fichier de configuration de spring; voici l'erreur :

    Error creating bean with name 'org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor' defined in class path resource [spring-config-dao.xml]: Initialization of bean failed; nested exception is java.lang.IllegalStateException: No persistence exception translators found in bean factory. Cannot perform exception translation.
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor' defined in class path resource [spring-config-dao.xml]: Initialization of bean failed; nested exception is java.lang.IllegalStateException: No persistence exception translators found in bean factory. Cannot perform exception translation.
    Caused by: java.lang.IllegalStateException: No persistence exception translators found in bean factory. Cannot perform exception translation.
    at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.detectPersistenceExceptionTranslators(PersistenceExceptionTranslationInterceptor.java:124)
    at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.<init>(PersistenceExceptionTranslationInterceptor.java:77)
    at org.springframework.dao.annotation.PersistenceExceptionTranslationAdvisor.<init>(PersistenceExceptionTranslationAdvisor.java:70)
    at org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor.setBeanFactory(PersistenceExceptionTranslationPostProcessor.java:96)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1136)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:427)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
    at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:703)
    at org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:466)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:345)
    at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:91)
    at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:75)
    at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:65)
    at dao.InitDB.init(InitDB.java:28)
    et voici le fichier incriminé:

    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
     
    <beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:tx="http://www.springframework.org/schema/tx"
        xsi:schemaLocation="http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
        http://www.springframework.org/schema/tx
        http://www.springframework.org/schema/tx/spring-tx-2.0.xsd">
     
        <bean id="employeDao" class="dao.EmployeDao"></bean>
        <bean id="cotisationDao" class="dao.CotisationDao"></bean>
        <bean id="indemniteDao" class="dao.IndemniteDao"></bean>
     
        <bean id="entityManagerFactory"
        class="org.springFramework.org.jpa.LocalContainerEntityManagerFactoryBean">
            <property name="dataSource" ref="dataSource"></property>
            <property name="jpaVendorAdapter">
                <bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
                    <property name="showSql" value="true"></property>
                    <property name="databasePlatform"
                    value="org.hibernate.dialect.MySQL5InnoDBDialect"></property>
                    <property name="generateDdl" value="true"></property>
     
     
                </bean>
     
            </property>
        <property name="loadTimeWeaver">
            <bean class="org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver">
     
            </bean>
     
        </property>
        </bean>
     
        <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
            <property name="driverClassName" value="com.mysql.jdbc.Driver">
            </property>
            <property name="url" value="jdbc:mysql://localhost:3306/jbossdb">
            </property>
            <property name="username" value="root"></property>
            <property name="password" value="diddlepak"></property>
     
        </bean>
     
        <tx:annotation-driven transaction-manager="txManager"></tx:annotation-driven>
     
        <bean id="txManager" 
        class="org.springframework.orm.jpa.JpaTransactionManager">
            <property name="entityManagerFactory" 
                ref="entityManagerFactory">
     
                </property>
     
        </bean>
     
        <bean class="org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor"/>
     
        <bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor"/>
     
     
     
    </beans>
    l'erreur se situe à un endroit (à la fin) que j'ai recopié à l'identique à partir d'un tuto de Mr Tahé (sur developpez.com).

    pour être franc, je n'y comprends rien, à ce passage, à ce bean.
    je crois que c'est lié à la traduction des exceptions...dans ce cas puis-je l'enlever?
    si vous pouvez m'aider, merci!

    olivier.

  2. #2
    Membre confirmé
    Profil pro
    Inscrit en
    Juin 2006
    Messages
    109
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juin 2006
    Messages : 109
    Par défaut
    Salut,

    j'ai le même problème que toi. As tu trouvé une solution ?

    François

  3. #3
    Membre expérimenté Avatar de aymen83
    Inscrit en
    Décembre 2007
    Messages
    271
    Détails du profil
    Informations forums :
    Inscription : Décembre 2007
    Messages : 271
    Par défaut
    salut,

    je crois que le bean
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor
    n'est pas injecté.

  4. #4
    Membre éprouvé
    Homme Profil pro
    Développeur .NET
    Inscrit en
    Janvier 2006
    Messages
    958
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 50
    Localisation : France, Moselle (Lorraine)

    Informations professionnelles :
    Activité : Développeur .NET
    Secteur : High Tech - Produits et services télécom et Internet

    Informations forums :
    Inscription : Janvier 2006
    Messages : 958
    Par défaut
    désolé, c'est trop vieux, je ne me rappelle pas si j'ai trouvé une réponse et le cas échéant, laquelle.

    olivier.

Discussions similaires

  1. Réponses: 7
    Dernier message: 19/01/2009, 08h39
  2. exception création d'un bean
    Par yupa dans le forum Servlets/JSP
    Réponses: 3
    Dernier message: 13/01/2009, 15h04
  3. [jms] exception lors de la connection Factory
    Par fafoula dans le forum Glassfish et Payara
    Réponses: 2
    Dernier message: 30/11/2007, 00h02
  4. Bean Factory renvoie null
    Par ::Fistons dans le forum Spring
    Réponses: 16
    Dernier message: 09/07/2007, 09h23
  5. Réponses: 2
    Dernier message: 31/05/2007, 12h19

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