Spring批处理管理未触发计划任务

Spring批处理管理未触发计划任务,spring,spring-batch-admin,Spring,Spring Batch Admin,批处理作业xml为: @Component public class JobScheduler { private static final Log logger = LogFactory.getLog(JobScheduler.class); @Autowired private JobLauncher jobLauncher; @Autowired private Job job; @Scheduled(cron = "0

批处理作业xml为:

    @Component
    public class JobScheduler {
    private static final Log logger = LogFactory.getLog(JobScheduler.class);

    @Autowired
    private JobLauncher jobLauncher;

    @Autowired
    private Job job;

    @Scheduled(cron = "0 0/1 * * * ?")
    public void run() {
        try {
            String dateParam = new Date().toString();
            JobParameters param = new JobParametersBuilder().addString("date", dateParam).toJobParameters();
            jobLauncher.run(job, param);
        } catch (Exception e) {
            logger.error(e.getStackTrace());
        }
    }

    }

我使用的是与STS 3.6捆绑在一起的VMWare vFabric tc服务器
cron表达式应该每一分钟触发一次infinite1作业。但事实并非如此。任何指针都将不胜感激。

尝试将
@EnableScheduling
放入类中

尝试将
@EnableScheduling
放入类中

使用该注释会导致此错误:“@Scheduled method'removeInactiveExecutions'在bean目标类'SimpleJobService'上找到,但在动态代理的任何接口中都找不到。”即使在使用注释@enableSpectJautoproxy(proxyTargetClass=true)时,仍然会得到相同的错误。使用SBA 2.0.0.BUILD-SNAPSHOT和Spring Batch Core 3.0.7.Release使用该注释会导致以下错误:“@Scheduled method'removeInactiveExecutions'在bean目标类'SimpleJobService'上找到,但在动态代理的任何接口中都找不到。”即使使用注释@EnableSpectJautProxy(proxyTargetClass=true),仍然会得到相同的错误。使用SBA 2.0.0.BUILD-SNAPSHOT和Spring Batch Core 3.0.7.Release,您解决过这个问题吗?如果是这样,你的解决方案是什么?@Rick-不,我们无法让它工作,所以我们把它放在积压工作中,然后转移到其他项目。你解决过这个问题吗?如果是的话,你的解决方案是什么?@Rick-不,我们无法让它工作,所以我们把它放在积压工作中,然后转到其他项目。
 <?xml version="1.0" encoding="UTF-8"?>
  <beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:task="http://www.springframework.org/schema/task"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="
    http://www.springframework.org/schema/batch http://www.springframework.org/schema/batch/spring-batch.xsd
    http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.1.xsd
    http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
    http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">


<context:annotation-config />
<context:component-scan base-package="org.springframework.batch.admin.sample" />

<job id="infinite1" xmlns="http://www.springframework.org/schema/batch">
    <step id="step1">
        <tasklet start-limit="100">
            <chunk commit-interval="1" reader="itemReader" writer="itemWriter" />
        </tasklet>
    </step>
</job>

<bean id="itemWriter" class="org.springframework.batch.admin.sample.ExampleItemWriter"/>
<bean id="itemReader" class="org.springframework.batch.admin.sample.ExampleItemReader" scope="step"/>

<task:scheduled-tasks>
    <task:scheduled ref="jobScheduler" method="run" cron="0 0/1 * * * ?"/>
</task:scheduled-tasks>

<bean id="jobScheduler" class="org.springframework.batch.admin.sample.JobScheduler" />