I have deployed a spring boot project in AWS EC2. one of controller i have added @Scheduled this annotation to execute function daily. It has been worked but i have got some error messages recently. I have done some research about this error and tried to fix it but the message still show up. could anyone give me any ideas to solve the problem? thank you for advance
Controller:
@Scheduled(cron = "0 0 0 * * ?")
public void overloadAdsInMidnight() {
Date yesterDay = DateUtility.getMinDate(DateUtility.calculateDate(new Date(), null, null, -1));
String yesterDayStr = DateUtility.dateToStr(yesterDay, DateUtility.YYYYMMDD);
this.synchronizeAdsByCreateAndUpdate(yesterDayStr);
}
@RequestMapping(value = "/overloadAdsByDate", method = RequestMethod.GET)
public ResponseEntity<String> synchronizeAdsByCreateAndUpdate(@RequestParam String date) {
try {
LocalDateTime actionDateTime = LocalDateTime.now();
this.facebookAdsServ.synchronizeFacebookAdsByDate(date);
LOG.info("overload data startDateTime : {}", actionDateTime);
} catch (Exception e) {
e.printStackTrace();
}
return new ResponseEntity<>(SUCCESS_MESSAGE, HttpStatus.OK);
}
tomcat server.xml
<Connector
port="8081"
protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443"
maxHttpHeaderSize="8192" />