Guard against exceptions from ApplicationListener

Issue: SPR-11578