List of usage examples for org.apache.commons.configuration2.ex ConfigurationException printStackTrace
public void printStackTrace()
From source file:com.axatrikx.common.AxaConfig.java
/** * Save execution configuration//www . jav a 2s .c om */ public static void saveExecutionConfChanges() { try { builder.save(); } catch (ConfigurationException e) { e.printStackTrace(); } }
From source file:nl.minvenj.pef.stream.LiveCapture.java
/** * Main function to start the tool for pseudonymization of packets. * * @param args command line tool arguments */// www . ja v a 2s. c om public static void main(String[] args) { String xmlConfigFile; if (args.length == 1) { xmlConfigFile = args[0]; } else { xmlConfigFile = "configuration.xml"; } // Test if the file exists. File configFile = new File(xmlConfigFile); if (!configFile.exists()) { System.out.println("Create the file configuration.xml with the settings for pseudonymization. " + "You can copy the configuration.proto.xml file as template."); // Exit the application. return; } else { System.out.println("Using " + xmlConfigFile + " as configuration file."); } Parameters params = new Parameters(); FileBasedConfigurationBuilder<XMLConfiguration> builder = new FileBasedConfigurationBuilder<>( XMLConfiguration.class).configure(params.xml().setFileName(xmlConfigFile)); try { XMLConfiguration config = builder.getConfiguration(); // Check the configuration. String logFile = config.getString("log_file", "default_log.txt"); initLogger(logFile); if (checkConfiguration(config)) { runPEF(config); } } catch (ConfigurationException cex) { // Loading of the configuration file failed cex.printStackTrace(); } catch (IOException | SecurityException | IllegalArgumentException e) { // The logger could not be initialized. System.err.println("The logger could not be initialized " + e.getMessage()); } catch (PEFException e) { System.err.println(e.getMessage()); } }