Ho eseguito l'operazione utilizzando l'annotazione Spring @Scheduled, ma per qualche motivo è in esecuzione due volte. La mia versione di Spring Framework è 3.0.2.Spring @Scheduled esegue l'attività due volte quando si utilizzano le annotazioni
@Service
public class ReportService {
@Scheduled(fixedDelay=1000 * 60 * 60* 24)
@Transactional
public void dailyReportTask()
{
... code here ...
}
}
Ecco il mio XML:
<?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"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/task
http://www.springframework.org/schema/task/spring-task-3.0.xsd">
<task:scheduler id="taskScheduler" />
<task:executor id="taskExecutor" pool-size="1" />
<task:annotation-driven executor="taskExecutor"
scheduler="taskScheduler" />
</beans>
È possibile incollare parte del contesto applicativo pertinente o altra configurazione di questo tipo? C'è forse un'altra operazione pianificata che chiama questo? – jasonmp85