Giter VIP home page Giter VIP logo

Comments (13)

sabbyanandan avatar sabbyanandan commented on August 29, 2024

It is unclear what you're trying to do and the versions you're using. Without any information, it is hard to troubleshoot. Please share what you can from this list.

from spring-cloud-dataflow-samples.

cppwfs avatar cppwfs commented on August 29, 2024

Hello @ evasanthan. As a follow up note I see that you are using the H2 database. In this case you will need to make sure your dataflow is configured properly as discussed here: http://docs.spring.io/spring-cloud-dataflow-server-cloudfoundry/docs/1.2.1.RELEASE/reference/htmlsingle/#getting-started. The DataFlow server and tasks need to connect to the database service (as discussed in the link provided).

from spring-cloud-dataflow-samples.

evasanthan avatar evasanthan commented on August 29, 2024

@sabbyanandan

Spring Cloud Data Flow:

Spring-cloud-dataflow-server-cloudfoundry-1.2.0.BUILD-SNAPSHOT

Release version
Spring Cloud Data Flow: Spring-cloud-dataflow-shell-1.2.0.RELEASE

Release version
Pivotal Web service ( latest Trial account)

https://github.com/spring-cloud/spring-cloud-dataflow-samples/tree/master/tasks/simple-batch-job

Problem Description

I am just running the sample application which had shared in the same github code which is named as batch-job
https://github.com/spring-cloud/spring-cloud-dataflow-samples/tree/master/tasks/simple-batch-job

While we start this as a task in PCF , we are facing the taskLifeCycleListener issue.

Let me give the background, we are planning to create Spring Batch to execute some scheduled tasks in the cloud. We heard that Spring Data Flow is having additional
features to run the jobs and its takes care of task execution life cycle events. But when we run the sample program, getting a message like the job has been executed and failed state.
where logs says that the taskLifeCycleListener issue.

Steps we have done :

  1. batch job is exported to private repository
  2. Registered with Spring data flow server
  3. Created as a task (Not created any stream)
  4. launch the task
    SDF.txt

But we are getting "Exception encountered during context intialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Failed to start bean 'taskLifecycleListener'; nested exception is java.lang.IllegalArgument
ception: Invalid TaskExecution, ID 15 not found"

from spring-cloud-dataflow-samples.

evasanthan avatar evasanthan commented on August 29, 2024

@cppwfs
Yes, I have configured mysql and Redis both services are bounded to the spring data flow. should i need configure any database/this database service for deployed simple batch job even it is not used any database connections?

from spring-cloud-dataflow-samples.

cppwfs avatar cppwfs commented on August 29, 2024

Yes. When a task is launched from SCDF, SCDF records a task-execution-id for tracking and the task then uses this to record its task-execution information.
The datasource information should be passed to the task via properties at launch time. However be sure to include the dependency for mysql/mariadb to your sample task pom.

from spring-cloud-dataflow-samples.

evasanthan avatar evasanthan commented on August 29, 2024

Thank you @cppwfs and @sabbyanandan to resolve this issue. But i don't know that how to bind the datasource services rather than hardcoded user and password id even i bounded like app.task-launcher-local.spring.cloud.deployer.cloudfoundry.services=mysqlPDF. which is also not picking up datasource connection while starting the server

Example :

stream create foo --definition "triggertask --triggertask.uri= http://good.com/yyyy.jar --trigger.fixed-delay=180 --triggertask.environment-properties=spring.datasource.url=jdbc:mysql://host/schema?user=xxxxx&password=yyyyy,spring.datasource.maxActive=2,spring.datasource.tomcat.initial-size=2 | task-launcher-local"

And also restart option of task is disabled in spring data flow server by default. I don't know that how batch program can be restarted pro grammatically or through spring data flow dash board.

On few blogs are mentioned like, Task-launcher-local app is for development purpose only. I'm not sure that what changes needs to be done for production implementation. Can i make use the same task-launcher-local for production purpose? please guide and help me on this as i am new to this technology.

from spring-cloud-dataflow-samples.

karthikitzmi avatar karthikitzmi commented on August 29, 2024

I am having the similar issue. I am using MySQL in my SimpleTask application. I see SCDF creating task_execution table in MySQL. I believe its not inserting the records in MYSQL when the task in launched. So its unable to find records. Here are the logs for SCDF. I expect it to be Database config issue. Spring Cloud Data Flow Local Server (v1.2.3.RELEASE)

