java.lang.NoClassDefFoundError : Could not initialize class net. sf.ehcache.config.ConfigurationFactory

标签 java

我做错了什么?谢谢你! 库: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/

相关文章:

java - JAXB 编码错误

Java NIO 客户端

java - 为什么 Java lmax Disruptor 在通过 EventProcessors 传递事件时有很大的延迟?

java - 错误: incompatible types: char cannot be converted to String - Java

java - 如何创建日期计时器

java - 如何使用 C# 终止正在运行的 jar 文件

java - 如何在Java中获取YYYY-MM-DD HH :MI:Sec.毫秒格式的当前时间?

java - 在try-with-resources中声明的变量的注释?

java - 动态调用非静态方法

java - 编写自定义 ListCellRenderer