Spring boot 未能实例化[org.springframework.cloud.stream.binding.BindingService]:工厂方法';bindingService';抛出异常

Spring boot 未能实例化[org.springframework.cloud.stream.binding.BindingService]:工厂方法';bindingService';抛出异常,spring-boot,apache-kafka-streams,spring-cloud-stream,Spring Boot,Apache Kafka Streams,Spring Cloud Stream,我正在尝试使用SpringCloudStream和ApacheKafka作为流绑定器来开发事件驱动的体系结构 Spring启动版本:2.1.9版本 Spring云版本:2.2.1版本 我尝试了与Greenwich.SR3云版本相同的配置,但出现了相同的错误 pom.xml 当作为Spring Boot应用程序运行应用程序时,在控制台上出现以下错误 2019-11-07 08:37:58.780 INFO 513 --- [ main] com.adi.ProducerKaf

我正在尝试使用SpringCloudStream和ApacheKafka作为流绑定器来开发事件驱动的体系结构

Spring启动版本:2.1.9版本 Spring云版本:2.2.1版本

我尝试了与Greenwich.SR3云版本相同的配置,但出现了相同的错误

pom.xml 当作为Spring Boot应用程序运行应用程序时,在控制台上出现以下错误

2019-11-07 08:37:58.780  INFO 513 --- [           main] com.adi.ProducerKafkaApplication         : No active profile set, falling back to default profiles: default
2019-11-07 08:38:01.121  INFO 513 --- [           main] o.s.c.a.ConfigurationClassEnhancer       : @Bean method BinderFactoryConfiguration.implicitFunctionBinder is non-static and returns an object assignable to Spring's BeanFactoryPostProcessor interface. This will result in a failure to process annotations such as @Autowired, @Resource and @PostConstruct within the method's declaring @Configuration class. Add the 'static' modifier to this method to avoid these container lifecycle issues; see @Bean javadoc for complete details.
2019-11-07 08:38:01.193  INFO 513 --- [           main] faultConfiguringBeanFactoryPostProcessor : No bean named 'errorChannel' has been explicitly defined. Therefore, a default PublishSubscribeChannel will be created.
2019-11-07 08:38:01.216  INFO 513 --- [           main] faultConfiguringBeanFactoryPostProcessor : No bean named 'taskScheduler' has been explicitly defined. Therefore, a default ThreadPoolTaskScheduler will be created.
2019-11-07 08:38:01.224  INFO 513 --- [           main] faultConfiguringBeanFactoryPostProcessor : No bean named 'integrationHeaderChannelRegistry' has been explicitly defined. Therefore, a default DefaultHeaderChannelRegistry will be created.
2019-11-07 08:38:01.270  INFO 513 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.kafka.annotation.KafkaBootstrapConfiguration' of type [org.springframework.kafka.annotation.KafkaBootstrapConfiguration$$EnhancerBySpringCGLIB$$a9058eff] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-11-07 08:38:01.318  INFO 513 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'integrationDisposableAutoCreatedBeans' of type [org.springframework.integration.config.annotation.Disposables] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-11-07 08:38:01.338  INFO 513 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.integration.config.IntegrationManagementConfiguration' of type [org.springframework.integration.config.IntegrationManagementConfiguration$$EnhancerBySpringCGLIB$$404538ab] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-11-07 08:38:01.352  INFO 513 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.boot.autoconfigure.integration.IntegrationAutoConfiguration$IntegrationJmxConfiguration' of type [org.springframework.boot.autoconfigure.integration.IntegrationAutoConfiguration$IntegrationJmxConfiguration$$EnhancerBySpringCGLIB$$1bd743cb] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-11-07 08:38:01.365  INFO 513 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.boot.autoconfigure.jmx.JmxAutoConfiguration' of type [org.springframework.boot.autoconfigure.jmx.JmxAutoConfiguration$$EnhancerBySpringCGLIB$$54beec98] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-11-07 08:38:01.370  INFO 513 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'mbeanServer' of type [com.sun.jmx.mbeanserver.JmxMBeanServer] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-11-07 08:38:01.970  INFO 513 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8080 (http)
2019-11-07 08:38:02.020  INFO 513 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2019-11-07 08:38:02.021  INFO 513 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.26]
2019-11-07 08:38:02.264  INFO 513 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2019-11-07 08:38:02.265  INFO 513 --- [           main] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 3328 ms
2019-11-07 08:38:03.122  INFO 513 --- [           main] o.s.s.concurrent.ThreadPoolTaskExecutor  : Initializing ExecutorService 'applicationTaskExecutor'
2019-11-07 08:38:03.808  INFO 513 --- [           main] o.s.s.c.ThreadPoolTaskScheduler          : Initializing ExecutorService 'taskScheduler'
2019-11-07 08:38:03.815  WARN 513 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'bindingService' defined in class path resource [org/springframework/cloud/stream/config/BindingServiceConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.cloud.stream.binding.BindingService]: Factory method 'bindingService' threw exception; nested exception is java.lang.NoClassDefFoundError: javax/validation/Validator
2019-11-07 08:38:03.815  INFO 513 --- [           main] o.s.s.c.ThreadPoolTaskScheduler          : Shutting down ExecutorService 'taskScheduler'
2019-11-07 08:38:03.818  INFO 513 --- [           main] o.s.s.concurrent.ThreadPoolTaskExecutor  : Shutting down ExecutorService 'applicationTaskExecutor'
2019-11-07 08:38:03.821  INFO 513 --- [           main] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
2019-11-07 08:38:03.835  INFO 513 --- [           main] ConditionEvaluationReportLoggingListener : 

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2019-11-07 08:38:03.902 ERROR 513 --- [           main] o.s.boot.SpringApplication               : Application run failed

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'bindingService' defined in class path resource [org/springframework/cloud/stream/config/BindingServiceConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.cloud.stream.binding.BindingService]: Factory method 'bindingService' threw exception; nested exception is java.lang.NoClassDefFoundError: javax/validation/Validator
    at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:627) ~[spring-beans-5.1.10.RELEASE.jar:5.1.10.RELEASE]
    at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:607) ~[spring-beans-5.1.10.RELEASE.jar:5.1.10.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1321) ~[spring-beans-5.1.10.RELEASE.jar:5.1.10.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1160) ~[spring-beans-5.1.10.RELEASE.jar:5.1.10.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555) ~[spring-beans-5.1.10.RELEASE.jar:5.1.10.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515) ~[spring-beans-5.1.10.RELEASE.jar:5.1.10.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) ~[spring-beans-5.1.10.RELEASE.jar:5.1.10.RELEASE]
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.1.10.RELEASE.jar:5.1.10.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) ~[spring-beans-5.1.10.RELEASE.jar:5.1.10.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.1.10.RELEASE.jar:5.1.10.RELEASE]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:847) ~[spring-beans-5.1.10.RELEASE.jar:5.1.10.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:877) ~[spring-context-5.1.10.RELEASE.jar:5.1.10.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549) ~[spring-context-5.1.10.RELEASE.jar:5.1.10.RELEASE]
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141) ~[spring-boot-2.1.9.RELEASE.jar:2.1.9.RELEASE]
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:744) [spring-boot-2.1.9.RELEASE.jar:2.1.9.RELEASE]
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:391) [spring-boot-2.1.9.RELEASE.jar:2.1.9.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:312) [spring-boot-2.1.9.RELEASE.jar:2.1.9.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215) [spring-boot-2.1.9.RELEASE.jar:2.1.9.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1204) [spring-boot-2.1.9.RELEASE.jar:2.1.9.RELEASE]
    at com.adi.ProducerKafkaApplication.main(ProducerKafkaApplication.java:15) [classes/:na]
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.cloud.stream.binding.BindingService]: Factory method 'bindingService' threw exception; nested exception is java.lang.NoClassDefFoundError: javax/validation/Validator
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185) ~[spring-beans-5.1.10.RELEASE.jar:5.1.10.RELEASE]
    at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:622) ~[spring-beans-5.1.10.RELEASE.jar:5.1.10.RELEASE]
    ... 19 common frames omitted
