提问:版本:
spring-data-redis | jedis |
1.8.1 | 2.9.0 |
测试没问题:
@RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration("classpath:spring-*.xml") public class RedisTest { /*public static void main(String[] args){ Jedis jedis = new Jedis("139.224.52.12",6379); jedis.auth("123456"); // 设置密码 System.out.println("Connection to server sucessfully"); //check whether server is running or not System.out.println("Server is running: "+jedis.ping()); jedis.lpush("wonder-list", "Redis");