2017-09-17 21:50:59.316 INFO 3888 --- [ main] c.c.c.ConfigServicePropertySourceLocator : Fetching config from server at: http://localhost:8888
2017-09-17 21:51:00.705 WARN 3888 --- [ main] c.c.c.ConfigServicePropertySourceLocator : Could not locate PropertySource: I/O error on GET request for "http://localhost:8888/spring-cloud-dataflow-server-local/default": Connection refused: connect; nested exception is java.net.ConnectException: Connection refused: connect
2017-09-17 21:51:00.720 INFO 3888 --- [ main] o.s.c.d.s.local.LocalDataFlowServer : No active profile set, falling back to default profiles: default
2017-09-17 21:51:05.784 INFO 3888 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode!
2017-09-17 21:51:07.078 INFO 3888 --- [ main] o.s.cloud.context.scope.GenericScope : BeanFactory id=b15ff760-91d3-31de-a2a8-f2cc5ce41a5c
2017-09-17 21:51:10.686 INFO 3888 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2017-09-17 21:51:10.691 INFO 3888 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/8.5.15
2017-09-17 21:51:10.995 INFO 3888 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2017-09-17 21:51:12.519 INFO 3888 --- [ main] erverConfiguration$H2ServerConfiguration : Starting H2 Server with URL: jdbc:h2:tcp://localhost:19092/mem:dataflow
2017-09-17 21:51:14.674 INFO 3888 --- [ main] o.s.c.d.s.r.s.DataflowRdbmsInitializer : Adding dataflow schema classpath:schema-h2-common.sql for h2 database 2017-09-17 21:51:14.677 INFO 3888 --- [ main] o.s.c.d.s.r.s.DataflowRdbmsInitializer : Adding dataflow schema classpath:schema-h2-streams.sql for h2 database

Logs for the Task being launched: I didn't see record for below ID in task_execution in mysql

2017-09-17 22:00:56.750 INFO 5496 --- [ main] o.s.c.support.DefaultLifecycleProcessor : Starting beans in phase 0
2017-09-17 22:00:56.800 WARN 5496 --- [ 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
2017-09-17 22:00:56.801 INFO 5496 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Unregistering JMX-exposed beans on shutdown
2017-09-17 22:00:56.802 ERROR 5496 --- [ main] o.s.c.t.listener.TaskLifecycleListener : An event to end a task has been received for a task that has not yet started.
2017-09-17 22:00:56.826 INFO 5496 --- [ main] utoConfigurationReportLoggingInitializer :

Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
2017-09-17 22:00:56.857 ERROR 5496 --- [ 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:178) ~[spring-context-4.3.11.RELEASE.jar!/:4.3.11.RELEASE]
at org.springframework.context.support.DefaultLifecycleProcessor.access$200(DefaultLifecycleProcessor.java:50) ~[spring-context-4.3.11.RELEASE.jar!/:4.3.11.RELEASE]
at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:348) ~[spring-context-4.3.11.RELEASE.jar!/:4.3.11.RELEASE]

from spring-cloud-dataflow-samples.

cppwfs avatar cppwfs commented on August 29, 2024

I need a little context here. Are you launching the task from Spring Cloud Data Flow, a Task Launcher Sink or, Composed Task Runner.

from spring-cloud-dataflow-samples.

karthikitzmi avatar karthikitzmi commented on August 29, 2024

I am launching the task from Spring cloud data flow. I registered my Application as a task using UI. Then gave a definition name. Launched the task application from tasks definitions in UI.

from spring-cloud-dataflow-samples.

cppwfs avatar cppwfs commented on August 29, 2024

Can you send me a link to your repo for the SimpleTask

from spring-cloud-dataflow-samples.

karthikitzmi avatar karthikitzmi commented on August 29, 2024

I am not sure If I could share the existing repo as its not public. I would appreciate if you could let me know on how to disable H2 DB completely on local server SCDF and enable MySQL that's being used by the SimpleTask. I got this issue when my SimpleTask was using MySQL. I was able to run SimpleTask without DB interactions on local SCDF as that uses H2 internally.

I would give a try to setup MYSQL for SCDF local server if you could give some pointers.. If that doesn't work, I would recreate the issue with sample repo that is shareable.

I believe the only way to configure DB is to set them in environment properties for both SPDF local server and SimpleTask.

from spring-cloud-dataflow-samples.

karthikitzmi avatar karthikitzmi commented on August 29, 2024

I got it resolved. I had to add dependency jars for oracle in SCDF & launch it. Then this issue wasn't reproduced.

from spring-cloud-dataflow-samples.

sabbyanandan avatar sabbyanandan commented on August 29, 2024

Thanks for confirming, @karthikitzmi.

from spring-cloud-dataflow-samples.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.