即使批处理作业失败,Spring Cloud Task状态也显示为已完成 [英] Spring Cloud Task status shown as complete even when the batch job fails

查看:168
本文介绍了即使批处理作业失败,Spring Cloud Task状态也显示为已完成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含2个批处理作业的任务,两个作业都运行,但是其中一个失败.特定任务的状态仍显示为完成. 我读过有关设置 spring.cloud.task.batch.failOnJobFailure 属性的信息.当我在运行任务时将此属性设置为true时,它给我以下错误:

I have a task with 2 batch jobs, both jobs run but one of them fails. The status of the particular task is still shown as complete. i read about setting the spring.cloud.task.batch.failOnJobFailure property. When i set this property to true while running the task it gives me the following error:

o.s.boot.SpringApplication               : Application startup failed

java.lang.AbstractMethodError: null
    at org.springframework.beans.factory.support.AbstractBeanFactory.isSingleton(AbstractBeanFactory.java:402) ~[spring-beans-4.2.4.RELEASE.jar!/:4.2.4.RELEASE]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:447) ~[spring-beans-4.2.4.RELEASE.jar!/:4.2.4.RELEASE]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:415) ~[spring-beans-4.2.4.RELEASE.jar!/:4.2.4.RELEASE]
    at org.springframework.context.support.DefaultLifecycleProcessor.getLifecycleBeans(DefaultLifecycleProcessor.java:273) ~[spring-context-4.2.4.RELEASE.jar!/:4.2.4.RELEASE]
    at org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:131) ~[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 com.mediaiq.appnexus.batch.AppnexusBatchServiceApplication.main(AppnexusBatchServiceApplication.java:53) [classes!/:na]
    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:48) [aiq-appnexus-batch-service-3.23.1.jar:na]
    at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) [aiq-appnexus-batch-service-3.23.1.jar:na]
    at org.springframework.boot.loader.Launcher.launch(Launcher.java:50) [aiq-appnexus-batch-service-3.23.1.jar:na]
    at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51) [aiq-appnexus-batch-service-3.23.1.jar:na]

推荐答案

这很可能是版本不兼容的问题.

This is most likely a version incompatibility issue.

通过 spring- cloud/spring-cloud-dataflow-ui#917#issuecomment-425945144 总结了各种版本兼容性方案.

There's a duplicate thread via spring-cloud/spring-cloud-dataflow-ui#917#issuecomment-425945144 that summarizes the various version compatibility scenarios.

如果兼容堆栈上仍然存在问题,那么最好检查可复制的示例应用程序.

If there are continued problems on the compatible stack, it'd be good to review a reproducible sample App.

这篇关于即使批处理作业失败,Spring Cloud Task状态也显示为已完成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