since your attribute
private static ApplicationContext ctx;
are static you need to reference in your set as
ApplicationContextUtils.ctx = appContext;