Example usage for org.apache.commons.configuration ConfigurationException toString

List of usage examples for org.apache.commons.configuration ConfigurationException toString

Introduction

In this page you can find the example usage for org.apache.commons.configuration ConfigurationException toString.

Prototype

public String toString() 

Source Link

Document

Returns a short description of this throwable.

Usage

From source file:util.AbstractReadSystemConfigurations.java

private static boolean readUseDaia() {

    boolean useDaia = false;

    try {//from w w w .  j  a v a 2s .  co m
        final Configuration config = new PropertiesConfiguration(PATH);
        useDaia = config.getBoolean("useDaia");

    } catch (final ConfigurationException e) {
        LOG.error(e.toString());
    }

    return useDaia;
}

From source file:util.AbstractReadSystemConfigurations.java

private static String[] readDaiaHosts() {

    String[] daiaHosts = null;//from  w  w w. jav a2  s .c  o m

    try {
        final Configuration config = new PropertiesConfiguration(PATH);
        daiaHosts = parse(config.getString("daiaHosts"));

    } catch (final ConfigurationException e) {
        LOG.error(e.toString());
    }

    return daiaHosts;
}

From source file:util.AbstractReadSystemConfigurations.java

private static String[] readSeeksServers() {

    String[] seeksServers = null;

    try {//from  w  w w.  j  ava 2s  .c o  m
        final Configuration config = new PropertiesConfiguration(PATH);
        seeksServers = config.getStringArray("seeksServer.domains");

    } catch (final ConfigurationException e) {
        LOG.error(e.toString());
    }

    return seeksServers;
}

From source file:velo.ejb.seam.action.ConfActionsBean.java

public void saveSysConf() {
    try {/* w  w  w  .  j  a va 2 s. com*/
        log.debug("START: SAVE XML METHOD");
        javax.faces.component.UIViewRoot viewRoot = javax.faces.context.FacesContext.getCurrentInstance()
                .getViewRoot();
        java.util.List<javax.faces.component.UIComponent> components = viewRoot.getChildren();

        javax.faces.component.UIComponent form = viewRoot.findComponent("xmlSysConfForm");

        javax.faces.component.UIComponent mainXmlConf = form.findComponent("mainXmlConf");
        velo.uiComponents.XMLManager xmlManager = (velo.uiComponents.XMLManager) mainXmlConf;
        xmlManager.saveDataByFile();

        log.debug("END: SAVE XML METHOD");
        facesMessages.add("Successfully updated system configuration");
    } catch (ConfigurationException ex) {
        facesMessages.add(FacesMessage.SEVERITY_ERROR, ex.toString());
    }
}

From source file:velo.ejb.seam.action.ResourceActionsBean.java

public void updateResourceCustomConfiguration() {
    try {/*from  w  w  w. j  a  va2s.  c o  m*/
        log.debug("START: SAVE XML METHOD");
        javax.faces.component.UIViewRoot viewRoot = javax.faces.context.FacesContext.getCurrentInstance()
                .getViewRoot();
        java.util.List<javax.faces.component.UIComponent> components = viewRoot.getChildren();

        javax.faces.component.UIComponent form = viewRoot.findComponent("xmlResourceCustomConfigurationForm");

        javax.faces.component.UIComponent mainXmlConf = form.findComponent("xmlManager");
        velo.uiComponents.XMLManager xmlManager = (velo.uiComponents.XMLManager) mainXmlConf;

        String xmlConfContent = xmlManager.saveDataByContent();
        resourceHome.getInstance().setConfiguration(xmlConfContent);

        //NPE
        /*
        if (xmlManager.getType().equalsIgnoreCase("file")) {
           xmlManager.saveDataByFile();
        }
        else if (xmlManager.getType().equalsIgnoreCase("xmlContent")) {
           xmlManager.saveDataByContent();
        }
        else {
           //TODO: Log unsupported/throw an error
        }
        */

        log.debug("END: SAVE XML METHOD");
        facesMessages.add(
                "Successfully custom configuration properties of target: #{resourceHome.instance.displayName}");
    } catch (ConfigurationException ex) {
        facesMessages.add(FacesMessage.SEVERITY_ERROR, ex.toString());
    }
}

From source file:velo.uiComponents.XMLManager.java

@Override
public void encodeBegin(FacesContext context) throws IOException {
    try {//from  w ww.j av a 2s  . c o  m
        setConfig(getConfig());
    } catch (ConfigurationException ex) {
        /*
        //ValueExpression 
        for (Object curr : getAttributes().keySet()) {
           System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!!" + curr);
        }
        */
        throw new IOException("Cannot import XML file named '" + getFilename() + "', " + ex.toString());
    }

    return;
}