Caused by: java.lang.NoClassDefFoundError: javax/validation/Validator
    at java.lang.ClassLoader.defineClass1(Native Method) ~[na:1.8.0_161]
    at java.lang.ClassLoader.defineClass(ClassLoader.java:763) ~[na:1.8.0_161]
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) ~[na:1.8.0_161]
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:467) ~[na:1.8.0_161]
    at java.net.URLClassLoader.access$100(URLClassLoader.java:73) ~[na:1.8.0_161]
    at java.net.URLClassLoader$1.run(URLClassLoader.java:368) ~[na:1.8.0_161]
    at java.net.URLClassLoader$1.run(URLClassLoader.java:362) ~[na:1.8.0_161]
    at java.security.AccessController.doPrivileged(Native Method) ~[na:1.8.0_161]
    at java.net.URLClassLoader.findClass(URLClassLoader.java:361) ~[na:1.8.0_161]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_161]
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:338) ~[na:1.8.0_161]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_161]
    at org.springframework.cloud.stream.binding.BindingService.<init>(BindingService.java:86) ~[spring-cloud-stream-2.2.1.RELEASE.jar:2.2.1.RELEASE]
    at org.springframework.cloud.stream.config.BindingServiceConfiguration.bindingService(BindingServiceConfiguration.java:204) ~[spring-cloud-stream-2.2.1.RELEASE.jar:2.2.1.RELEASE]
    at org.springframework.cloud.stream.config.BindingServiceConfiguration$$EnhancerBySpringCGLIB$$fb550fc9.CGLIB$bindingService$1(<generated>) ~[spring-cloud-stream-2.2.1.RELEASE.jar:2.2.1.RELEASE]
    at org.springframework.cloud.stream.config.BindingServiceConfiguration$$EnhancerBySpringCGLIB$$fb550fc9$$FastClassBySpringCGLIB$$56848299.invoke(<generated>) ~[spring-cloud-stream-2.2.1.RELEASE.jar:2.2.1.RELEASE]
    at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244) ~[spring-core-5.1.10.RELEASE.jar:5.1.10.RELEASE]
    at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:363) ~[spring-context-5.1.10.RELEASE.jar:5.1.10.RELEASE]
    at org.springframework.cloud.stream.config.BindingServiceConfiguration$$EnhancerBySpringCGLIB$$fb550fc9.bindingService(<generated>) ~[spring-cloud-stream-2.2.1.RELEASE.jar:2.2.1.RELEASE]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_161]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_161]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_161]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_161]
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ~[spring-beans-5.1.10.RELEASE.jar:5.1.10.RELEASE]
    ... 20 common frames omitted
