Code example for UnknownHostException

Methods: printStackTrace

0
	public void contextInitialized(ServletContextEvent event) {
		 try { 
			event.getServletContext().setAttribute(MONGO_INSTANCE, new Mongo("localhost"));
		} catch (UnknownHostException e) {
			// TODO Auto-generated catch block 
			e.printStackTrace();
		} catch (MongoException e) {
			// TODO Auto-generated catch block 
			e.printStackTrace();
		} 
 
		 
	} 
 
}