Java – spring scheduled tasks are not performed on Windows 7

I have a strange behavior about planning tasks I have the following settings

<task:scheduled-tasks>
      <task:scheduled ref="servicioEjecucionReportes" method="ejecutar" cron="0 0 * * * *" />
      <task:scheduled ref="servicioEjecucionReportes" method="ejecutarReintentos" cron="0 30 * * * *" />
      <task:scheduled ref="servicioEjecucionReportes" method="enviarReporteDiario" cron="0 15 0 * * *" />
</task:scheduled-tasks>

And the execution program is configured in this way:

<task:annotation-driven executor="asyncExecutor" scheduler="taskScheduler" />
<task:executor id="asyncExecutor" rejection-policy="CALLER_RUNS" pool-size="16" />
<task:scheduler id="taskScheduler" pool-size="8" />

The problem is that we are developing with Linux and Mac OS, and the three tasks are executed correctly, but on the deployment server is Windows 7 server, the first two are executed correctly, and the third is not

I need to perform the third task every day at 00:15

I've tried to change the configuration, but the behavior is always the same. Everything works well in the development and test environment, but not in the production environment

I'm a little lost in where to look or have a problem

The bean declaration is as follows:

<bean id="servicioEjecucionReportes" class="com.mycompany.beans.ServicioEjecucionReportesImpl" />

The interface is:

public interface ServicioEjecucionReportes {

   public void ejecutar();

   public void ejecutarReintentos();

   public void enviarReporteDiario();
}

Edit: for additional information, we didn't even see the task we tried to run in the server log. The spring version is 3.1 0

Solution

There seems to be a problem with the scheduled asynchronous method in windows This is related to how the JVM creates threads on windows

Try deleting @ async and checking that it is valid

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>