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.