java/sql-dk/src/info/globalcode/sql/dk/configuration/Loader.java
branchv_0
changeset 193 5a18a6adf7f9
parent 192 a32bfcbdee51
child 194 629c9c7eab01
equal deleted inserted replaced
192:a32bfcbdee51 193:5a18a6adf7f9
    37 
    37 
    38 	private static final Logger log = Logger.getLogger(Loader.class.getName());
    38 	private static final Logger log = Logger.getLogger(Loader.class.getName());
    39 
    39 
    40 	public Configuration loadConfiguration() throws ConfigurationException {
    40 	public Configuration loadConfiguration() throws ConfigurationException {
    41 		try {
    41 		try {
    42 			JAXBContext jaxb = JAXBContext.newInstance(Configuration.class);
    42 			JAXBContext jaxb = JAXBContext.newInstance(Configuration.class.getPackage().getName(), Configuration.class.getClassLoader());
    43 			Unmarshaller u = jaxb.createUnmarshaller();
    43 			Unmarshaller u = jaxb.createUnmarshaller();
    44 			return (Configuration) u.unmarshal(Constants.CONFIG_FILE);
    44 			return (Configuration) u.unmarshal(Constants.CONFIG_FILE);
    45 		} catch (Exception e) {
    45 		} catch (Exception e) {
    46 			throw new ConfigurationException("Unable to load configuration from " + Constants.CONFIG_FILE, e);
    46 			throw new ConfigurationException("Unable to load configuration from " + Constants.CONFIG_FILE, e);
    47 		}
    47 		}