2017-11-15 2 views
0

저는 스프링 배치 및 스프링 클라우드 데이터 흐름이 처음입니다. spring-batch에 대한 샘플 빠른 시작 프로젝트를 수정했으며 이제 로컬 MSSQL 데이터베이스에 기록합니다. java -jar를 사용하여 실행하면 제대로 작동합니다. 그것은 나에게이 오류 제공 : 는 지금 대시 보드에서 작업로를 수입하고 실행하려고, 봄 클라우드 데이터 흐름의 로컬 인스턴스에 배포하려고스프링 클라우드 데이터 흐름의 스프링 배치 - 스프링 작업

2017-11-15 17:54:46.109 INFO 17164 --- [   main] hello.Application      : Starting Application v0.0.1-SNAPSHOT on localmachine with PID 17164 (C:\Users\massimo.sporchia\eclipse-workspace\batch-example\target\batch-example-0.0.1-SNAPSHOT.jar started by massimo.sporchia in C:\Users\MASSIM~1.SPO\AppData\Local\Temp\spring-cloud-dataflow-5975572085987003620\exampleTask-1510764882259\exampleTask-4fd22d5a-a5f0-49d5-8634-a4bbb21d2675) 
2017-11-15 17:54:46.129 INFO 17164 --- [   main] hello.Application      : No active profile set, falling back to default profiles: default 
2017-11-15 17:54:46.402 INFO 17164 --- [   main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.spring[email protected]1698c449: startup date [Wed Nov 15 17:54:46 CET 2017]; root of context hierarchy 
2017-11-15 17:54:49.020 WARN 17164 --- [   main] o.s.c.a.ConfigurationClassEnhancer  : @Bean method ScopeConfiguration.stepScope 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. 
2017-11-15 17:54:49.066 WARN 17164 --- [   main] o.s.c.a.ConfigurationClassEnhancer  : @Bean method ScopeConfiguration.jobScope 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. 
2017-11-15 17:54:49.288 INFO 17164 --- [   main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cloud.task.batch.configuration.TaskBatchAutoConfiguration' of type [org.springframework.cloud.task.batch.configuration.TaskBatchAutoConfiguration$$EnhancerBySpringCGLIB$$da33614e] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 
2017-11-15 17:54:49.306 INFO 17164 --- [   main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$54c3b5c2] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 
2017-11-15 17:54:49.441 INFO 17164 --- [   main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cloud.task.batch.listener.BatchEventAutoConfiguration' of type [org.springframework.cloud.task.batch.listener.BatchEventAutoConfiguration$$EnhancerBySpringCGLIB$$22896b51] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 
2017-11-15 17:54:49.631 WARN 17164 --- [   main] s.c.a.AnnotationConfigApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'batchConfiguration': Unsatisfied dependency expressed through field 'jobBuilderFactory'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.batch.core.configuration.annotation.SimpleBatchConfiguration': Unsatisfied dependency expressed through field 'dataSources'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Tomcat.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.tomcat.jdbc.pool.DataSource]: Factory method 'dataSource' threw exception; nested exception is java.lang.IllegalStateException: Cannot load driver class: org.h2.Driver 
2017-11-15 17:54:49.653 INFO 17164 --- [   main] utoConfigurationReportLoggingInitializer : 

Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled. 
2017-11-15 17:54:49.686 ERROR 17164 --- [   main] o.s.boot.SpringApplication    : Application startup failed 

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'batchConfiguration': Unsatisfied dependency expressed through field 'jobBuilderFactory'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.batch.core.configuration.annotation.SimpleBatchConfiguration': Unsatisfied dependency expressed through field 'dataSources'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Tomcat.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.tomcat.jdbc.pool.DataSource]: Factory method 'dataSource' threw exception; nested exception is java.lang.IllegalStateException: Cannot load driver class: org.h2.Driver 

같은 스프링 배치를 uber- 항아리가 스트림으로 배포되면 작동합니다. 무엇이 누락 되었습니까?

+0

SCDF에 'spring-batch' 앱을 어떻게 등록하고 있습니까? 그것은 '과제'로 등록되어야합니다 - 당신입니까? 이 문장은 혼란 스럽습니다. "동일한 스프링 배치 uber-jar가 스트림으로 배포 될 때 작동합니다."- 배치 작업은 스트림으로 실행될 수 없습니다. 맞춤 앱 (코드), 앱 등록, 스트림 또는 작업 정의 명령을 공유해 주시면 검토해 드리겠습니다. –

+0

안녕하세요. @SabbyAnandan, 도와 주셔서 감사합니다. 코드를 github 저장소 (https://github.com/MassimoSporchia/spring-batch-example)에 푸시했습니다. 보시다시피, 나는 스프링 일괄 퀵 스타트 예제를 따르고 다른 테이블과 함께 개인 로컬 MSSQL DB를 사용하도록 수정했습니다. 대상 폴더에서 .jar를 가리켜 GUI에서 작업과 스트림을 모두 등록했습니다. 제가 잘못하고있는 것을 알고 있지만 무엇이 있는지 모르겠습니다. 다시 한번 감사드립니다! – Massimo

답변

1

레포에 감사드립니다.

SCDF에서 스프링 배치 작업을 실행하려면 응용 프로그램을 스프링 클라우드 작업 programming model에 적용해야합니다. Spring Cloud TaskSpring Cloud Data Flow 배치 작업 샘플을 참조로 사용하십시오.

응용 프로그램이이 모델에 적합하지 않으면 이 SCDF에서 실행되지 않습니다.

다른 하나. 배치 작업은 SCDF의 태스크로만 실행할 수 있으며 을 스트림에서 사용할 수 없습니다.

관련 문제