Spring Boot Starter Cache - 缺少Velocity? [英] Spring Boot Starter Cache - Velocity is missing?

查看:674
本文介绍了Spring Boot Starter Cache - 缺少Velocity?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 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:


线程main中的异常
org.springframework.beans .factory.BeanCreationException:错误
创建名为'velocityConfigurer'的bean在类路径中定义
resource
[org / springframework / boot / autoconfigure / velocity / VelocityAutoConfiguration $ VelocityWebConfiguration.class]:
调用init方法失败;嵌套异常是
java.lang.NoClassDefFoundError:
org / apache / velocity / runtime / log / CommonsLogLogChute at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java :1578)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545)
at
org.springframework.beans.factory.support .AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
at
org.springframework.beans.factory.support.AbstractBeanFactory $ 1.getObject(AbstractBeanFactory.java:305)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:301)
at
org.springframework.b eans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:196)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:772)
at
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:834)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:537)
at
org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)
at
org.springframework.boot.SpringApplication.refresh(SpringApplication.java :667)
at
org.springframework.boot.SpringApplication.doRun(SpringApplication.java:342)
at
org.springframework.boot.SpringApplication.run(SpringApplication.java :273)
at
org.springframework.boot.SpringApplication.run( SpringApplication.java:971)
at
org.springframework.boot.SpringApplication.run(SpringApplication.java:960)
at
com.aconso.creator2.CreatorApplication.main( CreatorApplication.java:26)
引起:java.lang.NoClassDefFoundError:
org / apache / velocity / runtime / log / CommonsLogLogChute at
org.springframework.ui.velocity.VelocityEngineFactory.createVelocityEngine (VelocityEngineFactory.java:238)
at
org.springframework.web.servlet.view.velocity.VelocityConfigurer.afterPropertiesSet(VelocityConfigurer.java:120)
at
org.springframework .beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1637)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574)
... 16更多引起:java.lang.ClassNotFoundException:
org.apache.velocity.runtime.log.Commo nsLogLogChute在
java.net.URLClassLoader $ 1.run(URLClassLoader.java:366)at
java.net.URLClassLoader $ 1.run(URLClassLoader.java:355)at
java.security。在
java.net.URLClassLoader.findClass(URLClassLoader.java:354)的
java.lang.ClassLoader.loadClass(ClassLoader.java:425)
的AccessController.doPrivileged(Native Method) sun.misc.Launcher $ AppClassLoader.loadClass(Launcher.java:308)at
java.lang.ClassLoader.loadClass(ClassLoader.java:358)... 20 more

Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'velocityConfigurer' defined in class path resource [org/springframework/boot/autoconfigure/velocity/VelocityAutoConfiguration$VelocityWebConfiguration.class]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/apache/velocity/runtime/log/CommonsLogLogChute at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1578) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:305) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:301) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:196) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:772) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:834) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:537) at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:667) at org.springframework.boot.SpringApplication.doRun(SpringApplication.java:342) at org.springframework.boot.SpringApplication.run(SpringApplication.java:273) at org.springframework.boot.SpringApplication.run(SpringApplication.java:971) at org.springframework.boot.SpringApplication.run(SpringApplication.java:960) at com.aconso.creator2.CreatorApplication.main(CreatorApplication.java:26) Caused by: java.lang.NoClassDefFoundError: org/apache/velocity/runtime/log/CommonsLogLogChute at org.springframework.ui.velocity.VelocityEngineFactory.createVelocityEngine(VelocityEngineFactory.java:238) at org.springframework.web.servlet.view.velocity.VelocityConfigurer.afterPropertiesSet(VelocityConfigurer.java:120) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1637) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574) ... 16 more Caused by: java.lang.ClassNotFoundException: org.apache.velocity.runtime.log.CommonsLogLogChute at java.net.URLClassLoader$1.run(URLClassLoader.java:366) at java.net.URLClassLoader$1.run(URLClassLoader.java:355) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:354) at java.lang.ClassLoader.loadClass(ClassLoader.java:425) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:358) ... 20 more

我的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


