Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/grails/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring云数据流中的Spring批处理到Spring任务_Spring_Spring Boot_Spring Batch_Spring Cloud Task - Fatal编程技术网

Spring云数据流中的Spring批处理到Spring任务

Spring云数据流中的Spring批处理到Spring任务,spring,spring-boot,spring-batch,spring-cloud-task,Spring,Spring Boot,Spring Batch,Spring Cloud Task,我不熟悉spring批处理和spring云数据流。 我修改了spring批处理的示例quickstart项目,它现在在本地MSSQL数据库上编写:当我使用java-jar运行它时,它工作得很好。 我现在尝试将其部署到Spring Cloud Data Flow的本地实例,将其作为任务从仪表板导入并尝试运行:它给了我以下错误: 2017-11-15 17:54:46.109 INFO 17164 --- [ main] hello.Application

我不熟悉spring批处理和spring云数据流。 我修改了spring批处理的示例quickstart项目,它现在在本地MSSQL数据库上编写:当我使用java-jar运行它时,它工作得很好。 我现在尝试将其部署到Spring Cloud Data Flow的本地实例,将其作为任务从仪表板导入并尝试运行:它给了我以下错误:

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.springframework.context.annotation.AnnotationConfigApplicationContext@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
同样的spring批处理uber jar在作为流部署时也能工作:我缺少了什么?

谢谢您的回复

要在SCDF中运行Spring批处理作业,必须使应用程序适应Spring云任务。请使用和批处理作业样本作为参考

除非应用程序适应此模型,否则它将不会在SCDF中运行


还有一件事。批处理作业只能在SCDF中作为任务运行,不能在流中使用。

您如何在SCDF中注册spring batch app?它必须注册为任务-是吗?这句话也令人困惑:当作为流部署时,同一个spring批处理uber jar也可以工作——批处理作业不能作为流运行。请共享自定义应用程序代码、应用程序注册、流或任务定义命令,我们很乐意查看。Hello@SabbyAnandan,感谢您的帮助。我将代码推送到我的github存储库:。如您所见,我遵循了spring batch quickstart示例,并对其进行了修改,使其使用了一个带有不同表的个人本地MSSQL DB。通过指向目标文件夹中的.jar,我从GUI注册了任务和流。我知道我做错了什么,但我不知道是什么。再次感谢!