Caused by: java.lang.ClassNotFoundException: javax.validation.Validator
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[na:1.8.0_161]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_161]
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:338) ~[na:1.8.0_161]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_161]
    ... 44 common frames omitted

2019-11-07 08:37:58.780信息513---[main]com.adi.ProducerKafkaApplication:未设置活动配置文件,返回默认配置文件:默认
2019-11-07 08:38:01.121信息513---[main]o.s.c.a.ConfigurationClassEnhancer:@Bean方法BinderFactoryConfiguration.implicitFunctionBinder是非静态的,返回可分配给Spring的BeanFactoryPostProcessor接口的对象。这将导致无法在方法的声明@Configuration类中处理注释,例如@Autowired、@Resource和@PostConstruct。将“静态”修饰符添加到此方法以避免这些容器生命周期问题;有关完整的详细信息,请参见@Bean javadoc。
2019-11-07 08:38:01.193信息513---[main]故障配置BeanFactory后处理器:未明确定义名为“errorChannel”的bean。因此,将创建一个默认的PublishSubscribeChannel。
2019-11-07 08:38:01.216信息513---[main]故障配置BeanFactory后处理器:未明确定义名为“taskScheduler”的bean。因此,将创建默认的ThreadPoolTaskScheduler。
2019-11-07 08:38:01.224信息513-[main]故障配置BeanFactory后处理器:未明确定义名为“IntegrationHeaderChannel注册表”的bean。因此,将创建默认的DefaultHeaderChannel注册表。
2019-11-07 08:38:01.270信息513---[main]trationlegate$BeanPostProcessorChecker:Bean'org.springframework.kafka.annotation.KafkaBootstrapConfiguration'类型为[org.springframework.kafka.annotation.KafkaBootstrapConfiguration$$EnhancerBySpringCGLIB$$a9058eff]的Bean'org.springframework(例如:不符合自动代理的条件)
2019-11-07 08:38:01.318信息513---[main]trationlegate$BeanPostProcessorChecker:Bean类型为[org.springframework.integration.config.annotation.Disposables]的“integrationDisposableAutoCreatedBeans”不适合由所有BeanPostProcessor处理(例如:不适合自动代理)
2019-11-07 08:38:01.338信息513---[main]trationlegate$BeanPostProcessorChecker:Bean'org.springframework.integration.config.IntegrationManagementConfiguration'类型为[org.springframework.integration.config.IntegrationManagementConfiguration$$EnhancerBySpringCGLIB$$404538ab]不符合由所有BeanPostProcessor处理的条件(例如:不符合自动代理的条件)
2019-11-07 08:38:01.352信息513---[main]trationlegate$BeanPostProcessorChecker:Bean'org.springframework.boot.autoconfigure.integration.IntegrationAutoConfiguration$IntegrationJmxConfiguration'类型[org.springframework.boot.autoconfigure.integration.IntegrationAutoConfiguration$IntegrationJmxConfiguration$$EnhancerBySpringCGLIB$$1bd743cb]不符合由所有BeanPostProcessor处理的条件(例如:不符合自动代理的条件)
2019-11-07 08:38:01.365信息513---[main]trationlegate$BeanPostProcessorChecker:Bean'org.springframework.boot.autoconfigure.jmx.jmxautoconfigure.jmx.JmxAutoConfiguration$$EnhancerBySpringCGLIB$$54beec98]类型的Bean'org.springframework.boot.jmx.jmxautoconfigure'没有资格被所有BeanProcessor处理器处理(例如:不符合自动代理的条件)
2019-11-07 08:38:01.370信息513---[main]trationlegate$BeanPostProcessor检查:类型为[com.sun.jmx.mbeanServer.JmxMBeanServer]的Bean'mbeanServer'不符合由所有BeanPostProcessor处理的条件(例如:不符合自动代理的条件)
2019-11-07 08:38:01.970信息513---[main]o.s.b.w.embedded.tomcat.TomcatWebServer:tomcat已用端口初始化:8080(http)
2019-11-07 08:38:02.020信息513---[main]o.apache.catalina.core.StandardService:启动服务[Tomcat]
2019-11-07 08:38:02.021信息513---[main]org.apache.catalina.core.StandardEngine:启动Servlet引擎:[apache-Tomcat/9.0.26]
2019-11-07 08:38:02.264信息513---[main]o.a.c.c.[Tomcat].[localhost].[/]:初始化Spring嵌入式WebApplicationContext
2019-11-07 08:38:02.265信息513---[main]o.s.web.context.ContextLoader:根WebApplicationContext:初始化在3328毫秒内完成
2019-11-07 08:38:03.122信息513---[main]o.s.s.concurrent.ThreadPoolTaskExecutor:初始化ExecutorService'applicationTaskExecutor'
2019-11-07 08:38:03.808信息513---[main]o.s.s.c.ThreadPoolTaskScheduler:正在初始化ExecutorService“taskScheduler”
2019-11-07 08:38:03.815警告513---[main]ConfigServletWebServerApplicationContext:在上下文初始化过程中遇到异常-取消刷新尝试:org.springframework.beans.factory.BeanCreationException:创建在类路径资源中定义了名为“bindingService”的bean时出错[org/springframework/cloud/stream/config/BindingServiceConfiguration.class]:通过工厂方法实例化Bean失败;嵌套异常为org.springframework.beans.beanInstationException:实例化[org.springframework.cloud.stream.binding.BindingService]失败:工厂方法“bindingService”引发异常;嵌套异常为java.lang.NoClassDefFoundError:javax/validation/Validator
2019-11-07 08:38:03.815信息513---[main]o.s.s.c.ThreadPoolT

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.messaging.Source;

