Добрый день!
Есть одна нерегулярно возникающая проблема. Подскажите, пожалуйста, на что можно обратить внимание чтобы найти причину.
Добавили задание в шедулер и теперь иногда приложение зависает. Но если нажать Ctrl+C в окне томката, то оно отвисает.
Задание в файле web-spring.xml:
<task:scheduled-tasks scheduler="scheduler">
<task:scheduled ref="wld_One2WorkAutoReceiveStateBean" method="getEmployee12WState" cron="0 0/30 8-19 * * *"/>
</task:scheduled-tasks>
Код:
@Component(One2WorkAutoReceiveStateBean.NAME)
public class One2WorkAutoReceiveStateBean {
public static final String NAME = "wld_One2WorkAutoReceiveStateBean";
public static final String LOGIN = AppContext.getProperty("wld.12W-integration.auto.login");
public static final String PASSWORD = AppContext.getProperty("wld.12W-integration.auto.password");
private static final Logger log = LoggerFactory.getLogger(One2WorkAutoReceiveStateBean.class);
@Inject
private ServiceOrderService serviceOrderService;
@Inject
private One2workIntegrationSource one2workIntegrationSource;
@Inject
private AuthenticationService authenticationService;
@Inject
private UserSessionService userSessionService;
public void getEmployee12WState() {
log.info("start auto receive one2work states");
UserSession userSession = login();
logout(userSession);
log.info("end auto receive one2work states");
}
private UserSession login() {
log.info("login " + LOGIN);
UserSession userSession = authenticationService.login(new LoginPasswordCredentials(LOGIN, PASSWORD)).getSession();
AppContext.setSecurityContext(new SecurityContext(userSession));
return userSession;
}
private void logout(UserSession userSession) {
log.info("logout");
try {
userSessionService.killSession(userSession.getId());
} catch (NoUserSessionException ex) {
log.error("unable to logout:" + ex.getLocalizedMessage());
}
}
}
Прикладываю лог, зависает на строке
лог ошибка.txt (1.4 МБ)
2023-01-20 14:03:17.876 DEBUG [http-nio-4002-exec-5/app/ekuzmenko@elg-sys.com] com.haulmont.cuba.web.App - Ping middleware session
Заранее спасибо!