org.springframework.boot:spring-boot-starter-web:jar:1.3.0.M3:compile
[INFO] | + -
org.springframework.boot:spring-boot-starter:jar:1.3.0.M3:compile
[INFO] | | + -
org.springframework.boot:spring-boot:jar:1.3.0.M3:compile [INFO] | |
+ - org.springframework.boot:spring-boot-autoconfigure:jar:1.3.0.M3:compile
[INFO] | | - org.yaml:snakeyaml:jar:1.15:编译[INFO] | + -
org.springframework.boot:spring-boot-starter-validation:jar:1.3.0.M3:compile
[INFO] | | -
org.hibernate:hibernate-validator:jar:5.2.1.Final:compile [INFO] | |
+ - javax.validation:validation-api:jar:1.1.0.Final:compile [INFO] | | - com.fasterxml:classmate:jar:1.1.0:compile [INFO] | + -
com.fasterxml.jackson.core:jackson-databind:jar:2.6.1:compile [INFO] |
| + - com.fasterxml.jackson.core:jackson-annotations:jar:2.6.1:compile
[INFO] | | -
com.fasterxml.jackson.core:jackson-core:jar:2.6.1:compile [INFO] | + -
org.springframework:spring-web:jar:4.2.0.RELEASE:compile [INFO] | -
org.springframework:spring-webmvc:jar:4.2.0.RELEASE:compile [INFO] |

- org.springframework:spring-expression:jar:4.2.0.RELEASE:编译
[INFO] + -
org.springframework.boot:spring-boot-starter-tomcat:jar:1.3.0.M3:提供
[INFO] | + -
org.apache.tomcat.embed:tomcat-embed-core:jar:8.0.23:提供[INFO] |
+ - org.apache.tomcat.embed:tomcat-embed-el:jar:8.0.23:compile [INFO] | + - org.apache.tomcat.embed:tomcat-embed-logging-juli:jar:8.0.23:提供
[INFO] | -
org.apache.tomcat.embed:tomcat-embed-websocket:jar:8.0.23:提供
[INFO] + -
org.springframework.boot:spring-boot-starter -cache:jar:1.3.0.M3:编译
[INFO] | + -
org.springframework:spring-context:jar:4.2.0.RELEASE:compile [INFO] |
-
org.springframework:spring-context-support:jar:4.2.0.RELEASE:compile
[INFO] + -
org.springframework.boot:spring-boot -starter-security:jar:1.3.0.M3:编译
[INFO] | + - org.springframework:spring-aop:jar:4.2.0.RELEASE:compile
[INFO] | | - aopalliance:aopalliance:jar:1.0:编译[INFO] | + -
org.springframework.security:spring-security-config:jar:4.0.2.RELEASE:compile
[INFO] | -
org.springframework.security:spring-security-web:jar:4.0.2.RELEASE:compile
[INFO] + -
org.springframework.security:spring-security-cas :jar:4.0.2.RELEASE:编译
[INFO] | + - org.jasig.cas.client:cas-client-core:jar:3.3.3:compile
[INFO] | | - org.opensaml:opensaml:jar:2.5.1-1:compile [INFO] | |
+ - org.opensaml:openws:jar:1.4.2-1:compile [INFO] | | | + - org.opensaml:xmltooling:jar:1.3.2-1:compile [INFO] | | | | + -
org.slf4j:log4j-over-slf4j:jar:1.7.12:compile [INFO] | | | | + -
joda-time:joda-time:jar:2.8.1:编译[INFO] | | | | + -
org.bouncycastle:bcprov-jdk15:jar:1.45:compile [INFO] | | | |
+ - org.apache.santuario:xmlsec:jar:1.4.4:compile [INFO] | | | | + - ca.juliusdavies:not-yet-commons-ssl:jar:0.3.9:compile [INFO] | | | | - net.jcip:jcip-annotations:jar:1.0:compile [INFO] | | |
+ - commons-codec:commons-codec:jar:1.3:compile [INFO] | | | - commons-httpclient:commons-httpclient:jar:3.1:compile [INFO] | |

