GeoscienceAustralia / ga-worldwind-suite

A collection of tools created by the Geoscience Australia (GA) Movies and 3D Visualisation (M3DV) team. The tools are built around the NASA World Wind Java SDK, an open-source virtual globe toolkit.
40 stars 24 forks source link

Exception loading DefaultTheme.xml file randomly #104

Open tarunz001 opened 9 years ago

tarunz001 commented 9 years ago

public static void openDefault(ThemeOpenDelegate delegate) { URL url = ThemeOpener.class.getResource("/config/DefaultTheme.xml"); try { InputStream is = url.openStream(); Element element = XMLUtil.getElementFromSource(is);

        Theme theme = ThemeFactory.createFromXML(element, url);
        if (theme == null)
        {
            throw new Exception("Could not create theme from XML document");
        }
        //System.out.println("-theme-"+theme.getName()); // no name
    //  System.out.println(theme.getDatasets().size()+" --size ");
        delegate.opened(theme, element, url);
    }
    catch (Exception e)
    {
        e.printStackTrace();
        JOptionPane.showMessageDialog(null, "Could not open default theme: " + e.getLocalizedMessage(), "Error",
                JOptionPane.ERROR_MESSAGE);
    }
}

issue : Exception occurs and JOptionPane dialog opens with "Could not open default theme :" Importantly DefaultTheme.xml exists at that specific location too and this happens on my machine OS : Ubuntu Java : jdk1.7.21