我做错了什么?谢谢你! 库:http://cs621531.vk.me/v621531427/4ebb/vU1vHpBjyhQ.jpg抱歉,没剪。 Pom:httppastebin.com/7rSWG89Q 完整堆栈记录:http://pastebin.com/uwQsnwGn
@Cacheable(value = "servicesByCategoryId", key = "T(java.lang.String).valueOf(#id).concat('-').concat(" +
"T(java.lang.String).valueOf(#page)).concat('-').concat(T(java.lang.String).valueOf(#perPage))" +
".concat('-').concat(#orderBy).concat('-').concat(#order)")
<beans xmlns:context="http://www.springframework.org/schema/context"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:cache="http://www.springframework.org/schema/cache"
xmlns="http://www.springframework.org/schema/beans" xsi:schemaLocation=
"http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-4.0.xsd
http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache.xsd">
<context:annotation-config/>
<context:component-scan base-package="com.vse.uslugi"/>
<cache:annotation-driven key-generator="enhancedDefaultKeyGenerator"/>
<bean id="enhancedDefaultKeyGenerator" class="...utilities.generators.EnhancedDefaultKeyGenerator"/>
<小时/>
<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache</artifactId>
<version>2.9.0</version>
<scope>provided</scope>
</dependency
最佳答案
这是一个依赖性问题。 尝试不依赖 ehcache 看看是否有效。如果没有,请尝试 ehcache 的“2.8.3”版本,这应该是 Spring 4 想要的版本。
关于java.lang.NoClassDefFoundError : Could not initialize class net. sf.ehcache.config.ConfigurationFactory,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27556334/