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

时间:2015-06-08 22:14:57

标签: redis spring-xd spring-data-redis

当我在spring xd distributed mode中使用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)----

非常感谢任何帮助。

1 个答案:

答案 0 :(得分:0)

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