+ - commons-collections:commons-collections:jar:3.2.1:compile [INFO] | | + - commons-lang:commons-lang:jar:2.1:compile [INFO] | | + -
velocity:velocity:jar:1.5:编译[INFO] | | + -
org.owasp.esapi:esapi:jar:2.0GA:compile [INFO] | | + -
xml-apis:xml-apis:jar:1.4.01:编译[INFO] | | + -
xerces:xercesImpl:jar:2.10.0:runtime [INFO] | | + -
xml-resolver:xml-resolver:jar:1.2:runtime [INFO] | | -
xalan:xalan:jar:2.7.1:runtime [INFO] | | -
xalan:serializer:jar:2.7.1:runtime [INFO] | + -
org.springframework.security:spring-security-core:jar:4.0.2.RELEASE:compile
[INFO] | + -
org.springframework:spring-beans:jar:4.2.0.RELEASE:compile [INFO] |
- org.springframework:spring-core:jar:4.2.0.RELEASE:compile [INFO] + -
org.springframework.boot:spring-boot-starter-thymeleaf:jar:1.3.0 .M3:编译
[INFO] | + - org.thymeleaf:thymeleaf-spring4:jar:2.1.4.RELEASE:编译
[INFO] | -
nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect:jar:1.2.9:compile
[INFO] + -
org.thymeleaf.extras:thymeleaf-extras-springsecurity4 :jar:2.1.2.RELEASE:编译
[INFO] | + - org.thymeleaf:thymeleaf:jar:2.1.4.RELEASE:compile [INFO]
| | + - ognl:ognl:jar:3.0.8:编译[INFO] | | + -
org.javassist:javassist:jar:3.18.1-GA:compile [INFO] | | -
org.unbescape:unbescape:jar:1.1.0.RELEASE:compile [INFO] | -
org.slf4j:slf4j-api:jar:1.7.12:compile [INFO] + -
org.springframework.boot:spring-boot-starter-log4j2:jar:1.3.0.M3 :编译
[INFO] | + - org.apache.logging.log4j:log4j-slf4j-impl:jar:2.3:compile
[INFO] | + - org.apache.logging.log4j:log4j-api:jar:2.3:compile [INFO]
| + - org.apache.logging.log4j:log4j-core:jar:2.3:compile [INFO] | + -
org.slf4j:jcl-over-slf4j:jar:1.7.12:compile [INFO] | -
org.slf4j:jul-to-slf4j:jar:1.7.12:compile [INFO] + -
org.springframework.boot:spring-boot-starter-actuator:jar:1.3.0 .M3:编译
[INFO] | -
org.springframework.boot:spring-boot-actuator:jar:1.3.0.M3:compile
[INFO] + -
org.springframework.boot:spring-boot-starter -data-jpa:jar:1.3.0.M3:编译
[INFO] | + -
org.springframework.boot:spring-boot-starter-aop:jar:1.3.0.M3:compile
[INFO] | | + - org.aspectj:aspectjrt:jar:1.8.6:compile [INFO] | |
- org.aspectj:aspectjweaver:jar:1.8.6:compile [INFO] | + -
org.springframework.boot:spring-boot-starter-jdbc:jar:1.3.0.M3:compile
[INFO] | | + - org.apache.tomcat:tomcat-jdbc:jar:8.0.23:compile
[INFO] | | | - org.apache.tomcat:tomcat-juli:jar:8.0.23:compile
[INFO] | | -
org.springframework:spring -jdbc:jar:4.2.0.RELEASE:compile [INFO] | + -
org.hibernate:hibernate-entitymanager:jar:4.3.10.Final:compile [INFO]
| | + - org.jboss.logging:jboss-logging:jar:3.1.3.GA:compile [INFO] |
| + -
org.jboss.logging:jboss-logging-annotations:jar:1.2.0.Beta1:compile
[INFO] | | + - org.hibernate:hibernate-core:jar:4.3.10.Final:compile
[INFO] | | | + - antlr:antlr:jar:2.7.7:编译[INFO] | | | -
org.jboss:jandex:jar:1.1.0.Final:compile [INFO] | | + -
dom4j:dom4j:jar:1.6.1:编译[INFO] | | + -
org.hibernate.common:hibernate-commons-annotations:jar:4.0.5.Final:compile
[INFO] | | -
org.hibernate.javax.persistence:hibernate-jpa-2.1-api:jar:1.0.0.Final:compile
[INFO] | + - javax.transaction:javax.transaction-api:jar:1.2:compile
[INFO] | + -
org.springframework.data:spring-data-jpa:jar:1.9.0.RC1:compile [INFO]
| | + -
org.springframework.data:spring-data-commons:jar:1.11.0.RC1:compile
[INFO] | | + -
org.springframework:spring-orm:jar:4.2.0.RELEASE:compile [INFO] | |
- org.springframework:spring-tx:jar:4.2.0.RELEASE:compile [INFO] |
- org.springframework:spring-aspects:jar:4.2.0.RELEASE:compile [INFO]
+ - org.hsqldb:hsqldb:jar:2.3.3:runtime [INFO] + - org .springframework.boot:spring-boot-starter-test:jar:1.3.0.M3:test
[INFO] | + - junit:junit:jar:4.12:test [INFO] | + -
org.mockito:mockito-core:jar:1.10.19:test [INFO] | | -
org.objenesis:objenesis:jar:2.1:test [INFO] | + -
org.hamcrest:hamcrest-core:jar:1.3:test [INFO] | + -
org.hamcrest:hamcrest-library:jar:1.3:test [INFO] | -
org.springframework:spring-test:jar:4.2.0.RELEASE:test [INFO] + -
org.webjars:angularjs:jar:1.4.2:compile [INFO] + -
org.webjars:jquery:jar:2.1.4:compile [INFO] + -
org.webjars:bootstrap:jar:3.3.5:compile [INFO] + -
org.webjars :angular-file-upload:jar:5.0.0:compile [INFO] + -
net.sf.jtidy:jtidy:jar:r938:compile [INFO] + -
org.jsoup:jsoup :jar:1.8.2:compile [INFO] -
net.sf.ehcache:ehcache:jar:2.10.0:compile

