当我尝试在春季云数据流服务器中部署流时,出现org.springframework.beans.factory.BeanCreationException:

时间:2018-09-29 13:06:16

标签: spring spring-boot

我有一个示例代码源,处理器和接收器应用程序,如下所示,它们仅获取日期并处理日期,并将其提供给输出,我想对其进行部署并在控制台中查看日志,但是我无法做..有人可以帮我吗?

    Source:
     @EnableBinding(Source.class)
    @SpringBootApplication
    public class SourceApplication {

        @Bean
        @InboundChannelAdapter(value = Source.OUTPUT, poller = @Poller(fixedDelay = "10000", maxMessagesPerPoll = "1"))
        public MessageSource<Long> timeMessageSource() {

            return () -> MessageBuilder.withPayload(new Date().getTime()).build();
        }

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

和处理器:

    @EnableBinding(Processor.class)
    @SpringBootApplication
    public class ProcessorApplication {

        @Transformer(inputChannel = Processor.INPUT, outputChannel = Processor.OUTPUT)
        public Object transform(Long date) {

            DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
            return dateFormat.format(date);
        }

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

水槽:

    @EnableBinding(Sink.class)
    @SpringBootApplication
    public class SinkApplication {

        private static Logger logger = LoggerFactory.getLogger(SinkApplication.class);

        @StreamListener(Sink.INPUT)
        public void loggerSink(String date) {

            logger.info("Received: " + date);
        }

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

当我尝试部署时收到以下错误消息

  com.example.source.SourceApp             : Starting SourceApp v0.0.1-SNAPSHOT on HYD01-IkshwakLT with PID 13440 (C:\Users\ikshwak.vallala\.m2\repository\com\example\source\0.0.1-SNAPSHOT\source-0.0.1-SNAPSHOT.jar started by ikshwak.vallala in C:\Users\IKSHWA~1.VAL\AppData\Local\Temp\spring-cloud-deployer-8172224760963124756\data-1538225083194\data.source-app)
2018-09-29 18:14:52.553  INFO 13440 --- [           main] com.example.source.SourceApp             : No active profile set, falling back to default profiles: default
2018-09-29 18:14:52.857  INFO 13440 --- [           main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@7cef4e59: startup date [Sat Sep 29 18:14:52 IST 2018]; root of context hierarchy
2018-09-29 18:14:55.979  INFO 13440 --- [           main] o.s.i.config.IntegrationRegistrar        : No bean named 'integrationHeaderChannelRegistry' has been explicitly defined. Therefore, a default DefaultHeaderChannelRegistry will be created.
2018-09-29 18:14:57.797  INFO 13440 --- [           main] faultConfiguringBeanFactoryPostProcessor : No bean named 'errorChannel' has been explicitly defined. Therefore, a default PublishSubscribeChannel will be created.
2018-09-29 18:14:57.801  INFO 13440 --- [           main] faultConfiguringBeanFactoryPostProcessor : No bean named 'taskScheduler' has been explicitly defined. Therefore, a default ThreadPoolTaskScheduler will be created.
2018-09-29 18:14:58.196  INFO 13440 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.amqp.rabbit.annotation.RabbitBootstrapConfiguration' of type [org.springframework.amqp.rabbit.annotation.RabbitBootstrapConfiguration$$EnhancerBySpringCGLIB$$1fc458ff] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2018-09-29 18:14:58.928  INFO 13440 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.integration.config.IntegrationManagementConfiguration' of type [org.springframework.integration.config.IntegrationManagementConfiguration$$EnhancerBySpringCGLIB$$c44a5600] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2018-09-29 18:15:00.454  WARN 13440 --- [           main] s.c.a.AnnotationConfigApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sourceApp': Initialization of bean failed; nested exception is java.lang.NumberFormatException: For input string: "true"
2018-09-29 18:15:00.487  INFO 13440 --- [           main] ConditionEvaluationReportLoggingListener : 

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2018-09-29 18:15:00.498 ERROR 13440 --- [           main] o.s.boot.SpringApplication               : Application run failed

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sourceApp': Initialization of bean failed; nested exception is java.lang.NumberFormatException: For input string: "true"
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:581) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:495) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:317) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:315) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:759) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:869) ~[spring-context-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550) ~[spring-context-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:780) [spring-boot-2.0.5.RELEASE.jar!/:2.0.5.RELEASE]
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:412) [spring-boot-2.0.5.RELEASE.jar!/:2.0.5.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:333) [spring-boot-2.0.5.RELEASE.jar!/:2.0.5.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1277) [spring-boot-2.0.5.RELEASE.jar!/:2.0.5.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1265) [spring-boot-2.0.5.RELEASE.jar!/:2.0.5.RELEASE]
    at com.example.source.SourceApp.main(SourceApp.java:24) [classes!/:0.0.1-SNAPSHOT]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_171]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_171]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_171]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_171]
    at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48) [source-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT]
    at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) [source-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT]
    at org.springframework.boot.loader.Launcher.launch(Launcher.java:50) [source-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT]
    at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51) [source-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT]
Caused by: java.lang.NumberFormatException: For input string: "true"
    at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) ~[na:1.8.0_171]
    at java.lang.Long.parseLong(Long.java:589) ~[na:1.8.0_171]
    at java.lang.Long.parseLong(Long.java:631) ~[na:1.8.0_171]
    at org.springframework.integration.config.annotation.AbstractMethodAnnotationPostProcessor.configurePollingEndpoint(AbstractMethodAnnotationPostProcessor.java:359) ~[spring-integration-core-5.0.8.RELEASE.jar!/:5.0.8.RELEASE]
    at org.springframework.integration.config.annotation.InboundChannelAdapterAnnotationPostProcessor.postProcess(InboundChannelAdapterAnnotationPostProcessor.java:80) ~[spring-integration-core-5.0.8.RELEASE.jar!/:5.0.8.RELEASE]
    at org.springframework.integration.config.annotation.MessagingAnnotationPostProcessor.processAnnotationTypeOnMethod(MessagingAnnotationPostProcessor.java:185) ~[spring-integration-core-5.0.8.RELEASE.jar!/:5.0.8.RELEASE]
    at org.springframework.integration.config.annotation.MessagingAnnotationPostProcessor.lambda$postProcessAfterInitialization$0(MessagingAnnotationPostProcessor.java:158) ~[spring-integration-core-5.0.8.RELEASE.jar!/:5.0.8.RELEASE]
    at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:562) ~[spring-core-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
    at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:569) ~[spring-core-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
    at org.springframework.integration.config.annotation.MessagingAnnotationPostProcessor.postProcessAfterInitialization(MessagingAnnotationPostProcessor.java:139) ~[spring-integration-core-5.0.8.RELEASE.jar!/:5.0.8.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:431) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1703) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:573) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
    ... 22 common frames omitted

我正在本地运行kafka服务器和spring cloud数据流服务器并尝试部署该流,但是由于控制台中的上述日志而导致流失败。有人可以帮助我吗,或者任何人都可以为我提供任何参考.. < / p>

0 个答案:

没有答案