简体   繁体   English

在数据流服务器中运行时出现spring cloud task taskLifecycleListener错误

[英]spring cloud task taskLifecycleListener error when running in dataflow server

I implemented the sample batch-job sample given in spring cloud task samples.我实现了 spring 云任务示例中给出的示例批处理作业示例。 The spring boot version used in that is 2.0.1.RELEASE.其中使用的 spring 引导版本是 2.0.1.RELEASE。 Since I have to port another job I have to spring cloud task I wanted to find the oldest version compatible.由于我必须移植另一份工作,因此我必须执行 spring 云任务,我想找到兼容的最旧版本。 The jar for batch-job created with 1.3.2.RELEASE as the spring-boot version runs successfully.使用 1.3.2.RELEASE 作为 spring-boot 版本创建的批处理作业 jar 成功运行。 But when I run it from the UI of the spring cloud dataflow after adding it as an app I get the following error:但是当我在将它添加为应用程序后从 spring 云数据流的 UI 运行它时,我收到以下错误:

2018-09-18 11:51:02.755  WARN 12368 --- [           main] s.c.a.AnnotationConfigApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Failed to start bean 'taskLifecycleListener'; nested exception is java.lang.IllegalArgumentException: Invalid TaskExecution, ID 1 not found
2018-09-18 11:51:02.759  INFO 12368 --- [           main] o.s.j.e.a.AnnotationMBeanExporter        : Unregistering JMX-exposed beans on shutdown
2018-09-18 11:51:02.763 ERROR 12368 --- [           main] o.s.c.t.listener.TaskLifecycleListener   : An event to end a task has been received for a task that has not yet started.
2018-09-18 11:51:02.767  INFO 12368 --- [           main] o.s.j.d.e.EmbeddedDatabaseFactory        : Shutting down embedded database: url='jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=false'
2018-09-18 11:51:02.781 ERROR 12368 --- [           main] o.s.boot.SpringApplication               : Application startup failed

org.springframework.context.ApplicationContextException: Failed to start bean 'taskLifecycleListener'; nested exception is java.lang.IllegalArgumentException: Invalid TaskExecution, ID 1 not found
    at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:176) ~[spring-context-4.2.4.RELEASE.jar!/:4.2.4.RELEASE]
    at org.springframework.context.support.DefaultLifecycleProcessor.access$200(DefaultLifecycleProcessor.java:51) ~[spring-context-4.2.4.RELEASE.jar!/:4.2.4.RELEASE]
    at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:346) ~[spring-context-4.2.4.RELEASE.jar!/:4.2.4.RELEASE]
    at org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:149) ~[spring-context-4.2.4.RELEASE.jar!/:4.2.4.RELEASE]
    at org.springframework.context.support.DefaultLifecycleProcessor.onRefresh(DefaultLifecycleProcessor.java:112) ~[spring-context-4.2.4.RELEASE.jar!/:4.2.4.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:852) ~[spring-context-4.2.4.RELEASE.jar!/:4.2.4.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:541) ~[spring-context-4.2.4.RELEASE.jar!/:4.2.4.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 io.spring.BatchJobApplication.main(BatchJobApplication.java:14) [batch-job-2.0.1.BUILD-SNAPSHOT.jar!/:2.0.1.BUILD-SNAPSHOT]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_181]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_181]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_181]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_181]
    at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:54) [batch-job-2.0.1.BUILD-SNAPSHOT.jar!/:2.0.1.BUILD-SNAPSHOT]
    at java.lang.Thread.run(Thread.java:748) [na:1.8.0_181]
Caused by: java.lang.IllegalArgumentException: Invalid TaskExecution, ID 1 not found
    at org.springframework.util.Assert.notNull(Assert.java:115) ~[spring-core-4.2.4.RELEASE.jar!/:4.2.4.RELEASE]
    at org.springframework.cloud.task.listener.TaskLifecycleListener.doTaskStart(TaskLifecycleListener.java:233) ~[spring-cloud-task-core-2.0.1.BUILD-SNAPSHOT.jar!/:2.0.1.BUILD-SNAPSHOT]
    at org.springframework.cloud.task.listener.TaskLifecycleListener.start(TaskLifecycleListener.java:355) ~[spring-cloud-task-core-2.0.1.BUILD-SNAPSHOT.jar!/:2.0.1.BUILD-SNAPSHOT]
    at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:173) ~[spring-context-4.2.4.RELEASE.jar!/:4.2.4.RELEASE]
    ... 18 common frames omitted

Its mostly of Task not get registered in a given database.它的主要任务是没有在给定的数据库中注册。 So When I got this Invalid TaskexecutionID issue, I passed database credentials to Dataflow server and same [DB details ] passed while launching a task.因此,当我遇到此 Invalid TaskexecutionID 问题时,我将数据库凭据传递给 Dataflow 服务器,并在启动任务时传递了相同的 [DB details]。 Generally both them should be in sink with DB credentials.通常他们都应该在接收器中使用数据库凭据。 finally all the TASK executions were recorded with TaskID, Execution Start time , Executio Endtime etc in that supplied DB.最后,所有 TASK 执行都记录在所提供的数据库中的 TaskID、执行开始时间、执行结束时间等。

task launch taskTimestmp2 --arguments "--spring.datasource.url=jdbc:mysql://localhost:3306/mydb --spring.datasource.username=root --spring.datasource.driver-class-name=org.mariadb.jdbc.Driver"任务启动 taskTimestmp2 --arguments "--spring.datasource.url=jdbc:mysql://localhost:3306/mydb --spring.datasource.username=root --spring.datasource.driver-class-name=org.mariadb .jdbc.Driver”

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Spring Cloud Dataflow 无法启动 bean 'taskLifecycleListener'; 嵌套异常是 java.lang.IllegalArgumentException: Invalid TaskExecution - Spring cloud Dataflow Failed to start bean 'taskLifecycleListener'; nested exception is java.lang.IllegalArgumentException: Invalid TaskExecution 组成的任务运行器在Spring Cloud Dataflow Kubernetes服务器中失败 - Composed task runner failing in spring cloud dataflow kubernetes server Spring Cloud Dataflow Local Using dockerized Task - Spring Cloud Dataflow Local Using dockerized Task Spring Cloud 数据流服务器自定义构建 2.6.1 - Spring cloud dataflow server Custom Build 2.6.1 Spring Cloud DataFlow多次运行组合任务 - Spring Cloud DataFlow run Composed Task multiple times Spring Cloud DataFlow组成的任务无法启动 - Spring Cloud DataFlow Composed Task doesn't start Spring Cloud Dataflow Local Server是否需要连接Zookeeper? - Does Spring Cloud Dataflow Local Server need to connect zookeeper? 自定义实体不会在Spring Cloud Dataflow Server中加载 - Custom entities do not load within a Spring Cloud Dataflow Server 在 kubernetes 平台上的 spring-cloud-dataflow 中创建调度程序时出现 NullPointerException - NullPointerException when creating scheduler in spring-cloud-dataflow on kubernetes platform 升级到Spring Cloud Dataflow任务的Spring Boot 2.0后无法反序列化执行上下文 - Unable to deserialize the execution context after upgrading to spring boot 2.0 for a spring cloud dataflow task
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM