public void contextInitialized(ServletContextEvent event) {
long startTime = System.currentTimeMillis();
log.info("Starting Pebble");
ApplicationContext applicationContext = WebApplicationContextUtils.getRequiredWebApplicationContext(event.getServletContext());
Configuration config = (Configuration)applicationContext.getBean("pebbleConfiguration");
DAOFactory.setConfiguredFactory(config.getDaoFactory());
PebbleContext ctx = PebbleContext.getInstance();
ctx.setConfiguration(config);
ctx.setWebApplicationRoot(event.getServletContext().getRealPath("/"));
ctx.setApplicationContext(applicationContext);
BlogManager.getInstance().setMultiBlog(config.isMultiBlog());
BlogManager.getInstance().startBlogs();
// find those blogs with no entries and add a welcome note
Collection<Blog> blogs = (Collection<Blog>)BlogManager.getInstance().getBlogs();
for (Blog blog : blogs) {