5

Tôi đang cố gắng triển khai Turbine AMQP để hợp nhất tất cả luồng từ nhiều dịch vụ với Bảng điều khiển Hystrix.luồng đám mây mùa xuân 'bindingService' lỗi

Vì vậy, tôi đã thêm vài phụ thuộc vào tệp gradle và sau đó tôi không thể khởi động ứng dụng của mình vì một số lý do.

LOGS từ khi khởi động, nơi tôi thấy ngoại lệ.

[LogMessage=Application startup failed] 
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'bindingService' defined in class path resource [org/springframework/cloud/stream/config/ChannelBindingServiceConfiguration.class]: Unsatisfied dependency expressed through constructor argument with index 1 of type [org.springframework.cloud.stream.binder.BinderFactory]: Error creating bean with name 'binderFactory' defined in class path resource [org/springframework/cloud/stream/config/BinderFactoryConfiguration.class]: Unsatisfied dependency expressed through constructor argument with index 0 of type [org.springframework.cloud.stream.binder.BinderTypeRegistry]: 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, no `META-INF/spring.binders` resources found on the classpath; nested exception is 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, no `META-INF/spring.binders` resources found on the classpath; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'binderFactory' defined in class path resource [org/springframework/cloud/stream/config/BinderFactoryConfiguration.class]: Unsatisfied dependency expressed through constructor argument with index 0 of type [org.springframework.cloud.stream.binder.BinderTypeRegistry]: 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, no `META-INF/spring.binders` resources found on the classpath; nested exception is 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, no `META-INF/spring.binders` resources found on the classpath 
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:749) ~[spring-beans-4.2.5.RELEASE.jar:4.2.5.RELEASE] 
    at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:464) ~[spring-beans-4.2.5.RELEASE.jar:4.2.5.RELEASE] 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1123) ~[spring-beans-4.2.5.RELEASE.jar:4.2.5.RELEASE] 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1018) ~[spring-beans-4.2.5.RELEASE.jar:4.2.5.RELEASE] 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510) ~[spring-beans-4.2.5.RELEASE.jar:4.2.5.RELEASE] 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482) ~[spring-beans-4.2.5.RELEASE.jar:4.2.5.RELEASE] 
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) ~[spring-beans-4.2.5.RELEASE.jar:4.2.5.RELEASE] 
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.2.5.RELEASE.jar:4.2.5.RELEASE] 
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) ~[spring-beans-4.2.5.RELEASE.jar:4.2.5.RELEASE] 
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) ~[spring-beans-4.2.5.RELEASE.jar:4.2.5.RELEASE] 
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:772) ~[spring-beans-4.2.5.RELEASE.jar:4.2.5.RELEASE] 
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:839) ~[spring-context-4.2.5.RELEASE.jar:4.2.5.RELEASE] 
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:538) ~[spring-context-4.2.5.RELEASE.jar:4.2.5.RELEASE] 
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118) ~[spring-boot-1.3.2.RELEASE.jar:1.3.2.RELEASE] 
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:766) [spring-boot-1.3.2.RELEASE.jar:1.3.2.RELEASE] 
    at org.springframework.boot.SpringApplication.createAndRefreshContext(SpringApplication.java:361) [spring-boot-1.3.2.RELEASE.jar:1.3.2.RELEASE] 
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:307) [spring-boot-1.3.2.RELEASE.jar:1.3.2.RELEASE] 
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1191) [spring-boot-1.3.2.RELEASE.jar:1.3.2.RELEASE] 
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1180) [spring-boot-1.3.2.RELEASE.jar:1.3.2.RELEASE] 
    at com.bbtransact.icp.api.associations.boot.UserApplication.main(UserApplication.java:20) [bin/:na] 

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, no `META-INF/spring.binders` resources found on the classpath 
    at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:599) ~[spring-beans-4.2.5.RELEASE.jar:4.2.5.RELEASE] 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1123) ~[spring-beans-4.2.5.RELEASE.jar:4.2.5.RELEASE] 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1018) ~[spring-beans-4.2.5.RELEASE.jar:4.2.5.RELEASE] 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510) ~[spring-beans-4.2.5.RELEASE.jar:4.2.5.RELEASE] 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482) ~[spring-beans-4.2.5.RELEASE.jar:4.2.5.RELEASE] 
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) ~[spring-beans-4.2.5.RELEASE.jar:4.2.5.RELEASE] 
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.2.5.RELEASE.jar:4.2.5.RELEASE] 
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) ~[spring-beans-4.2.5.RELEASE.jar:4.2.5.RELEASE] 
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) ~[spring-beans-4.2.5.RELEASE.jar:4.2.5.RELEASE] 
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1192) ~[spring-beans-4.2.5.RELEASE.jar:4.2.5.RELEASE] 
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1116) ~[spring-beans-4.2.5.RELEASE.jar:4.2.5.RELEASE] 
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1014) ~[spring-beans-4.2.5.RELEASE.jar:4.2.5.RELEASE] 
    at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:813) ~[spring-beans-4.2.5.RELEASE.jar:4.2.5.RELEASE] 
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:741) ~[spring-beans-4.2.5.RELEASE.jar:4.2.5.RELEASE] 
    ... 33 common frames omitted 
