2017-02-10 3 views
0

Der Versuch, Kafka für Publish zu integrieren, abonnieren Sie die Implementierung mit Spring Cloud Stream.
Build ist erfolgreich, beim Start konnte es die erforderliche Klasse nicht finden. Kannst du helfen, was bei der folgenden Konfiguration fehlt? Außerdem wurde die Stapelverfolgung mit einem Fehler versehen.Spring Cloud Stream - Kafka Binder Integration/Konfiguration

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) 

Antwort

0

Haben Sie META-INF/spring.binders: spring.cloud.stream.binders.kafka.defaultCandidate=true Ihre eigene spring.binders Datei mit dem Inhalt zur Verfügung stellen?

Wenn ja, sollten Sie das entfernen.

+0

Vielen Dank, Marius. Es löste das Problem. –

+0

Können Sie bitte kurz, die Ursache des Fehlers, es ist für die benutzerdefinierte Binder-Implementierung suchen? –

+0

Ja, die Datei weist darauf hin, dass eine benutzerdefinierte Binderimplementierung vorhanden ist, die die Konfiguration unterbricht. –

Verwandte Themen