use of ca.uhn.fhir.context.ConfigurationException in project drug-formulary-ri by HL7-DaVinci.
the class FhirServerConfigDstu3 method entityManagerFactory.
@Override
@Bean()
public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
LocalContainerEntityManagerFactoryBean retVal = super.entityManagerFactory();
retVal.setPersistenceUnitName("HAPI_PU");
try {
retVal.setDataSource(myDataSource);
} catch (Exception e) {
throw new ConfigurationException("Could not set the data source due to a configuration issue", e);
}
retVal.setJpaProperties(HapiProperties.getJpaProperties());
return retVal;
}
use of ca.uhn.fhir.context.ConfigurationException in project drug-formulary-ri by HL7-DaVinci.
the class FhirServerConfigR4 method entityManagerFactory.
@Override
@Bean()
public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
LocalContainerEntityManagerFactoryBean retVal = super.entityManagerFactory();
retVal.setPersistenceUnitName("HAPI_PU");
try {
retVal.setDataSource(myDataSource);
} catch (Exception e) {
throw new ConfigurationException("Could not set the data source due to a configuration issue", e);
}
retVal.setJpaProperties(HapiProperties.getJpaProperties());
return retVal;
}
use of ca.uhn.fhir.context.ConfigurationException in project drug-formulary-ri by HL7-DaVinci.
the class HapiProperties method loadProperties.
@NotNull
private static Properties loadProperties() {
// Load the configurable properties file
Properties properties;
try (InputStream in = HapiProperties.class.getClassLoader().getResourceAsStream(HAPI_PROPERTIES)) {
properties = new Properties();
properties.load(in);
} catch (Exception e) {
throw new ConfigurationException("Could not load HAPI properties", e);
}
Properties overrideProps = loadOverrideProperties();
if (overrideProps != null) {
properties.putAll(overrideProps);
}
return properties;
}
use of ca.uhn.fhir.context.ConfigurationException in project drug-formulary-ri by HL7-DaVinci.
the class HapiProperties method loadOverrideProperties.
/**
* If a configuration file path is explicitly specified via
* -Dhapi.properties=<path>, the properties there will
* be used to override the entries in the default hapi.properties file
* (currently under WEB-INF/classes)
*
* @return properties loaded from the explicitly specified configuraiton file if
* there is one, or null otherwise.
*/
private static Properties loadOverrideProperties() {
String confFile = System.getProperty(HAPI_PROPERTIES);
if (confFile != null) {
try {
Properties props = new Properties();
props.load(new FileInputStream(confFile));
return props;
} catch (Exception e) {
throw new ConfigurationException("Could not load HAPI properties file: " + confFile, e);
}
}
return null;
}
use of ca.uhn.fhir.context.ConfigurationException in project drug-formulary-ri by HL7-DaVinci.
the class FhirServerConfigDstu2 method entityManagerFactory.
@Override
@Bean()
public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
LocalContainerEntityManagerFactoryBean retVal = super.entityManagerFactory();
retVal.setPersistenceUnitName("HAPI_PU");
try {
retVal.setDataSource(myDataSource);
} catch (Exception e) {
throw new ConfigurationException("Could not set the data source due to a configuration issue", e);
}
retVal.setJpaProperties(HapiProperties.getJpaProperties());
return retVal;
}
Aggregations