Caused by: 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, no `META-INF/spring.binders` resources found on the classpath 
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189) ~[spring-beans-4.2.5.RELEASE.jar:4.2.5.RELEASE] 
    at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588) ~[spring-beans-4.2.5.RELEASE.jar:4.2.5.RELEASE] 
    ... 46 common frames omitted 
Caused by: org.springframework.beans.factory.BeanCreationException: Cannot create binder factory, no `META-INF/spring.binders` resources found on the classpath 
    at org.springframework.cloud.stream.config.BinderFactoryConfiguration.binderTypeRegistry(BinderFactoryConfiguration.java:100) ~[spring-cloud-stream-1.0.0.RC1.jar:1.0.0.RC1] 
    at org.springframework.cloud.stream.config.BinderFactoryConfiguration$$EnhancerBySpringCGLIB$$b9b6d96.CGLIB$binderTypeRegistry$1(<generated>) ~[spring-cloud-stream-1.0.0.RC1.jar:1.0.0.RC1] 
    at org.springframework.cloud.stream.config.BinderFactoryConfiguration$$EnhancerBySpringCGLIB$$b9b6d96$$FastClassBySpringCGLIB$$d1bb81f1.invoke(<generated>) ~[spring-cloud-stream-1.0.0.RC1.jar:1.0.0.RC1] 
    at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) ~[spring-core-4.2.4.RELEASE.jar:4.2.4.RELEASE] 
    at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:355) ~[spring-context-4.2.5.RELEASE.jar:4.2.5.RELEASE] 
    at org.springframework.cloud.stream.config.BinderFactoryConfiguration$$EnhancerBySpringCGLIB$$b9b6d96.binderTypeRegistry(<generated>) ~[spring-cloud-stream-1.0.0.RC1.jar:1.0.0.RC1] 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_66] 
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_66] 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_66] 
    at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.8.0_66] 
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162) ~[spring-beans-4.2.5.RELEASE.jar:4.2.5.RELEASE] 

Đây là .Gradle Tôi đã thêm phụ thuộc cho hystrix, hystrix-ampqp, starter-bus-amqp.

buildscript { 

    ext { 
     springBootVersion = '1.3.0.RELEASE' 
    } 

    repositories { 
     maven { 
      url "https://plugins.gradle.org/m2/" 
     } 
     mavenLocal() 
     mavenCentral() 
} 

    dependencies { 
     classpath ("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") 
     classpath ("io.spring.gradle:dependency-management-plugin:0.5.2.RELEASE") 
     classpath ("mysql:mysql-connector-java:5.1.34") 
     classpath ("org.sonarqube.gradle:gradle-sonarqube-plugin:1.1") 
    } 
} 

repositories { 
     maven { 
      url "https://plugins.gradle.org/m2/" 
      url "https://repo.spring.io/snapshot" 
      url "https://repo.spring.io/milestone" 
     } 
     mavenLocal() 
     mavenCentral() 
} 


apply plugin: 'java' 
apply plugin: 'eclipse-wtp' 
apply plugin: 'idea' 
apply plugin: 'spring-boot' 
apply plugin: 'io.spring.dependency-management' 
apply plugin: 'org.sonarqube' 
apply plugin: "jacoco" 
apply plugin: "sonar-runner" 


group = 'com.api' 

def build_version=project.properties['build_version'] ?: "SNAPSHOT" 
version = "${build_version}" 

ext.packaging = 'jar' 

jar { 
    baseName = "userassociations-v1" 
} 


sourceCompatibility = 1.8 
targetCompatibility = 1.8 

sourceSets { 
    generated { 
     java { 
      srcDirs = ['src/main/generated'] 
     } 
    } 
} 


configurations { 
    providedRuntime 
    querydslapt 
} 

jacoco { 

    reportsDir = file("build/tmp/jacoco.exec") 
} 

test{ 
    ignoreFailures = true  
} 

sonarqube { 
    properties { 
    property "sonar.projectName", "User-associations-V1" 
    property "sonar.projectKey", "org.sonarqube:User-associations-V1" 
    property "sonar.sourceEncoding", "UTF-8" 
    property "sonar.host.url", "${sonar_host}" 
    property "sonar.login", "${sonar_username}" 
    property "sonar.password", "${sonar_password}" 
    property "sonar.jacoco.reportPath", "build/jacoco/test.exec" 
    property "sonar.java.source property", "1.8" 

    } 
} 

