spring-cloud / spring-cloud-task

Short lived microservices with Spring Batch
https://cloud.spring.io/spring-cloud-task/
Apache License 2.0
424 stars 306 forks source link

org.springframework.context.ApplicationContextException: Failed to start bean 'taskLifecycleListener'; nested exception is java.lang.IllegalArgumentException: Invalid TaskExecution, ID 3 not found #662

Closed Srkanna closed 4 years ago

Srkanna commented 4 years ago

Hi, I'm trying to run a Spring batch jar through SCDF. I ue two datasources one for reading and one for writing and both are Oracle. The dataSource I used to write is primary datasource in Spring batch project. Coming to SCDF I use a Custom Build version to include oracle driver dependencies. Below is the custom SCDF project location. https://github.com/spring-cloud/spring-cloud-dataflow-samples/tree/master/custom-dataflow-builds/dataflow-server-22x I my local Spring batch project I implemented DefaultTaskConfigurer to provide my primary datasource. So when I run the Batch project from IDE with the project runs fine, Reads records from secondary datasource and writes into primary datasource. But when I deploy the batch jar to custom build SCDF as task and launch it, I get an error that says, org.springframework.context.ApplicationContextException: Failed to start bean 'taskLifecycleListener'; nested exception is java.lang.IllegalArgumentException: Invalid TaskExecution, ID 3 not found When I checked the task Execution table (which can be accessed via primary datasource), the task execution ID is there in the table. But still I get this error. For each each run a new task Id is inserted int Task_execution table but I get the above error message with newly inserted task_execution id. Below are the project specifics:

mminella commented 4 years ago

I'm going to close this since it is a question instead of an issue. Please post a question in StackOverflow and tag it with spring-cloud-task and we can answer it there.

Srkanna commented 4 years ago

Hi Michael, Thanks for the notification. As suggested I have posted this on StackOverflow. It's been 2 weeks since. But I yet to get any response. This issue is a show stopper here. I have given the StackOverflow link below. Any help would be appreciable.

https://stackoverflow.com/questions/61409422/how-to-solve-the-execption-java-lang-illegalargumentexception-invalid-taskexec

My guess it's not working is because of the two datasources used in the same application. Though I have proided the default datasource through DefaultTaskConfigurer Implementation.

Thanks, Rajeshkannan.S

On Thu, Apr 23, 2020 at 7:44 PM Michael Minella notifications@github.com wrote:

Closed #662 https://github.com/spring-cloud/spring-cloud-task/issues/662 .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/spring-cloud/spring-cloud-task/issues/662#event-3265187157, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHC2LJDKIUPHVPG3W22STQTROBEL7ANCNFSM4MO2KVZQ .