Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [java.lang.ArrayIndexOutOfBoundsException: 1] with root cause
在springboot中的shiro自定义配置类注入RedisManager,在比较旧的版本是host和port分开写,新的版本需要把host和port拼接起来,通过redismanager源码中可以看到,init()是通过字符串分割 “:” ,来分别获取host和port,
public class RedisManager extends WorkAloneRedisManager implements IRedisManager {
private static final String DEFAULT_HOST = "127.0.0.1:6379";
private String host = "127.0.0.1:6379";
private int timeout = 2000;
private String password;
private int database = 0;
private JedisPool jedisPool;
public RedisManager() {
}
private void init() {
synchronized(this) {
if (this.jedisPool == null) {
String[] hostAndPort = this.host.split(":");
this.jedisPool = new JedisPool(this.getJedisPoolCo