Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/396.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Spring 3.1.1和缓存配置问题_Java_Eclipse_Spring_Caching_Jakarta Ee - Fatal编程技术网

Java Spring 3.1.1和缓存配置问题

Java Spring 3.1.1和缓存配置问题,java,eclipse,spring,caching,jakarta-ee,Java,Eclipse,Spring,Caching,Jakarta Ee,我正在测试Spring缓存,这是我的上下文文件 <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:cache="http://www.springframework.org/schema/cache" xsi:schemaLocation= "http://www.spr

我正在测试Spring缓存,这是我的上下文文件

<beans xmlns="http://www.springframework.org/schema/beans" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:cache="http://www.springframework.org/schema/cache"
    xsi:schemaLocation=
    "http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache.xsd">

    <cache:annotation-driven cache-manager="simpleCacheManager"/>

    <bean id="simpleCacheManager" class="org.springframework.cache.support.SimpleCacheManager">
        <property name="caches">
            <set>
                <bean class="org.springframework.cache.concurrent.ConcurrentCacheFactoryBean">
                    <property name="name" value="alfresco"/>
                </bean> 
                <bean class="org.springframework.cache.concurrent.ConcurrentCacheFactoryBean">
                    <property name="name" value="alfresco_article"/>
                </bean> 
                <bean class="org.springframework.cache.concurrent.ConcurrentCacheFactoryBean">
                    <property name="name" value="alfresco_action"/>
                </bean>
            </set>
        </property>
    </bean>
aop-alliance.jar和org.springframework.aop-3.1.1.RELEASE.jar都在类路径中

有线索吗

谢谢,

Andrea

仔细检查org.springframework.context-3.1.1.RELEASE.jar是否确实在类路径上。Eclipse验证和错误都指向了这个问题

更新:我查过了,你是对的
ConcurrentCacheFactoryBean
似乎从3.1.0.M1开始被删除,并可能被同一软件包中的
ConcurrentMapCacheFactoryBean
替换。我还没有在发行说明中找到任何证据。但是,如果您将缓存的bean类名更改为
ConcurrentMapCacheFactoryBean
,它似乎工作正常

<bean class="org.springframework.cache.concurrent.ConcurrentMapCacheFactoryBean">
    <property name="name" value="alfresco"/>
</bean> 


更新2:是的,事实上,
ConcurrentCacheFactoryBean
已经到了
ConcurrentMapCacheFactoryBean
他们只是没有抽出时间来更新教程。

是的,它是有效的,但仍然是java.lang.ClassNotFoundException:org.springframework.aop.config.AopNamespaceUtils。有没有可能其他东西已经改变了?该类在classpath
AopNamespaceUtils
上可用,应该在您的
spring-aop-3.1.1.RELEASE.jar中-确保包含它。此外,这与缓存配置没有多大关系;-)
springaop
取决于
aopalliance-1.0.jar
。确保你有它。
<bean class="org.springframework.cache.concurrent.ConcurrentMapCacheFactoryBean">
    <property name="name" value="alfresco"/>
</bean>