org.springframework.boot:spring-boot-starter-web:jar:1.3.0.M3:compile [INFO] | +- org.springframework.boot:spring-boot-starter:jar:1.3.0.M3:compile [INFO] | | +- org.springframework.boot:spring-boot:jar:1.3.0.M3:compile [INFO] | | +- org.springframework.boot:spring-boot-autoconfigure:jar:1.3.0.M3:compile [INFO] | | - org.yaml:snakeyaml:jar:1.15:compile [INFO] | +- org.springframework.boot:spring-boot-starter-validation:jar:1.3.0.M3:compile [INFO] | | - org.hibernate:hibernate-validator:jar:5.2.1.Final:compile [INFO] | | +- javax.validation:validation-api:jar:1.1.0.Final:compile [INFO] | | - com.fasterxml:classmate:jar:1.1.0:compile [INFO] | +- com.fasterxml.jackson.core:jackson-databind:jar:2.6.1:compile [INFO] | | +- com.fasterxml.jackson.core:jackson-annotations:jar:2.6.1:compile [INFO] | | - com.fasterxml.jackson.core:jackson-core:jar:2.6.1:compile [INFO] | +- org.springframework:spring-web:jar:4.2.0.RELEASE:compile [INFO] | - org.springframework:spring-webmvc:jar:4.2.0.RELEASE:compile [INFO] |
- org.springframework:spring-expression:jar:4.2.0.RELEASE:compile [INFO] +- org.springframework.boot:spring-boot-starter-tomcat:jar:1.3.0.M3:provided [INFO] | +- org.apache.tomcat.embed:tomcat-embed-core:jar:8.0.23:provided [INFO] | +- org.apache.tomcat.embed:tomcat-embed-el:jar:8.0.23:compile [INFO] | +- org.apache.tomcat.embed:tomcat-embed-logging-juli:jar:8.0.23:provided [INFO] | - org.apache.tomcat.embed:tomcat-embed-websocket:jar:8.0.23:provided [INFO] +- org.springframework.boot:spring-boot-starter-cache:jar:1.3.0.M3:compile [INFO] | +- org.springframework:spring-context:jar:4.2.0.RELEASE:compile [INFO] | - org.springframework:spring-context-support:jar:4.2.0.RELEASE:compile [INFO] +- org.springframework.boot:spring-boot-starter-security:jar:1.3.0.M3:compile [INFO] | +- org.springframework:spring-aop:jar:4.2.0.RELEASE:compile [INFO] | | - aopalliance:aopalliance:jar:1.0:compile [INFO] | +- org.springframework.security:spring-security-config:jar:4.0.2.RELEASE:compile [INFO] | - org.springframework.security:spring-security-web:jar:4.0.2.RELEASE:compile [INFO] +- org.springframework.security:spring-security-cas:jar:4.0.2.RELEASE:compile [INFO] | +- org.jasig.cas.client:cas-client-core:jar:3.3.3:compile [INFO] | | - org.opensaml:opensaml:jar:2.5.1-1:compile [INFO] | | +- org.opensaml:openws:jar:1.4.2-1:compile [INFO] | | | +- org.opensaml:xmltooling:jar:1.3.2-1:compile [INFO] | | | | +- org.slf4j:log4j-over-slf4j:jar:1.7.12:compile [INFO] | | | | +- joda-time:joda-time:jar:2.8.1:compile [INFO] | | | | +- org.bouncycastle:bcprov-jdk15:jar:1.45:compile [INFO] | | | | +- org.apache.santuario:xmlsec:jar:1.4.4:compile [INFO] | | | | +- ca.juliusdavies:not-yet-commons-ssl:jar:0.3.9:compile [INFO] | | | | - net.jcip:jcip-annotations:jar:1.0:compile [INFO] | | | +- commons-codec:commons-codec:jar:1.3:compile [INFO] | | | - commons-httpclient:commons-httpclient:jar:3.1:compile [INFO] | |
+- commons-collections:commons-collections:jar:3.2.1:compile [INFO] | | +- commons-lang:commons-lang:jar:2.1:compile [INFO] | | +- velocity:velocity:jar:1.5:compile [INFO] | | +- org.owasp.esapi:esapi:jar:2.0GA:compile [INFO] | | +- xml-apis:xml-apis:jar:1.4.01:compile [INFO] | | +- xerces:xercesImpl:jar:2.10.0:runtime [INFO] | | +- xml-resolver:xml-resolver:jar:1.2:runtime [INFO] | | - xalan:xalan:jar:2.7.1:runtime [INFO] | | - xalan:serializer:jar:2.7.1:runtime [INFO] | +- org.springframework.security:spring-security-core:jar:4.0.2.RELEASE:compile [INFO] | +- org.springframework:spring-beans:jar:4.2.0.RELEASE:compile [INFO] | - org.springframework:spring-core:jar:4.2.0.RELEASE:compile [INFO] +- org.springframework.boot:spring-boot-starter-thymeleaf:jar:1.3.0.M3:compile [INFO] | +- org.thymeleaf:thymeleaf-spring4:jar:2.1.4.RELEASE:compile [INFO] | - nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect:jar:1.2.9:compile [INFO] +- org.thymeleaf.extras:thymeleaf-extras-springsecurity4:jar:2.1.2.RELEASE:compile [INFO] | +- org.thymeleaf:thymeleaf:jar:2.1.4.RELEASE:compile [INFO] | | +- ognl:ognl:jar:3.0.8:compile [INFO] | | +- org.javassist:javassist:jar:3.18.1-GA:compile [INFO] | | - org.unbescape:unbescape:jar:1.1.0.RELEASE:compile [INFO] | - org.slf4j:slf4j-api:jar:1.7.12:compile [INFO] +- org.springframework.boot:spring-boot-starter-log4j2:jar:1.3.0.M3:compile [INFO] | +- org.apache.logging.log4j:log4j-slf4j-impl:jar:2.3:compile [INFO] | +- org.apache.logging.log4j:log4j-api:jar:2.3:compile [INFO] | +- org.apache.logging.log4j:log4j-core:jar:2.3:compile [INFO] | +- org.slf4j:jcl-over-slf4j:jar:1.7.12:compile [INFO] | - org.slf4j:jul-to-slf4j:jar:1.7.12:compile [INFO] +- org.springframework.boot:spring-boot-starter-actuator:jar:1.3.0.M3:compile [INFO] | - org.springframework.boot:spring-boot-actuator:jar:1.3.0.M3:compile [INFO] +- org.springframework.boot:spring-boot-starter-data-jpa:jar:1.3.0.M3:compile [INFO] | +- org.springframework.boot:spring-boot-starter-aop:jar:1.3.0.M3:compile [INFO] | | +- org.aspectj:aspectjrt:jar:1.8.6:compile [INFO] | | - org.aspectj:aspectjweaver:jar:1.8.6:compile [INFO] | +- org.springframework.boot:spring-boot-starter-jdbc:jar:1.3.0.M3:compile [INFO] | | +- org.apache.tomcat:tomcat-jdbc:jar:8.0.23:compile [INFO] | | | - org.apache.tomcat:tomcat-juli:jar:8.0.23:compile [INFO] | | - org.springframework:spring-jdbc:jar:4.2.0.RELEASE:compile [INFO] | +- org.hibernate:hibernate-entitymanager:jar:4.3.10.Final:compile [INFO] | | +- org.jboss.logging:jboss-logging:jar:3.1.3.GA:compile [INFO] | | +- org.jboss.logging:jboss-logging-annotations:jar:1.2.0.Beta1:compile [INFO] | | +- org.hibernate:hibernate-core:jar:4.3.10.Final:compile [INFO] | | | +- antlr:antlr:jar:2.7.7:compile [INFO] | | | - org.jboss:jandex:jar:1.1.0.Final:compile [INFO] | | +- dom4j:dom4j:jar:1.6.1:compile [INFO] | | +- org.hibernate.common:hibernate-commons-annotations:jar:4.0.5.Final:compile [INFO] | | - org.hibernate.javax.persistence:hibernate-jpa-2.1-api:jar:1.0.0.Final:compile [INFO] | +- javax.transaction:javax.transaction-api:jar:1.2:compile [INFO] | +- org.springframework.data:spring-data-jpa:jar:1.9.0.RC1:compile [INFO] | | +- org.springframework.data:spring-data-commons:jar:1.11.0.RC1:compile [INFO] | | +- org.springframework:spring-orm:jar:4.2.0.RELEASE:compile [INFO] | | - org.springframework:spring-tx:jar:4.2.0.RELEASE:compile [INFO] | - org.springframework:spring-aspects:jar:4.2.0.RELEASE:compile [INFO] +- org.hsqldb:hsqldb:jar:2.3.3:runtime [INFO] +- org.springframework.boot:spring-boot-starter-test:jar:1.3.0.M3:test [INFO] | +- junit:junit:jar:4.12:test [INFO] | +- org.mockito:mockito-core:jar:1.10.19:test [INFO] | | - org.objenesis:objenesis:jar:2.1:test [INFO] | +- org.hamcrest:hamcrest-core:jar:1.3:test [INFO] | +- org.hamcrest:hamcrest-library:jar:1.3:test [INFO] | - org.springframework:spring-test:jar:4.2.0.RELEASE:test [INFO] +- org.webjars:angularjs:jar:1.4.2:compile [INFO] +- org.webjars:jquery:jar:2.1.4:compile [INFO] +- org.webjars:bootstrap:jar:3.3.5:compile [INFO] +- org.webjars:angular-file-upload:jar:5.0.0:compile [INFO] +- net.sf.jtidy:jtidy:jar:r938:compile [INFO] +- org.jsoup:jsoup:jar:1.8.2:compile [INFO] - net.sf.ehcache:ehcache:jar:2.10.0:compile

我的类路径中有一个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?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