问题描述
我正在使用 ehcache 测试 Spring Boot 1.3.0.M3 并遇到一些问题。
i am testing Spring Boot 1.3.0.M3 with ehcache and got some problems.
我在控制台上发生异常后启动应用程序:
When i'm starting the application following exception occurs on the console:
我的pom.xml:
...
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.3.0.M3</version>
</parent>
...
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-cache</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache</artifactId>
</dependency>
...
</dependencies>
...
mvn depency:tree
mvn depency:tree
我的类路径中有一个ehcache.xml,并且实例化了EHCacheManager。
当我删除spring-boot-starter-cache-和ehcache-dependency时,一切都很顺利。 (但是只能使用ConcurrentMapCacheManager)
I have an ehcache.xml in my classpath and the EHCacheManager is instantiated.When i remove the spring-boot-starter-cache- and ehcache-dependency everything starts fine. (But then only with ConcurrentMapCacheManager)
问题:
我是否需要速度使用spring-boot-starter-cache还是有其他缺失或错误的东西?
Do I need velocity with spring-boot-starter-cache or is there something other missing or wrong?
推荐答案
VelocityAutoConfiguration
只有在类路径中存在这两个类时才会启动:
The VelocityAutoConfiguration
only kicks in if these 2 classes are present in the classpath:
@ConditionalOnClass({ VelocityEngine.class, VelocityEngineFactory.class })
它们来自 org.apache.velocity :velocity
和 org.springframework:spring-context-support
。
你可以识别哪些依赖项正在将这些依赖项传递给项目:
You can identify which dependencies are transitively adding those to the project with:
mvn dependency:tree
这篇关于Spring Boot Starter Cache - 缺少Velocity?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!