redis - Spring XD分布式模式redis模板问题

标签 redis spring-xd spring-data-redis

当我在 spring xd 分布式模式下使用 xd-shell 的命令行开始执行时

:bin#xd-shell

 **Getting following STACKTRACE Error:**
 2015-06-07 10:41:37,443 1.1.0.RELEASE  WARN main annotation.AnnotationConfigApplicationContext - Exception encountered during context initialization - cancelling refresh attempt
    org.springframework.beans.factory.UnsatisfiedDependencyException: **Error creating bean with name 'redisTemplate' defined in class path resource** [org/springframework/boot/autoconfigure/redis/RedisAutoConfiguration$RedisConfiguration.class]: Unsatisfied dependency expressed through constructor argument with index 0 of type** [org.springframework.data.redis.connection.RedisConnectionFactory]: : **Error creating bean with name 'redisConnectionFactory' defined in class path resource** [org/springframework/boot/autoconfigure/redis/RedisAutoConfiguration$RedisPooledConnectionConfiguration.class]: Invocation of init method failed; nested exception is java.lang.NullPointerException; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'redisConnectionFactory' defined in class path resource [org/springframework/boot/autoconfigure/redis/RedisAutoConfiguration$RedisPooledConnectionConfiguration.class]

更多错误日志在这里

----Invocation of init method failed; nested exception is java.lang.NullPointerException
                            at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:749)
                            at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:464)
                            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1111)
                            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1006)
                            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504)
                            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
                            at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
                            at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
                            at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
                            at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
                            at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:762)
                            at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757)
                            at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
                            at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:691)
                            at org.springframework.boot.SpringApplication.run(SpringApplication.java:321)
                            at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:139)
                            at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:129)
                            at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:129)
                            at org.springframework.xd.dirt.server.AdminServerApplication.run(AdminServerApplication.java:89)----

后续错误日志

----Error creating bean with name 'redisConnectionFactory' defined in class path resource 
                    Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'redisConnectionFactory' defined in class path resource [org/springframework/boot/autoconfigure/redis/RedisAutoConfiguration$RedisPooledConnectionConfiguration.class]: Invocation of init method failed; nested exception is java.lang.NullPointerException
                            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1566)
                            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
                            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
                            at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
                            at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
                            at

org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)----

如有任何帮助,我们将不胜感激。

最佳答案

看起来像是环境/配置问题。您是否在您的环境中为 redis(或 redis 池配置)设置了任何特定属性?

关于redis - Spring XD分布式模式redis模板问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30719994/

相关文章:

java - JHipster 应用程序中的 Redis 集成

hadoop - 如何将数据从静态网站导入HDFS?

java - ConnectException:连接被拒绝(连接被拒绝)-通过Jedis连接到Redis时

RedisSystemException : java. lang.ClassCastException : [B cannot be cast to java. lang.Long

Redis 获取多个 LIST 键的第一个元素

node.js - 如何使用 Node.js 在 Redis 中的 Sorted Set 的子键上设置过期

django - Docker&Celery - 错误 : Pidfile (celerybeat. pid) 已经存在

java - 用于处理器输入的 Spring XD 自定义类类型

spring-xd - 处理完文件中的所有行后删除文件

java - 无法在 Redis 模板中加载连接工厂并且无法找到 spring config xml