我已经在AWS EC2中部署了一个Spring Boot项目。我已添加@Scheduled控制器之一,以每天执行此功能。它已经工作了,但是最近我收到了一些错误消息。我已经对该错误进行了一些研究,并试图解决该错误,但该消息仍然显示。谁能给我任何解决问题的想法?谢谢你的进步
控制器:
@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" />
答案 0 :(得分:0)
您是否要执行从未启用https的应用发送任何https请求?确保已启用https。如果即使客户端未启用HTTPS,仍尝试发送https请求的客户端,则您可能会收到此错误
欢呼:)