title: Can't connect to redis from spring inside docker container
body: <p>I am experimenting with containerization and trying to run an executable jar inside a docker container that writes to redis.</p>
  
  <p>I have already tried every suggestion on StackOverflow that I could find, including:</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/37867633/">Cannot connect to redis using jedis</a></li>
  <li><a href="https://stackoverflow.com/questions/47529105/">Not able to connect to redis server from docker container</a></li>
  <li><a href="https://stackoverflow.com/questions/40157644/">Error starting spring session + redis in docker</a></li>
  <li><a href="https://stackoverflow.com/questions/44043358/">spring server cannot connect to redis using jedis client</a></li>
  <li><a href="https://stackoverflow.com/questions/51488311/">Docker compose spring boot redis connection issue</a></li>
  <li><a href="https://stackoverflow.com/questions/51427713/">Could not connect to Redis at 10.XX.XX.28:6379: Unknown error - while accessing from Spring Batch or windows machine</a></li>
  </ul>
  
  <p>I am on OSX High Sierra 10.13.6 and using the latest Docker Desktop (Community) Version 2.0.0.0-mac81
  Docker engine 18.09.0
  Docker compose: 1.23.2</p>
  
  <p>I'm using redis which was installed by Homebrew:
  Redis server v=5.0.2 sha=00000000:0 malloc=libc bits=64 build=25bb354a43384ae5</p>
  
  <p>I've modified the redis.conf file to disable binding and turn off protected-mode</p>
  
  <p>inside /usr/local/etc/redis.conf comment out all bind commands, e.g. </p>
  
  <pre><code>    #bind 127.0.0.1 ::1
      #bind 0.0.0.0 ::1 
  </code></pre>
  
  <p>set protected-mode to off</p>
  
  <pre><code>    protected-mode no
  </code></pre>
  
  <p>I'm running the redis server this way to enable those changes:</p>
  
  <pre><code>redis-server /usr/local/etc/redis.conf 
  </code></pre>
  
  <p>I'm listening to redis via redis-cli this way:</p>
  
  <pre><code>redis-cli monitor
  </code></pre>
  
  <p>Here's my Dockerfile:</p>
  
  <pre><code>FROM alpine:3.2
  RUN apk --update add openjdk7-jre
  RUN apk add bash
  
  ENV \
      LC_ALL=en_US.UTF-8 \
      GRADLE_USER_HOME=/tmp
  
  RUN mkdir -p /var/foo/helloredis
  
  ENV PATH "$PATH:."
  ENV CLASSPATH "$CLASSPATH:."
  
  EXPOSE 8080
  
  COPY target/foo-v1.jar  /var/foo/helloredis
  
  WORKDIR /var/foo/helloredis
  #ENTRYPOINT ["/bin/bash"]
  ENTRYPOINT ["java", "-jar", "foo-v1.jar"]
  </code></pre>
  
  <p>Here is a simple spring app I am using to try to debug this, which I then can compile and run in bash  which connects to redis without issues.</p>
  
  <pre><code>mvn clean install
  java -jar target/foo-v1.jar
  curl -4 localhost:8080/set
  </code></pre>
  
  <p>happy redis-cli output:</p>
  
  <pre><code>1544470460.458554 [0 127.0.0.1:55989] "PSUBSCRIBE" "__keyevent@*:expired" "spring:session:event:created:*" "__keyevent@*:del"
  1544470469.040193 [0 127.0.0.1:55991] "HMSET" "spring:session:sessions:934a7e2b-5c28-4c04-8361-57811d153b3e" "lastAccessedTime" "\xac\xed\x00\x05sr\x00\x0ejava.lang.Long;\x8b\xe4\x90\xcc\x8f#\xdf\x02\x00\x01J\x00\x05valuexr\x00\x10java.lang.Number\x86\xac\x95\x1d\x0b\x94\xe0\x8b\x02\x00\x00xp\x00\x00\x01g\x99\x9d\x19\x9d" "sessionAttr:testKey" "\xac\xed\x00\x05t\x00\ttestValue" "maxInactiveInterval" "\xac\xed\x00\x05sr\x00\x11java.lang.Integer\x12\xe2\xa0\xa4\xf7\x81\x878\x02\x00\x01I\x00\x05valuexr\x00\x10java.lang.Number\x86\xac\x95\x1d\x0b\x94\xe0\x8b\x02\x00\x00xp\x00\x00\a\b" "creationTime" "\xac\xed\x00\x05sr\x00\x0ejava.lang.Long;\x8b\xe4\x90\xcc\x8f#\xdf\x02\x00\x01J\x00\x05valuexr\x00\x10java.lang.Number\x86\xac\x95\x1d\x0b\x94\xe0\x8b\x02\x00\x00xp\x00\x00\x01g\x99\x9d\x19\x9d"
  1544470469.042203 [0 127.0.0.1:55991] "SADD" "spring:session:expirations:1544472300000" "\xac\xed\x00\x05t\x00,expires:934a7e2b-5c28-4c04-8361-57811d153b3e"
  1544470469.042970 [0 127.0.0.1:55991] "PEXPIRE" "spring:session:expirations:1544472300000" "2100000"
  1544470469.045250 [0 127.0.0.1:55991] "APPEND" "spring:session:sessions:expires:934a7e2b-5c28-4c04-8361-57811d153b3e" ""
  1544470469.045519 [0 127.0.0.1:55991] "PEXPIRE" "spring:session:sessions:expires:934a7e2b-5c28-4c04-8361-57811d153b3e" "1800000"
  1544470469.045861 [0 127.0.0.1:55991] "PEXPIRE" "spring:session:sessions:934a7e2b-5c28-4c04-8361-57811d153b3e" "2100000"
  1544470469.048981 [0 127.0.0.1:55991] "PUBLISH" "spring:session:event:created:934a7e2b-5c28-4c04-8361-57811d153b3e" "\xac\xed\x00\x05sr\x00\x11java.util.HashMap\x05\a\xda\xc1\xc3\x16`\xd1\x03\x00\x02F\x00\nloadFactorI\x00\tthresholdxp?@\x00\x00\x00\x00\x00\x04w\b\x00\x00\x00\x04\x00\x00\x00\x00x"
  1544470489.886247 [0 127.0.0.1:55991] "PING"
  1544470500.005288 [0 127.0.0.1:55991] "SMEMBERS" "spring:session:expirations:1544470500000"
  1544470500.006675 [0 127.0.0.1:55991] "DEL" "spring:session:expirations:1544470500000"
  1544470519.885170 [0 127.0.0.1:55991] "PING"
  </code></pre>
  
  <p>pom.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
      &lt;groupId&gt;com.foo&lt;/groupId&gt;
      &lt;artifactId&gt;foo&lt;/artifactId&gt;
      &lt;version&gt;v1&lt;/version&gt;
  
      &lt;dependencyManagement&gt;
          &lt;dependencies&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;io.spring.platform&lt;/groupId&gt;
                  &lt;artifactId&gt;platform-bom&lt;/artifactId&gt;
                  &lt;version&gt;Athens-SR2&lt;/version&gt;
                  &lt;type&gt;pom&lt;/type&gt;
                  &lt;scope&gt;import&lt;/scope&gt;
              &lt;/dependency&gt; 
  
              &lt;dependency&gt;
                  &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
                  &lt;artifactId&gt;spring-boot-dependencies&lt;/artifactId&gt;
                  &lt;version&gt;1.5.9.RELEASE&lt;/version&gt;
                  &lt;type&gt;pom&lt;/type&gt;
                  &lt;scope&gt;import&lt;/scope&gt;
              &lt;/dependency&gt;
          &lt;/dependencies&gt;
      &lt;/dependencyManagement&gt;
  
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.session&lt;/groupId&gt;
              &lt;artifactId&gt;spring-session&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-redis&lt;/artifactId&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
                  &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
                  &lt;version&gt;1.5.9.RELEASE&lt;/version&gt;
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;repackage&lt;/goal&gt;
                          &lt;/goals&gt;
                      &lt;/execution&gt;
                  &lt;/executions&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>src/main/java/com/foo/APP.java</p>
  
  <pre><code>package com.foo;
  
  import org.springframework.boot.SpringApplication;
  import org.springframework.boot.autoconfigure.SpringBootApplication;
  
  @SpringBootApplication
  public class APP {
       public static void main(String[] args) throws Exception {
            SpringApplication.run(APP.class, args);
        }
  }
  </code></pre>
  
  <p>src/main/java/com/foo/helloredis/Example.java</p>
  
  <pre><code>package com.foo.helloredis;
  
  import javax.servlet.http.HttpServletRequest;
  import org.springframework.web.bind.annotation.*;
  
  @RestController
  public class Example {
  
    @RequestMapping("/set")
    String set(HttpServletRequest req) {
      req.getSession().setAttribute("testKey", "testValue");
      return "foo session:testKey=testValue";
    }
  
    @RequestMapping("/query")
    String query(HttpServletRequest req) {
      Object value = req.getSession().getAttribute("testKey");
      return "foo Session：\"testKey\"=" + value;
    }
  }
  </code></pre>
  
  <p>src/main/java/com/foo/helloredis/HttpSessionConfig.java</p>
  
  <pre><code>package comn.foo.helloredis;
  
  import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;
  
  @EnableRedisHttpSession
  public class HttpSessionConfig {
  
  }
  </code></pre>
  
  <p>However, when I run this app inside of docker I can't connect to redis, here's the error:</p>
  
  <pre><code>docker build -t foo .
  
  docker run --rm -it foo
  
    .   ____          _            __ _ _
   /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
  ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
   \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
    '  |____| .__|_| |_|_| |_\__, | / / / /
   =========|_|==============|___/=/_/_/_/
   :: Spring Boot ::        (v1.4.3.RELEASE)
  
  2018-12-10 19:39:16.039  INFO 1 --- [           main] com.foo.APP                              : Starting APP on 547b52504434 with PID 1 (/var/foo/helloredis/foo-v1.jar started by root in /var/foo/helloredis)
  2018-12-10 19:39:16.046  INFO 1 --- [           main] com.foo.APP                              : No active profile set, falling back to default profiles: default
  2018-12-10 19:39:16.146  INFO 1 --- [           main] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@7c1ba98b: startup date [Mon Dec 10 19:39:16 GMT 2018]; root of context hierarchy
  2018-12-10 19:39:18.062  INFO 1 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode!
  2018-12-10 19:39:19.351  INFO 1 --- [           main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat initialized with port(s): 8080 (http)
  2018-12-10 19:39:19.372  INFO 1 --- [           main] o.apache.catalina.core.StandardService   : Starting service Tomcat
  2018-12-10 19:39:19.373  INFO 1 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet Engine: Apache Tomcat/8.5.6
  2018-12-10 19:39:19.512  INFO 1 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
  2018-12-10 19:39:19.512  INFO 1 --- [ost-startStop-1] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 3370 ms
  2018-12-10 19:39:19.767  WARN 1 --- [ost-startStop-1] o.s.b.a.s.RedisSessionConfiguration      : Spring Session store type is mandatory: set 'spring.session.store-type=redis' in your configuration
  2018-12-10 19:39:20.015  INFO 1 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean  : Mapping servlet: 'dispatcherServlet' to [/]
  2018-12-10 19:39:20.020  INFO 1 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'characterEncodingFilter' to: [/*]
  2018-12-10 19:39:20.021  INFO 1 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'springSessionRepositoryFilter' to: [/*]
  2018-12-10 19:39:20.021  INFO 1 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
  2018-12-10 19:39:20.021  INFO 1 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'httpPutFormContentFilter' to: [/*]
  2018-12-10 19:39:20.022  INFO 1 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'requestContextFilter' to: [/*]
  2018-12-10 19:39:20.749  INFO 1 --- [           main] s.w.s.m.m.a.RequestMappingHandlerAdapter : Looking for @ControllerAdvice: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@7c1ba98b: startup date [Mon Dec 10 19:39:16 GMT 2018]; root of context hierarchy
  2018-12-10 19:39:20.879  INFO 1 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/set]}" onto java.lang.String com.foo.helloredis.Example.set(javax.servlet.http.HttpServletRequest)
  2018-12-10 19:39:20.881  INFO 1 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/query]}" onto java.lang.String com.foo.helloredis.Example.query(javax.servlet.http.HttpServletRequest)
  2018-12-10 19:39:20.884  INFO 1 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
  2018-12-10 19:39:20.884  INFO 1 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity&lt;java.util.Map&lt;java.lang.String, java.lang.Object&gt;&gt; org.springframework.boot.autoconfigure.web.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
  2018-12-10 19:39:20.944  INFO 1 --- [           main] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
  2018-12-10 19:39:20.944  INFO 1 --- [           main] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
  2018-12-10 19:39:21.014  INFO 1 --- [           main] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
  2018-12-10 19:39:21.364  WARN 1 --- [           main] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'enableRedisKeyspaceNotificationsInitializer' defined in class path resource [org/springframework/boot/autoconfigure/session/RedisSessionConfiguration$SpringBootRedisHttpSessionConfiguration.class]: Invocation of init method failed; nested exception is org.springframework.data.redis.RedisConnectionFailureException: Cannot get Jedis connection; nested exception is redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool
  2018-12-10 19:39:21.365  INFO 1 --- [           main] o.s.j.e.a.AnnotationMBeanExporter        : Unregistering JMX-exposed beans on shutdown
  2018-12-10 19:39:21.370  INFO 1 --- [           main] o.apache.catalina.core.StandardService   : Stopping service Tomcat
  2018-12-10 19:39:21.396  INFO 1 --- [           main] utoConfigurationReportLoggingInitializer : 
  
  Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
  2018-12-10 19:39:21.408 ERROR 1 --- [           main] o.s.boot.SpringApplication               : Application startup failed
  
  org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'enableRedisKeyspaceNotificationsInitializer' defined in class path resource [org/springframework/boot/autoconfigure/session/RedisSessionConfiguration$SpringBootRedisHttpSessionConfiguration.class]: Invocation of init method failed; nested exception is org.springframework.data.redis.RedisConnectionFailureException: Cannot get Jedis connection; nested exception is redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1589) ~[spring-beans-4.3.5.RELEASE.jar!/:4.3.5.RELEASE]
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:554) ~[spring-beans-4.3.5.RELEASE.jar!/:4.3.5.RELEASE]
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483) ~[spring-beans-4.3.5.RELEASE.jar!/:4.3.5.RELEASE]
      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) ~[spring-beans-4.3.5.RELEASE.jar!/:4.3.5.RELEASE]
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.3.5.RELEASE.jar!/:4.3.5.RELEASE]
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) ~[spring-beans-4.3.5.RELEASE.jar!/:4.3.5.RELEASE]
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) ~[spring-beans-4.3.5.RELEASE.jar!/:4.3.5.RELEASE]
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:759) ~[spring-beans-4.3.5.RELEASE.jar!/:4.3.5.RELEASE]
      at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:866) ~[spring-context-4.3.5.RELEASE.jar!/:4.3.5.RELEASE]
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:542) ~[spring-context-4.3.5.RELEASE.jar!/:4.3.5.RELEASE]
      at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) ~[spring-boot-1.4.3.RELEASE.jar!/:1.4.3.RELEASE]
      at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:761) [spring-boot-1.4.3.RELEASE.jar!/:1.4.3.RELEASE]
      at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:371) [spring-boot-1.4.3.RELEASE.jar!/:1.4.3.RELEASE]
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) [spring-boot-1.4.3.RELEASE.jar!/:1.4.3.RELEASE]
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:1186) [spring-boot-1.4.3.RELEASE.jar!/:1.4.3.RELEASE]
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:1175) [spring-boot-1.4.3.RELEASE.jar!/:1.4.3.RELEASE]
      at com.foo.APP.main(APP.java:9) [classes!/:na]
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_79]
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[na:1.7.0_79]
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_79]
      at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_79]
      at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48) [foo-v1.jar:na]
      at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) [foo-v1.jar:na]
      at org.springframework.boot.loader.Launcher.launch(Launcher.java:50) [foo-v1.jar:na]
      at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51) [foo-v1.jar:na]
  Caused by: org.springframework.data.redis.RedisConnectionFailureException: Cannot get Jedis connection; nested exception is redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool
      at org.springframework.data.redis.connection.jedis.JedisConnectionFactory.fetchJedisConnector(JedisConnectionFactory.java:198) ~[spring-data-redis-1.7.6.RELEASE.jar!/:na]
      at org.springframework.data.redis.connection.jedis.JedisConnectionFactory.getConnection(JedisConnectionFactory.java:345) ~[spring-data-redis-1.7.6.RELEASE.jar!/:na]
      at org.springframework.session.data.redis.config.annotation.web.http.RedisHttpSessionConfiguration$EnableRedisKeyspaceNotificationsInitializer.afterPropertiesSet(RedisHttpSessionConfiguration.java:223) ~[spring-session-1.2.2.RELEASE.jar!/:na]
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1648) ~[spring-beans-4.3.5.RELEASE.jar!/:4.3.5.RELEASE]
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1585) ~[spring-beans-4.3.5.RELEASE.jar!/:4.3.5.RELEASE]
      ... 24 common frames omitted
  Caused by: redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool
      at redis.clients.util.Pool.getResource(Pool.java:53) ~[jedis-2.8.2.jar!/:na]
      at redis.clients.jedis.JedisPool.getResource(JedisPool.java:99) ~[jedis-2.8.2.jar!/:na]
      at redis.clients.jedis.JedisPool.getResource(JedisPool.java:12) ~[jedis-2.8.2.jar!/:na]
      at org.springframework.data.redis.connection.jedis.JedisConnectionFactory.fetchJedisConnector(JedisConnectionFactory.java:191) ~[spring-data-redis-1.7.6.RELEASE.jar!/:na]
      ... 28 common frames omitted
  Caused by: redis.clients.jedis.exceptions.JedisConnectionException: java.net.ConnectException: Connection refused
      at redis.clients.jedis.Connection.connect(Connection.java:164) ~[jedis-2.8.2.jar!/:na]
      at redis.clients.jedis.BinaryClient.connect(BinaryClient.java:80) ~[jedis-2.8.2.jar!/:na]
      at redis.clients.jedis.BinaryJedis.connect(BinaryJedis.java:1677) ~[jedis-2.8.2.jar!/:na]
      at redis.clients.jedis.JedisFactory.makeObject(JedisFactory.java:87) ~[jedis-2.8.2.jar!/:na]
      at org.apache.commons.pool2.impl.GenericObjectPool.create(GenericObjectPool.java:868) ~[commons-pool2-2.4.2.jar!/:2.4.2]
      at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:435) ~[commons-pool2-2.4.2.jar!/:2.4.2]
      at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:363) ~[commons-pool2-2.4.2.jar!/:2.4.2]
      at redis.clients.util.Pool.getResource(Pool.java:49) ~[jedis-2.8.2.jar!/:na]
      ... 31 common frames omitted
  Caused by: java.net.ConnectException: Connection refused
      at java.net.PlainSocketImpl.socketConnect(Native Method) ~[na:1.7.0_79]
      at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339) ~[na:1.7.0_79]
      at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200) ~[na:1.7.0_79]
      at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182) ~[na:1.7.0_79]
      at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) ~[na:1.7.0_79]
      at java.net.Socket.connect(Socket.java:579) ~[na:1.7.0_79]
      at redis.clients.jedis.Connection.connect(Connection.java:158) ~[jedis-2.8.2.jar!/:na]
      ... 38 common frames omitted
  </code></pre>
  
  <p>Thank you for any clues!</p>