2016-07-20 15 views
2

我读春天开机documentation,似乎如果我使用Thymeleaf,我可以再补充以下我application.properties文件来实现缓存无效:缓存在春季启动+ Thymeleaf应用猛击

spring.resources.chain.strategy.content.enabled=true 
spring.resources.chain.strategy.content.paths=/** 

但不起作用!

这是我看到的错误:

Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.springframework.boot.autoconfigure.web.ResourceProperties org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration$WebMvcAutoConfigurationAdapter.resourceProperties; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'spring.resources.CONFIGURATION_PROPERTIES': Could not bind properties to [unknown] (target=spring.resources, ignoreInvalidFields=false, ignoreUnknownFields=false, ignoreNestedProperties=false); nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'chain[strategy][fixed][version]' of bean class [org.springframework.boot.autoconfigure.web.ResourceProperties]: Cannot access indexed value in property referenced in indexed property path 'chain[strategy][fixed][version]'; nested exception is org.springframework.beans.NotReadablePropertyException: Invalid property 'chain[strategy][fixed][version]' of bean class [org.springframework.boot.autoconfigure.web.ResourceProperties]: Bean property 'chain[strategy][fixed][version]' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?

我缺少什么?

+0

你可以在这里添加剩余的代码吗? –

+0

@ChathurangaTennakoon我还没有在代码中添加任何配置。我让Spring Boot为我处理它。 –

回答

4

问题在于我使用的弹簧引导版本。在1.3版本中,Spring Boot 1.2没有任何这样的属性。