Example usage for javax.xml.parsers FactoryConfigurationError printStackTrace

List of usage examples for javax.xml.parsers FactoryConfigurationError printStackTrace

Introduction

In this page you can find the example usage for javax.xml.parsers FactoryConfigurationError printStackTrace.

Prototype

public void printStackTrace() 

Source Link

Document

Prints this throwable and its backtrace to the standard error stream.

Usage

From source file:de.alpharogroup.duplicate.files.panels.progressbar.ImagePanelTest.java

/**
 * The main method.//from w  w w.  j a  v  a2s .c o m
 *
 * @param args the arguments
 */
public static void main(String[] args) {
    final JFrame frame = new JFrame();
    frame.addWindowListener(new CloseWindow());
    frame.setTitle("ImagePanelTest");

    ApplicationContext ctx = SpringApplicationContext.getInstance().getApplicationContext();
    Resource resource = ctx.getResource("classpath:images/EngineHierarchy.PNG");

    Resource log4jconfig = ctx.getResource("classpath:conf/log4j/log4jconfig.xml");

    try {
        DOMConfigurator.configure(log4jconfig.getURL());
    } catch (FactoryConfigurationError e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }

    File imageFile = null;
    try {
        imageFile = resource.getFile();
    } catch (IOException e1) {
        // TODO Auto-generated catch block
        e1.printStackTrace();
    }
    BufferedImage image = null;
    try {
        image = javax.imageio.ImageIO.read(imageFile);
    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }

    ImagePanel pnlIconPanel = new ImagePanel(image);
    frame.add(pnlIconPanel);
    frame.setBounds(0, 0, 534, 336);
    frame.setVisible(true);
}

From source file:de.alpharogroup.duplicate.files.desktoppane.MainApplication.java

/**
 * The main method./*from  w  w  w  .j av  a 2  s.c o  m*/
 *
 * @param args
 *            the arguments
 */
public static void main(final String[] args) {

    final ApplicationContext ctx = SpringApplicationContext.getInstance().getApplicationContext();
    final Resource resource = ctx.getResource("classpath:conf/log4j/log4jconfig.xml");

    try {
        DOMConfigurator.configure(resource.getURL());
    } catch (final FactoryConfigurationError e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (final IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }

    final MainFrame mainFrame = MainFrame.getInstance();
    final DesktopMenu menu = DesktopMenu.getInstance();
    mainFrame.setJMenuBar(menu.getMenubar());

    mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    mainFrame.setSize(ScreenSizeExtensions.getScreenWidth(), ScreenSizeExtensions.getScreenHeight());
    mainFrame.setVisible(true);
    mainFrame.getDesktopPane().getDesktopManager().activateFrame(mainFrame.getInternalFrame());
    mainFrame.getDesktopPane().getDesktopManager().maximizeFrame(mainFrame.getInternalFrame());
    mainFrame.getInternalFrame().toFront();

    // Set default look and feel...
    try {
        UIManager.setLookAndFeel(LookAndFeels.SYSTEM.getLookAndFeelName());
        SwingUtilities.updateComponentTreeUI(mainFrame);
        mainFrame.setCurrentLookAndFeels(LookAndFeels.SYSTEM);
    } catch (final ClassNotFoundException e1) {
        // TODO Auto-generated catch block
        e1.printStackTrace();
    } catch (final InstantiationException e1) {
        // TODO Auto-generated catch block
        e1.printStackTrace();
    } catch (final IllegalAccessException e1) {
        // TODO Auto-generated catch block
        e1.printStackTrace();
    } catch (final UnsupportedLookAndFeelException e1) {
        // TODO Auto-generated catch block
        e1.printStackTrace();
    }
}

From source file:de.alpharogroup.duplicate.files.spring.SpringApplicationContext.java

/**
 * Instantiates a new spring application context.
 *//*from w ww  . ja  v a2  s .c  o m*/
private SpringApplicationContext() {
    String rootContextDirectoryClassPath = "/ctx";

    String applicationContextPath = rootContextDirectoryClassPath + "/application-context.xml";

    ApplicationContext ac = new ClassPathXmlApplicationContext(applicationContextPath);

    Resource resource = ac.getResource("classpath:conf/log4j/log4jconfig.xml");

    try {
        DOMConfigurator.configure(resource.getURL());
    } catch (FactoryConfigurationError e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }

    applicationContext = ac;
}

From source file:de.alpharogroup.mystic.crypt.spring.SpringApplicationContext.java

/**
 * Instantiates a new spring application context.
 *//*from  www. ja v a2s .  c  o m*/
private SpringApplicationContext() {
    final String rootContextDirectoryClassPath = "/ctx";

    final String applicationContextPath = rootContextDirectoryClassPath + "/application-context.xml";

    final ApplicationContext ac = new ClassPathXmlApplicationContext(applicationContextPath);

    final Resource resource = ac.getResource("classpath:conf/log4j/log4jconfig.xml");

    try {
        DOMConfigurator.configure(resource.getURL());
    } catch (final FactoryConfigurationError e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (final IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }

    applicationContext = ac;
}

From source file:org.squale.jraf.bootstrap.config.AbstractProviderConfigReader.java

/**
 * Lis le fichier de configuration d'un provider
 * @param in_fileName chemin du fichier de configuration 
 * @return liste de configuration//  ww  w.ja v a2s.c om
 */
public List readConfig(InputStream in_stream) throws JrafConfigException {

    // liste de configuration
    List lc_config = new ArrayList();
    Digester lc_digester = new Digester();
    lc_digester.setEntityResolver(new DTDEntityResolver(_dtdRegistration));
    lc_digester.addRuleSet(this);
    lc_digester.push(lc_config);
    try {
        lc_digester.parse(in_stream);
    } catch (IOException ioe) {
        ioe.printStackTrace();
        throw new JrafConfigException("Impossible de lire le fichier de configuration", ioe);
    } catch (SAXException saxe) {
        saxe.printStackTrace();
        throw new JrafConfigException("Impossible de parser le fichier de configuration", saxe);
    } catch (FactoryConfigurationError e) {
        e.printStackTrace();
        throw new JrafConfigException("Impossible de charger le parser xml", e);

    } finally {
        if (in_stream != null) {
            try {
                in_stream.close();
                lc_digester.clear();
            } catch (IOException ie) {
                // nothing to do   
            }
        }
    }
    // retourne la liste de configuration
    return lc_config;
}