Bonjour, je suis entrain de teste des méthodes avec junit et spring j ai un message d'erreur :failed to load applicationContext.xml

merci pour votre aide
voici la classe test
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
 
package be.bibliotheque.test;
 
import org.junit.Test;
 
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.transaction.annotation.Transactional;
 
import be.bibliotheque.model.Editeur;
import be.bibliotheque.repository.EditeurRepository;
 
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations ={"classpath:applicationContext.xml"})
@Transactional
public class EditeurTest {
 
    @Autowired
  private EditeurRepository editeurRepos;
 
 
    @Test
    public void insertEditeur() {
       Editeur e = new Editeur();
       e.setNomEditeur("did");
       editeurRepos.persist(e);
    }
 
}
applicationContext.xml
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
 
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context"
xmlns:jee="http://www.springframework.org/schema/jee" xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.2.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.2.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.2.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.2.xsd">
 
    <context:annotation-config />
 
    <context:component-scan base-package="be.bibliotheque" />
 
 
    <aop:config proxy-target-class="true" />
 
<!--     <context:property-placeholder ignore-unresolvable="false" location="classpath:/config.properties,classpath:/secret.properties"/> -->
 
 
    <!-- for injecting value in application context.xml -->
    <bean id="propertyPlaceholder" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
        <property name="systemPropertiesModeName" value="SYSTEM_PROPERTIES_MODE_OVERRIDE"/>
        <property name="ignoreResourceNotFound" value="true"/>
        <property name="locations">
            <list>
                <value>classpath:/jdbc.properties</value>
            </list>
        </property>
    </bean>
 
    <bean id="entityManagerFactory"   class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
        <property name="persistenceUnitName" value="Connection" />
        <property name="dataSource" ref="dataSource"/>  
 
        <property name="jpaVendorAdapter">
            <bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter" />
        </property>
        <property name="jpaProperties">
 
            <!-- set extra properties here, e.g. for Hibernate: -->
            <props>
<!--            <prop key="hibernate.connection.url">${DB.url}</prop>
                <prop key="hibernate.connection.username">${DB.userName}</prop>
                <prop key="hibernate.connection.password">${DB.password}</prop>-->
                <prop key="hibernate.showsql">true</prop>
             </props>
        </property>
 
    </bean>
 
    <!-- database -->
     <bean id="dataSource" class="org.apache.commons.dbcp.datasources.SharedPoolDataSource"
        destroy-method="close">
        <property name="connectionPoolDataSource">
            <bean
                class="org.apache.commons.dbcp.cpdsadapter.DriverAdapterCPDS">
               <!-- <property name="driver" value="net.sf.log4jdbc.DriverSpy" /> use this to trace jdbc BOTH JPA AND JdbcTemplate--> 
                <property name="driver" value="com.mysql.jdbc.Driver" />
                <property name="url" value="${DB.url}" />
                <property name="user" value="${DB.userName}" />
                <property name="password" value="${DB.password}" />
                <property name="maxActive" value="0" />
                <property name="maxIdle" value="0" />
                <property name="poolPreparedStatements" value="true" />
            </bean>
        </property>
        <property name="maxWait" value="60000" />
        <property name="defaultAutoCommit" value="false" />
        <property name="defaultReadOnly" value="false" />
    </bean>
 
 
 
 
    <!-- Transaction manager for a single JPA EntityManagerFactory (alternative to JTA) -->
    <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager"
          p:entityManagerFactory-ref="entityManagerFactory" />
    <tx:annotation-driven />
 
 
 
    <!-- Configure the multipart resolver (image upload) -->
    <bean id="multipartResolver"
    class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
        <!-- one of the properties available; the maximum file size in bytes (10mb
        here) -->
        <property name="maxUploadSize" value="10000000" />
        <property name="maxInMemorySize" value="10000000" />
    </bean>
 
 
</beans>