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 1935a18a6adf7f9
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
     1.1 --- a/java/sql-dk/src/info/globalcode/sql/dk/configuration/Loader.java	Sun May 17 00:27:56 2015 +0200
     1.2 +++ b/java/sql-dk/src/info/globalcode/sql/dk/configuration/Loader.java	Sun May 17 13:15:21 2015 +0200
     1.3 @@ -39,7 +39,7 @@
     1.4  
     1.5  	public Configuration loadConfiguration() throws ConfigurationException {
     1.6  		try {
     1.7 -			JAXBContext jaxb = JAXBContext.newInstance(Configuration.class);
     1.8 +			JAXBContext jaxb = JAXBContext.newInstance(Configuration.class.getPackage().getName(), Configuration.class.getClassLoader());
     1.9  			Unmarshaller u = jaxb.createUnmarshaller();
    1.10  			return (Configuration) u.unmarshal(Constants.CONFIG_FILE);
    1.11  		} catch (Exception e) {
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/java/sql-dk/src/info/globalcode/sql/dk/configuration/jaxb.index	Sun May 17 13:15:21 2015 +0200
     2.3 @@ -0,0 +1,1 @@
     2.4 +Configuration
     2.5 \ No newline at end of file