configuration loading: use JAXB index and set classloader (useful while embedding into Netbeans and other applications) v_0
authorFrantišek Kučera <franta-hg@frantovo.cz>
Sun, 17 May 2015 13:15:21 +0200
branchv_0
changeset 193 5a18a6adf7f9
parent 192 a32bfcbdee51
child 194 629c9c7eab01
configuration loading: use JAXB index and set classloader (useful while embedding into Netbeans and other applications)
java/sql-dk/src/info/globalcode/sql/dk/configuration/Loader.java
java/sql-dk/src/info/globalcode/sql/dk/configuration/jaxb.index
--- a/java/sql-dk/src/info/globalcode/sql/dk/configuration/Loader.java	Sun May 17 00:27:56 2015 +0200
+++ b/java/sql-dk/src/info/globalcode/sql/dk/configuration/Loader.java	Sun May 17 13:15:21 2015 +0200
@@ -39,7 +39,7 @@
 
 	public Configuration loadConfiguration() throws ConfigurationException {
 		try {
-			JAXBContext jaxb = JAXBContext.newInstance(Configuration.class);
+			JAXBContext jaxb = JAXBContext.newInstance(Configuration.class.getPackage().getName(), Configuration.class.getClassLoader());
 			Unmarshaller u = jaxb.createUnmarshaller();
 			return (Configuration) u.unmarshal(Constants.CONFIG_FILE);
 		} catch (Exception e) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/java/sql-dk/src/info/globalcode/sql/dk/configuration/jaxb.index	Sun May 17 13:15:21 2015 +0200
@@ -0,0 +1,1 @@
+Configuration
\ No newline at end of file