当前位置: 首页 > 知识库问答 >
问题:

spring cloud流“绑定服务”错误

阎志义
2023-03-14

我正在尝试实现涡轮AMQP,以合并从多个服务到Hystrix仪表板的所有流。

[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]
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'
}

共有1个答案

松嘉颖
2023-03-14

将此添加到pom的“依赖项”下,

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

这是RabbitMQ活页夹

 类似资料:
  • 本文向大家介绍SpringCloud-Alibaba-Sentinel服务降级,热点限流,服务熔断,包括了SpringCloud-Alibaba-Sentinel服务降级,热点限流,服务熔断的使用技巧和注意事项,需要的朋友参考一下 前言: 除了流量控制以外,对调用链路中不稳定的资源进行熔断降级也是保障高可用的重要措施之一。一个服务常常会调用别的模块,可能是另外的一个远程服务、数据库,或者第三方 A

  • 我目前正在使用KubernetesPodoperator在库伯内特斯集群上运行Pod。我收到以下错误: 库伯内特斯。客户RestApiException:(403)原因:禁止 HTTP响应标头:HTTPHeaderDict({'Auding-Id': '', 'Cache-Control':'no-cache, Private','Content-Type':'Application/json',

  • [eclipse-jetty]无法在端口9,091上启动jetty服务器:无法分配请求的地址 我正在使用jetty HTTP服务器发布REST Web服务。 配置: 服务器-ip : 20.121.21.22 端口: 8081 对于上述配置,它抛出以下异常。 org.apache.cxf.service.factory.ServiceConstructionException 原因:org . A

  • 我正在尝试为SpringCloudAzure服务总线队列流绑定器配置错误通道,但未成功。我已通过启用错误通道 并尝试定义一个: 我还尝试了和。显然,我在这里遗漏了一些东西,但我找不到一个有效的例子。 编辑:我正在使用以下供应商bean: 根据绑定命名约定,绑定的名称将为。我可以看到消息确实发送到了(另一侧有一个消费者)。 编辑和解决方案: 看来我的环境出了问题,重建后一切都如期进行,正如Garry

  • 本文向大家介绍Android 定义服务流程,包括了Android 定义服务流程的使用技巧和注意事项,需要的朋友参考一下 示例 该android:process字段定义了要在其中运行服务的进程的名称。通常,应用程序的所有组件都在为该应用程序创建的默认进程中运行。但是,组件可以使用其自己的进程属性覆盖默认值,从而使您可以将应用程序分布在多个进程中。 如果分配给该属性的名称以冒号(':')开头,则该服务

  • 本文向大家介绍SpringCloud使用Feign实现服务调用,包括了SpringCloud使用Feign实现服务调用的使用技巧和注意事项,需要的朋友参考一下 Spring Cloud Feign简介 Spring Cloud Feign也是一个基础工具类,它整合了Spring Cloud Ribbon和Spring Cloud Hystrix,除了提供这两者的强大功能以外,它还提供了一种声明式的