@Cacheable异常

org.springframework.expression.spel.SpelEvaluationException: EL1030E: The operator 'ADD' is not supported between objects of type 'java.lang.Integer' and '[Ljava.lang.String;'

以上是异常信息

 

下面是方法以及

 @Cacheable(cacheNames = "paperin", key = "#p0+#p1+#p2+#p3")
public Result getPaperGraph(Integer startYear, Integer endYear, String[] fieldSubs, String[] countries) {}

解决方法:

在integer类型数据和String[] 参数中间加一个

String splitFlag="-";

这样的字符串。

结果是这样的:

@Cacheable(cacheNames = "paperin", key = "#p0+#p1+#p2+#p3+#p4")
public Result getPaperGraph(Integer startYear, Integer endYear, String splitFlag, String[] fieldSubs, String[] countries){

 

你可能感兴趣的:(Java)