Property or field ‘xxx‘ cannot be found on object of type ‘org.xx.xxObject‘ – maybe not public?问题解决

先看问题

org.springframework.expression.spel.SpelEvaluationException: EL1008E: Property or field 'selectIndexList' cannot be found on object of type 'org.springframework.cache.interceptor.CacheExpressionRootObject' - maybe not public?
	at org.springframework.expression.spel.ast.PropertyOrFieldReference.readProperty(PropertyOrFieldReference.java:226)
	at org.springframework.expression.spel.ast.PropertyOrFieldReference.getValueInternal(PropertyOrFieldReference.java:94)
	at org.springframework.expression.spel.ast.PropertyOrFieldReference.getValueInternal(PropertyOrFieldReference.java:81)
	at org.springframework.expression.spel.ast.OpMinus.getValueInternal(OpMinus.java:98)
	at org.springframework.expression.spel.ast.SpelNodeImpl.getValue(SpelNodeImpl.java:121)
	at org.springframework.expression.spel.standard.SpelExpression.getValue(SpelExpression.java:262)
	......

在springboot集成redis的时候遇到了问题:
EL1008E: Property or field ‘selectIndexList’ cannot be found on object of type ‘org.springframework.cache.interceptor.CacheExpressionRootObject’ – maybe not public?
at

解决方法:

				  ⬇️             ⬇️
@Cacheable(key = "'selectIndexList'",value = "banner") //redis缓存注解

可能是少了单引号


版权声明:本文为born_stubborn原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。