Spring-cloud-sleuth: RabbitAnnotationDrivenConfiguration NullPointerException

Created on 3 Dec 2018  路  6Comments  路  Source: spring-cloud/spring-cloud-sleuth

....
<spring-cloud.version>Greenwich.M3</spring-cloud.version>
....

<dependency>
  <groupId>org.springframework.cloud</groupId>
  <artifactId>spring-cloud-starter-zipkin</artifactId>
</dependency>

<dependency>
  <groupId>org.springframework.amqp</groupId>
  <artifactId>spring-rabbit</artifactId>
</dependency>

When you run it up

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'rabbitListenerContainerFactory' defined in class path resource [org/springframework/boot/autoconfigure/amqp/RabbitAnnotationDrivenConfiguration.class]: Initialization of bean failed; nested exception is java.lang.NullPointerException
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:584) ~[spring-beans-5.1.3.RELEASE.jar:5.1.3.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:498) ~[spring-beans-5.1.3.RELEASE.jar:5.1.3.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) ~[spring-beans-5.1.3.RELEASE.jar:5.1.3.RELEASE]
    at org

Most helpful comment

It'll be fixed in 2.1.3 release of Spring AMQP

Spring JIRA issue
https://github.com/spring-projects/spring-amqp/pull/860

As a temporary and ugly fix, you can enable retry properties, which will create an adviceChain:
spring.rabbitmq.listener.direct.retry.enabled=true
spring.rabbitmq.listener.simple.retry.enabled=true

All 6 comments

same issue with
spring boot 2.1.1.RELEASE
spring cloud Finchley.SR2

@abccbaandy , you need change your dependancies version

https://start.spring.io/actuator/info

"spring-cloud":{
"Edgware.SR5":"Spring Boot >=1.5.0.RELEASE and <=1.5.18.RELEASE",
"Edgware.BUILD-SNAPSHOT":"Spring Boot >=1.5.19.BUILD-SNAPSHOT and <2.0.0.M1",
"Finchley.M2":"Spring Boot >=2.0.0.M3 and <2.0.0.M5",
"Finchley.M3":"Spring Boot >=2.0.0.M5 and <=2.0.0.M5",
"Finchley.M4":"Spring Boot >=2.0.0.M6 and <=2.0.0.M6",
"Finchley.M5":"Spring Boot >=2.0.0.M7 and <=2.0.0.M7",
"Finchley.M6":"Spring Boot >=2.0.0.RC1 and <=2.0.0.RC1",
"Finchley.M7":"Spring Boot >=2.0.0.RC2 and <=2.0.0.RC2",
"Finchley.M9":"Spring Boot >=2.0.0.RELEASE and <=2.0.0.RELEASE",
"Finchley.RC1":"Spring Boot >=2.0.1.RELEASE and <2.0.2.RELEASE",
"Finchley.RC2":"Spring Boot >=2.0.2.RELEASE and <2.0.3.RELEASE",
"Finchley.SR2":"Spring Boot >=2.0.3.RELEASE and <2.0.8.BUILD-SNAPSHOT",
"Finchley.BUILD-SNAPSHOT":"Spring Boot >=2.0.8.BUILD-SNAPSHOT and <2.1.0.M3",
"Greenwich.M1":"Spring Boot >=2.1.0.M3 and <2.1.0.RELEASE",
"Greenwich.M3":"Spring Boot >=2.1.0.RELEASE and <2.1.2.BUILD-SNAPSHOT",
"Greenwich.BUILD-SNAPSHOT":"Spring Boot >=2.1.2.BUILD-SNAPSHOT"
}

same issue with
spring boot 2.1.1.RELEASE
spring cloud Greenwich.M3
spring cloud stream + spring-cloud-stream-binder-rabbit

For now, I have down any versions but any bug is still to correct in the new versions.

spring boot 2.0.7.RELEASE
spring cloud Finchley.SR2

It'll be fixed in 2.1.3 release of Spring AMQP

Spring JIRA issue
https://github.com/spring-projects/spring-amqp/pull/860

As a temporary and ugly fix, you can enable retry properties, which will create an adviceChain:
spring.rabbitmq.listener.direct.retry.enabled=true
spring.rabbitmq.listener.simple.retry.enabled=true

Was this page helpful?
0 / 5 - 0 ratings