Engine: avoid a NPE when spring context is not set