List of usage examples for org.apache.commons.configuration ConfigurationException printStackTrace
public void printStackTrace()
From source file:com.boozallen.cognition.accumulo.config.CognitionConfiguration.java
/** * Load the CognitionConfiguration from the given AccumuloConfiguration object * and any other configurations from the given properties file. * @param filePath -- the path to the properties file *///from w w w .j a v a2 s . c o m public CognitionConfiguration(AccumuloConfiguration accumuloConfig, String filePath) { try { this.config = new PropertiesConfiguration(filePath); } catch (ConfigurationException e) { // TODO Auto-generated catch block e.printStackTrace(); } this.accumuloConfig = accumuloConfig; }
From source file:io.s4.S4Module.java
private void loadProperties(Binder binder) { try {/*w w w . ja v a 2 s . c o m*/ InputStream is = this.getClass().getResourceAsStream(S4_PROPERTIES_FILE); config = new PropertiesConfiguration(); config.load(is); System.out.println(ConfigurationUtils.toString(config)); // TODO - validate properties. /* Make all properties injectable. Do we need this? */ Names.bindProperties(binder, ConfigurationConverter.getProperties(config)); } catch (ConfigurationException e) { binder.addError(e); e.printStackTrace(); } }
From source file:de.anhquan.config4j.internal.ConfigHandler.java
public ConfigHandler(Class<?> configType) { this.configType = configType; ConfigContainer annotation = configType.getAnnotation(ConfigContainer.class); configLocation = annotation.Location(); prefix = annotation.Prefix();//from w w w. j a va 2s . c om try { configuration = new PropertiesConfiguration(configLocation); } catch (ConfigurationException e) { e.printStackTrace(); } }
From source file:eu.leads.crawler.c4j.LeadsWP5DemoCrawlController.java
private void init() { InputStream input = null;/* w w w .j av a 2 s . c o m*/ try { input = new FileInputStream(parametersFile); // load a properties file properties.load(input); config = new XMLConfiguration("/leads/workm30/leads-query-processor/" + "nqe/system-plugins/adidas-processing-plugin/" + "adidas-processing-plugin-conf-test.xml"); DataStoreSingleton.configureDataStore(config); } catch (IOException ex) { ex.printStackTrace(); } catch (ConfigurationException e) { // TODO Auto-generated catch block e.printStackTrace(); } }
From source file:com.hipstogram.storm.context.HipstogramContext.java
private HipstogramContext() { String configFile = System.getProperty("config"); if (configFile == null) configFile = getClass().getClassLoader().getResource("config/config.ini").getFile(); try {//from w w w. ja va 2 s . c om System.out.println("Expecting config file in: " + configFile); configuration = new Config(new File(configFile)); } catch (ConfigurationException e) { // Java, I hate you. Checked exceptions are the devil. Look, what you are forcing me to do, LOOK! e.printStackTrace(); } }
From source file:edu.lternet.pasta.portal.ConfigurationListener.java
@Override public void contextInitialized(ServletContextEvent servletContextEvent) { ServletContext servletContext = servletContextEvent.getServletContext(); // Create an absolute path for accessing configuration properties String cwd = servletContext.getRealPath("."); // Initialize log4j String log4jPropertiesPath = cwd + "/WEB-INF/conf/log4j.properties"; PropertyConfigurator.configureAndWatch(log4jPropertiesPath); // Initialize commons configuration String appConfigPath = cwd + "/WEB-INF/conf/dataportal.properties"; try {/*from w ww . j av a 2 s .c o m*/ config = new PropertiesConfiguration(appConfigPath); config.setProperty("system.cwd", cwd); config.save(); } catch (ConfigurationException e) { logger.error(e); e.printStackTrace(); } }
From source file:eu.optimis.trustedinstance.DBStorage.java
private void init() { try {/*from w ww.j a v a 2 s .com*/ ConfigurationFactory factory = new ConfigurationFactory("config.xml"); config = factory.getConfiguration(); } catch (ConfigurationException ex) { ex.printStackTrace(); } }
From source file:net.i2cat.netconf.test.BaseNetconfTest.java
@Test public void testLoadConfiguration() { try {//from w ww .j a v a 2s . c om session.loadConfiguration(new PropertiesConfiguration("netconf-default.properties")); } catch (ConfigurationException e) { e.printStackTrace(); } }
From source file:edu.lternet.pasta.datapackagemanager.dataserver.ConfigurationListener.java
/** * Run initialization code when at web application start-up. * /*from w w w. j ava 2 s. c om*/ * * @param servletContextEvent The ServletContextEvent object * @throws ResourceNotFoundException * if the properties file can not be found * @throws IllegalStateException * if an {@link IOException} is thrown while reading the * properties file */ public void contextInitialized(ServletContextEvent servletContextEvent) { ServletContext servletContext = servletContextEvent.getServletContext(); // Create an absolute path for accessing configuration properties String cwd = servletContext.getRealPath("."); // Initialize log4j String log4jPropertiesPath = cwd + "/WEB-INF/conf/log4j.properties"; PropertyConfigurator.configureAndWatch(log4jPropertiesPath); // Initialize commons configuration String appConfigPath = cwd + "/WEB-INF/conf/datapackagemanager.properties"; try { config = new PropertiesConfiguration(appConfigPath); config.setProperty("system.cwd", cwd); config.save(); } catch (ConfigurationException e) { logger.error(e); e.printStackTrace(); } }
From source file:au.com.dw.testdatacapturej.config.ConfigurationFileTest.java
@Before public void setUp() throws Exception { try {//w w w .j a va 2s. c om xmlConstructorConfig = new XMLConfiguration("test-constructor-config.xml"); xmlSetterConfig = new XMLConfiguration("test-setter-config.xml"); xmlCollectionConfig = new XMLConfiguration("test-collection-config.xml"); configUtil = new ConfigUtil(); } catch (ConfigurationException cex) { cex.printStackTrace(); } }