Author: tchemit Date: 2009-11-15 16:15:30 +0100 (Sun, 15 Nov 2009) New Revision: 326 Modified: wikengo_core-wikitty/wikengo_core-wikitty-jdbc-impl/src/main/java/org/sharengo/wikitty/jdbc/WikittyJDBCUtil.java Log: fix loading jdbc config for webstart Modified: wikengo_core-wikitty/wikengo_core-wikitty-jdbc-impl/src/main/java/org/sharengo/wikitty/jdbc/WikittyJDBCUtil.java =================================================================== --- wikengo_core-wikitty/wikengo_core-wikitty-jdbc-impl/src/main/java/org/sharengo/wikitty/jdbc/WikittyJDBCUtil.java 2009-11-13 18:31:28 UTC (rev 325) +++ wikengo_core-wikitty/wikengo_core-wikitty-jdbc-impl/src/main/java/org/sharengo/wikitty/jdbc/WikittyJDBCUtil.java 2009-11-15 15:15:30 UTC (rev 326) @@ -112,6 +112,10 @@ * Properties file */ protected static Properties conf = loadProperties(); + /** + * location of default config (in class-path) + */ + public static final String CONFIG_FILE = "jdbc.properties"; /** * Loads the properties in the jdbc.properties file. @@ -121,11 +125,13 @@ public static Properties loadProperties() { Properties properties = new Properties(); try { - URL url = ClassLoader.getSystemResource("jdbc.properties"); + //TC-20091115 does not work with webstart, prefer use a nearest classloader + //URL url = ClassLoader.getSystemResource("jdbc.properties"); + URL url = WikittyJDBCUtil.class.getClassLoader().getResource(CONFIG_FILE); properties.load(url.openStream()); - } catch (IOException eee) { + } catch (Exception eee) { if (log.isErrorEnabled()) { - log.error("Unable to load property file"); + log.error("Unable to load property file "+CONFIG_FILE+" for reason "+eee.getMessage(),eee); } } return properties;