@SpringBootApplication
@EnableBinding(Source.class)
public class ProducerKafkaApplication {

    public static void main(String[] args) {
        SpringApplication.run(ProducerKafkaApplication.class, args);
    }

}

2019-11-07 08:37:58.780  INFO 513 --- [           main] com.adi.ProducerKafkaApplication         : No active profile set, falling back to default profiles: default
2019-11-07 08:38:01.121  INFO 513 --- [           main] o.s.c.a.ConfigurationClassEnhancer       : @Bean method BinderFactoryConfiguration.implicitFunctionBinder is non-static and returns an object assignable to Spring's BeanFactoryPostProcessor interface. This will result in a failure to process annotations such as @Autowired, @Resource and @PostConstruct within the method's declaring @Configuration class. Add the 'static' modifier to this method to avoid these container lifecycle issues; see @Bean javadoc for complete details.
2019-11-07 08:38:01.193  INFO 513 --- [           main] faultConfiguringBeanFactoryPostProcessor : No bean named 'errorChannel' has been explicitly defined. Therefore, a default PublishSubscribeChannel will be created.
2019-11-07 08:38:01.216  INFO 513 --- [           main] faultConfiguringBeanFactoryPostProcessor : No bean named 'taskScheduler' has been explicitly defined. Therefore, a default ThreadPoolTaskScheduler will be created.
2019-11-07 08:38:01.224  INFO 513 --- [           main] faultConfiguringBeanFactoryPostProcessor : No bean named 'integrationHeaderChannelRegistry' has been explicitly defined. Therefore, a default DefaultHeaderChannelRegistry will be created.
2019-11-07 08:38:01.270  INFO 513 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.kafka.annotation.KafkaBootstrapConfiguration' of type [org.springframework.kafka.annotation.KafkaBootstrapConfiguration$$EnhancerBySpringCGLIB$$a9058eff] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-11-07 08:38:01.318  INFO 513 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'integrationDisposableAutoCreatedBeans' of type [org.springframework.integration.config.annotation.Disposables] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-11-07 08:38:01.338  INFO 513 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.integration.config.IntegrationManagementConfiguration' of type [org.springframework.integration.config.IntegrationManagementConfiguration$$EnhancerBySpringCGLIB$$404538ab] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-11-07 08:38:01.352  INFO 513 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.boot.autoconfigure.integration.IntegrationAutoConfiguration$IntegrationJmxConfiguration' of type [org.springframework.boot.autoconfigure.integration.IntegrationAutoConfiguration$IntegrationJmxConfiguration$$EnhancerBySpringCGLIB$$1bd743cb] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-11-07 08:38:01.365  INFO 513 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.boot.autoconfigure.jmx.JmxAutoConfiguration' of type [org.springframework.boot.autoconfigure.jmx.JmxAutoConfiguration$$EnhancerBySpringCGLIB$$54beec98] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-11-07 08:38:01.370  INFO 513 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'mbeanServer' of type [com.sun.jmx.mbeanserver.JmxMBeanServer] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-11-07 08:38:01.970  INFO 513 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8080 (http)
2019-11-07 08:38:02.020  INFO 513 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2019-11-07 08:38:02.021  INFO 513 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.26]
2019-11-07 08:38:02.264  INFO 513 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2019-11-07 08:38:02.265  INFO 513 --- [           main] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 3328 ms
2019-11-07 08:38:03.122  INFO 513 --- [           main] o.s.s.concurrent.ThreadPoolTaskExecutor  : Initializing ExecutorService 'applicationTaskExecutor'
2019-11-07 08:38:03.808  INFO 513 --- [           main] o.s.s.c.ThreadPoolTaskScheduler          : Initializing ExecutorService 'taskScheduler'
2019-11-07 08:38:03.815  WARN 513 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'bindingService' defined in class path resource [org/springframework/cloud/stream/config/BindingServiceConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.cloud.stream.binding.BindingService]: Factory method 'bindingService' threw exception; nested exception is java.lang.NoClassDefFoundError: javax/validation/Validator
2019-11-07 08:38:03.815  INFO 513 --- [           main] o.s.s.c.ThreadPoolTaskScheduler          : Shutting down ExecutorService 'taskScheduler'
2019-11-07 08:38:03.818  INFO 513 --- [           main] o.s.s.concurrent.ThreadPoolTaskExecutor  : Shutting down ExecutorService 'applicationTaskExecutor'
2019-11-07 08:38:03.821  INFO 513 --- [           main] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
2019-11-07 08:38:03.835  INFO 513 --- [           main] ConditionEvaluationReportLoggingListener : 

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2019-11-07 08:38:03.902 ERROR 513 --- [           main] o.s.boot.SpringApplication               : Application run failed

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'bindingService' defined in class path resource [org/springframework/cloud/stream/config/BindingServiceConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.cloud.stream.binding.BindingService]: Factory method 'bindingService' threw exception; nested exception is java.lang.NoClassDefFoundError: javax/validation/Validator
    at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:627) ~[spring-beans-5.1.10.RELEASE.jar:5.1.10.RELEASE]
    at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:607) ~[spring-beans-5.1.10.RELEASE.jar:5.1.10.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1321) ~[spring-beans-5.1.10.RELEASE.jar:5.1.10.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1160) ~[spring-beans-5.1.10.RELEASE.jar:5.1.10.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555) ~[spring-beans-5.1.10.RELEASE.jar:5.1.10.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515) ~[spring-beans-5.1.10.RELEASE.jar:5.1.10.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) ~[spring-beans-5.1.10.RELEASE.jar:5.1.10.RELEASE]
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.1.10.RELEASE.jar:5.1.10.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) ~[spring-beans-5.1.10.RELEASE.jar:5.1.10.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.1.10.RELEASE.jar:5.1.10.RELEASE]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:847) ~[spring-beans-5.1.10.RELEASE.jar:5.1.10.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:877) ~[spring-context-5.1.10.RELEASE.jar:5.1.10.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549) ~[spring-context-5.1.10.RELEASE.jar:5.1.10.RELEASE]
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141) ~[spring-boot-2.1.9.RELEASE.jar:2.1.9.RELEASE]
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:744) [spring-boot-2.1.9.RELEASE.jar:2.1.9.RELEASE]
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:391) [spring-boot-2.1.9.RELEASE.jar:2.1.9.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:312) [spring-boot-2.1.9.RELEASE.jar:2.1.9.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215) [spring-boot-2.1.9.RELEASE.jar:2.1.9.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1204) [spring-boot-2.1.9.RELEASE.jar:2.1.9.RELEASE]
    at com.adi.ProducerKafkaApplication.main(ProducerKafkaApplication.java:15) [classes/:na]
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.cloud.stream.binding.BindingService]: Factory method 'bindingService' threw exception; nested exception is java.lang.NoClassDefFoundError: javax/validation/Validator
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185) ~[spring-beans-5.1.10.RELEASE.jar:5.1.10.RELEASE]
    at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:622) ~[spring-beans-5.1.10.RELEASE.jar:5.1.10.RELEASE]
    ... 19 common frames omitted
