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

Persistance des données Java Discussion :

Problème d'intégration de ehcache dans Spring


Sujet :

Persistance des données Java

Mode arborescent

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre averti
    Homme Profil pro
    Étudiant
    Inscrit en
    Mai 2013
    Messages
    29
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Mai 2013
    Messages : 29
    Par défaut Problème d'intégration de ehcache dans Spring
    Bonjour,

    Je suis actuellement dans une impasse. En effet, je cherche à intégrer ehcache avec Spring 2.0.5.

    Voici donc comment je m'y suis pris :

    Configuration Spring :
    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
    <?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:ehcache="http://ehcache-spring-annotations.googlecode.com/svn/schema/ehcache-spring"
    	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.0.xsd 
    		http://ehcache-spring-annotations.googlecode.com/svn/schema/ehcache-spring
    		http://ehcache-spring-annotations.googlecode.com/svn/schema/ehcache-spring/ehcache-spring-1.1.xsd
    		http://www.springframework.org/schema/tx 
    		http://www.springframework.org/schema/tx/spring-tx-2.0.xsd">
     
    	<!--  Cache de second niveau : ehcache -->
    	<ehcache:annotation-driven cache-manager="ehCacheManager" />
        <bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean">
        	<property name="configLocation"  value="ehcache.xml"/>
    	</bean>
     
    	<!-- couches applicatives -->
    	<bean id="dao" class="dao.Dao" />
    	<bean id="service" class="service.Service">
    		<property name="dao" ref="dao" />
    	</bean>
     
    	<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
    		<property name="dataSource" ref="dataSource" />
    		<property name="jpaVendorAdapter">
    			<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
    				<!-- 
    					<property name="showSql" value="true" />
    				-->
    				<property name="databasePlatform" value="org.hibernate.dialect.MySQL5InnoDBDialect" />
    				<property name="generateDdl" value="true" />
    			</bean>
    		</property>
    		<property name="loadTimeWeaver">
    			<bean class="org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver" />
    		</property>
    	</bean>
     
    	<!-- la source de donnéees DBCP -->
    	<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
    		<property name="driverClassName" value="com.mysql.jdbc.Driver" />
    		<property name="url" value="jdbc:mysql://localhost:3306/jpaTest" />
    		<property name="username" value="root" />
    		<property name="password" value="" />
    	</bean>
     
    	<!-- le gestionnaire de transactions -->
    	<tx:annotation-driven transaction-manager="txManager" />
    	<bean id="txManager" class="org.springframework.orm.jpa.JpaTransactionManager">
    		<property name="entityManagerFactory" ref="entityManagerFactory" />
    	</bean>
     
    	<!-- traduction des exceptions -->
    	<bean class="org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor" />
     
    	<!-- persistence -->
    	<bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" />
     
    </beans>
    Configuration ehcache :
    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
    <?xml version="1.0" encoding="UTF-8"?>
    <ehcache 
    	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="http://ehcache.org/ehcache.xsd" 
        updateCheck="false">
     
        <diskStore path="java.io.tmpdir/Buggup" />
     
        <defaultCache
        	maxElementsInMemory="10000" 
    	    eternal="false" 
    	    timeToIdleSeconds="120" 
    	    timeToLiveSeconds="120" 
    	    overflowToDisk="true" 
    	    diskSpoolBufferSizeMB="30" 
    	    maxElementsOnDisk="10000000" 
    	    diskPersistent="false" 
    	    diskExpiryThreadIntervalSeconds="120" 
    	    memoryStoreEvictionPolicy="LRU" /> 
     
        <cache 
        	name="personneCache" 
            maxElementsInMemory="100000" 
            maxElementsOnDisk="10000000" 
            eternal="true" 
            overflowToDisk="true" 
            diskSpoolBufferSizeMB="20" 
            diskPersistent="false"
            timeToIdleSeconds="0" 
            timeToLiveSeconds="300"
            memoryStoreEvictionPolicy="LRU" />
     
        <cache 
        	name="elementCache" 
        	maxElementsInMemory="100000" 
            maxElementsOnDisk="10000000" 
            eternal="true" 
            overflowToDisk="true" 
            diskSpoolBufferSizeMB="20" 
            diskPersistent="false"
            timeToIdleSeconds="0" 
            timeToLiveSeconds="300"
            memoryStoreEvictionPolicy="LRU" />
     
    </ehcache>
    Et voici l'ensemble de mes libraires :
    Cf PJ - Sans titrelib.png

    Ensuite, lorsque j'exécute mon code, voici l'erreur qui est soulevée :

    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
    [thread applet-client.Api.class] INFO org.springframework.context.support.ClassPathXmlApplicationContext - Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@3f9b12fb: display name [org.springframework.context.support.ClassPathXmlApplicationContext@3f9b12fb]; startup date [Tue Jun 25 17:11:05 CEST 2013]; root of context hierarchy
    [thread applet-client.Api.class] INFO org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from class path resource [spring-config.xml]
    org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [spring-config.xml]; nested exception is java.lang.NoSuchMethodError: org.springframework.aop.config.AopNamespaceUtils.registerAutoProxyCreatorIfNecessary(Lorg/springframework/beans/factory/xml/ParserContext;Lorg/w3c/dom/Element;)V
    Caused by: java.lang.NoSuchMethodError: org.springframework.aop.config.AopNamespaceUtils.registerAutoProxyCreatorIfNecessary(Lorg/springframework/beans/factory/xml/ParserContext;Lorg/w3c/dom/Element;)V
    	at com.googlecode.ehcache.annotations.config.AnnotationDrivenEhCacheBeanDefinitionParser.parse(AnnotationDrivenEhCacheBeanDefinitionParser.java:76)
    	at org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:69)
    	at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1114)
    	at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1104)
    	at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:133)
    	at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:90)
    	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:458)
    	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:353)
    	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:303)
    	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:280)
    	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:131)
    	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:147)
    	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:173)
    	at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:112)
    	at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:79)
    	at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:101)
    	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:313)
    	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 client.Api.init(Api.java:80)
    	at sun.applet.AppletPanel.run(Unknown Source)
    	at java.lang.Thread.run(Unknown Source)
    Savez-vous ou je me serais trompé dans ma configuration ?

    Merci d'avance.
    Images attachées Images attachées  

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

Discussions similaires

  1. [ehcache] Problème d'intégration de ehcache dans Spring
    Par anthony22360 dans le forum Spring
    Réponses: 0
    Dernier message: 25/06/2013, 19h55
  2. [Data] problème d'integration de hibernate dans spring
    Par manu11 dans le forum Spring
    Réponses: 7
    Dernier message: 29/09/2009, 09h32
  3. [Struts] Intégration de struts dans spring
    Par khaigo dans le forum Spring Web
    Réponses: 1
    Dernier message: 08/06/2009, 10h31
  4. Problème d'intégration de PDF dans mon document LaTex
    Par joel88 dans le forum Tableaux - Graphiques - Images - Flottants
    Réponses: 6
    Dernier message: 17/04/2009, 10h41
  5. [XSL/JavaScript]problème d'intégration code JS dans le XSL
    Par Devil666 dans le forum Général JavaScript
    Réponses: 4
    Dernier message: 27/04/2005, 16h36

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