dependencyManagement { 
    imports { 
     mavenBom "org.springframework.cloud:spring-cloud-starter-parent:Brixton.RC1" 
    } 
} 

dependencies { 
    compile   ("org.springframework.boot:spring-boot-starter-actuator") 
    compile   ("org.springframework.cloud:spring-cloud-starter-eureka") 
    compile   ("org.springframework.cloud:spring-cloud-config-client") 
    compile("org.springframework.cloud:spring-cloud-starter-hystrix:1.0.6.RELEASE") 
    compile("org.springframework.cloud:spring-cloud-starter-bus-amqp:1.0.6.RELEASE") 
    compile("org.springframework.cloud:spring-cloud-netflix-hystrix-amqp:1.0.6.RELEASE") 
    compile   ("org.codehaus.sonar-plugins.java:sonar-jacoco-plugin:2.3") 
    compile   ("org.springframework.boot:spring-boot-starter-web") 
    compile   ("org.codehaus.jackson:jackson-mapper-asl:1.9.2") 
    compile   ("mysql:mysql-connector-java:5.1.34") 
    compile   ("org.springframework:spring-webmvc:4.2.2.RELEASE") 
    compile   ("org.springframework.boot:spring-boot-starter-data-jpa") 
    providedRuntime ("org.springframework.boot:spring-boot-starter-tomcat") 
    testCompile  ("org.springframework.boot:spring-boot-starter-test") 
    querydslapt  ("org.hibernate:hibernate-jpamodelgen:5.0.5.Final") 
    compile 'org.springframework.cloud:spring-cloud-starter-sleuth:1.0.0.M1' 
    compile 'org.springframework.cloud:spring-cloud-sleuth-core:1.0.0.M1' 
} 


eclipse { 
    classpath { 
     containers.remove('org.eclipse.jdt.launching.JRE_CONTAINER') 
     containers ('org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8') 
    } 
} 

task generateQueryDSL(type: JavaCompile, group: 'build', description: 'Generates the QueryDSL query types') { 
    source = sourceSets.main.java 
    classpath = configurations.compile + configurations.querydslapt 
    options.compilerArgs = [ 
      "-proc:only" 
    ] 
    destinationDir = sourceSets.generated.java.srcDirs.iterator().next() 
} 

compileJava { 
    dependsOn generateQueryDSL 
    source generateQueryDSL.destinationDir 
} 

compileGeneratedJava { 
    dependsOn generateQueryDSL 
    options.warnings = false 
    classpath += sourceSets.main.runtimeClasspath 
} 

clean { 
    delete sourceSets.generated.java.srcDirs 
} 

task wrapper(type: Wrapper) { 
    gradleVersion = '2.9' 
} 

Bất kỳ trợ giúp nào được đánh giá cao tôi đã gặp phải trong thời gian này.

+0

Were bạn có thể giải quyết vấn đề này? Tôi có cùng thông báo lỗi. Những gì tôi cố gắng làm là có bảng tổng hợp Hystrix và tập hợp luồng Turbine trong một ứng dụng – dementiev

+0

Tôi đã làm nhưng tôi đã có một số vấn đề với các bản ghi họ nói cố định của nó bây giờ nhưng tôi đã không thử nó một lần nữa. chúng tôi kết thúc không sử dụng tuabin ... kiểm tra này ra http://stackoverflow.com/questions/37014311/too-many-logs-getting-generated-for-hystrix-amqp nó là một điều phụ thuộc mà tôi nghĩ rằng vẫn còn sai lầm trên tôi .... cho tôi biết nếu bạn cần tôi dán phụ thuộc đầy đủ của tôi. –

Trả lời

3

Kiểm tra xem bạn có phụ thuộc vào gói dữ liệu thỏ mùa xuân Cloud Stream trong đường dẫn lớp của bạn hay không. Các chất kết dính có trách nhiệm ràng buộc các kênh mùa xuân-đám mây-dòng để môi giới thư của bạn.

Đối với thỏ: org.springframework.cloud:spring-cloud-stream-binder-rabbit:version

+0

Tôi đã không có sự phụ thuộc vì vậy tôi đã thêm nó và vẫn còn ngoại lệ tương tự khi khởi động .... nhưng khi tôi loại bỏ phụ thuộc amqp tất cả các công trình tốt. –

8

Thêm phần này vào pom của bạn dưới phụ thuộc,

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

này là dành cho RabbitMQ binder

Các vấn đề liên quan