2017-02-10 100 views
0

嘗試與Kafka集成發佈,使用Spring雲流訂閱實現。
構建成功, 啓動時無法找到所需的類。你能幫忙,下面的配置中缺少了什麼。還提供了堆棧跟蹤錯誤。春雲流 - 卡夫卡活頁夾集成/配置

pom.xml 
========= 
<dependency> 
      <groupId>org.springframework.cloud</groupId> 
      <artifactId>spring-cloud-stream-binder-kafka</artifactId> 
     </dependency> 

Jar contents 
============ 
There are no multiple binders. 
- META-INF/spring.binders: spring.cloud.stream.binders.kafka.defaultCandidate=true 
- Kafka binaries included 

spring-cloud-starter-stream-kafka-1.1.0.RELEASE.jar 
spring-kafka-1.0.4.RELEASE.jar 
spring-integration-kafka-2.0.1.RELEASE.jar 
kafka_2.11-0.9.0.1.jar 
spring-cloud-stream-binder-kafka-1.1.0.RELEASE.jar 
kafka-clients-0.9.0.1.jar 

Error Stack 
======== 


    Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'binderTypeRegistry' defined in class path resource [org/springframework/cloud/stream/config/BinderFactoryConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.cloud.stream.binder.BinderTypeRegistry]: Factory method 'binderTypeRegistry' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Cannot create binder factory:; nested exception is java.lang.ClassNotFoundException: false 
    at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:599) 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1134) 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1028) 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513) 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483) 
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) 
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) 
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) 
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) 
    at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:207) 
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1136) 
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1064) 

回答

0

你提供自己的spring.binders文件與內容META-INF/spring.binders: spring.cloud.stream.binders.kafka.defaultCandidate=true

如果是的話,你應該刪除它。

+0

非常感謝你,馬呂斯。它解決了這個問題。 –

+0

您能否簡要介紹一下錯誤原因,它是在尋找自定義綁定器的實現? –

+0

是的,該文件暗示有一個自定義聯編程序實現,並打破配置。 –