if(springApplicationContextClass != null) {
try {
applicationContext = (ApplicationContext) springApplicationContextClass.getDeclaredConstructor(ServletContext.class).newInstance(servletContextEvent.getServletContext());
} catch (InstantiationException e) {
e.printStackTrace();
throw new SherpaRuntimeException(e);
} catch (IllegalAccessException e) {
e.printStackTrace();
throw new SherpaRuntimeException(e);
} catch (IllegalArgumentException e) {
e.printStackTrace();
throw new SherpaRuntimeException(e);
} catch (SecurityException e) {
e.printStackTrace();
throw new SherpaRuntimeException(e);
} catch (InvocationTargetException e) {
e.printStackTrace();
throw new SherpaRuntimeException(e);
} catch (NoSuchMethodException e) {
e.printStackTrace();
throw new SherpaRuntimeException(e);
}
} else {
applicationContext = new GenericApplicationContext();
}