Caused by: java.lang.NoClassDefFoundError: javax/validation/Validator
    at java.lang.ClassLoader.defineClass1(Native Method) ~[na:1.8.0_161]
    at java.lang.ClassLoader.defineClass(ClassLoader.java:763) ~[na:1.8.0_161]
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) ~[na:1.8.0_161]
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:467) ~[na:1.8.0_161]
    at java.net.URLClassLoader.access$100(URLClassLoader.java:73) ~[na:1.8.0_161]
    at java.net.URLClassLoader$1.run(URLClassLoader.java:368) ~[na:1.8.0_161]
    at java.net.URLClassLoader$1.run(URLClassLoader.java:362) ~[na:1.8.0_161]
    at java.security.AccessController.doPrivileged(Native Method) ~[na:1.8.0_161]
    at java.net.URLClassLoader.findClass(URLClassLoader.java:361) ~[na:1.8.0_161]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_161]
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:338) ~[na:1.8.0_161]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_161]
    at org.springframework.cloud.stream.binding.BindingService.<init>(BindingService.java:86) ~[spring-cloud-stream-2.2.1.RELEASE.jar:2.2.1.RELEASE]
    at org.springframework.cloud.stream.config.BindingServiceConfiguration.bindingService(BindingServiceConfiguration.java:204) ~[spring-cloud-stream-2.2.1.RELEASE.jar:2.2.1.RELEASE]
    at org.springframework.cloud.stream.config.BindingServiceConfiguration$$EnhancerBySpringCGLIB$$fb550fc9.CGLIB$bindingService$1(<generated>) ~[spring-cloud-stream-2.2.1.RELEASE.jar:2.2.1.RELEASE]
    at org.springframework.cloud.stream.config.BindingServiceConfiguration$$EnhancerBySpringCGLIB$$fb550fc9$$FastClassBySpringCGLIB$$56848299.invoke(<generated>) ~[spring-cloud-stream-2.2.1.RELEASE.jar:2.2.1.RELEASE]
    at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244) ~[spring-core-5.1.10.RELEASE.jar:5.1.10.RELEASE]
    at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:363) ~[spring-context-5.1.10.RELEASE.jar:5.1.10.RELEASE]
    at org.springframework.cloud.stream.config.BindingServiceConfiguration$$EnhancerBySpringCGLIB$$fb550fc9.bindingService(<generated>) ~[spring-cloud-stream-2.2.1.RELEASE.jar:2.2.1.RELEASE]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_161]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_161]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_161]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_161]
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ~[spring-beans-5.1.10.RELEASE.jar:5.1.10.RELEASE]
    ... 20 common frames omitted
Caused by: java.lang.ClassNotFoundException: javax.validation.Validator
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[na:1.8.0_161]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_161]
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:338) ~[na:1.8.0_161]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_161]
    ... 44 common frames omitted

<dependency>
    <groupId>javax.validation</groupId>
    <artifactId>validation-api</artifactId>
    <version>2.0.0.Final</version>
</dependency>
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-validation</artifactId>
    <version>${spring-cloud-stream.version}</version>
</dependency>
<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-stream-rabbit</artifactId>
    <version>3.0.5.RELEASE</version>
</dependency>