startup(properties);
Context.startup(getRuntimeProperties());
public void initialize() throws InputRequiredException, DatabaseUpdateException, URISyntaxException, IOException { Resource resource = (StringUtils.isNotBlank(dataDir)) ? new FileSystemResource(dataDir) : resourceLoader.getResource("openmrs-data"); if (resource != null) { String path = URLDecoder.decode(resource.getURL().getPath(), CharEncoding.UTF_8); logger.info(String.format("openmrs data folder is set to %s", path)); Properties properties = new Properties(); properties.setProperty(OpenmrsConstants.AUTO_UPDATE_DATABASE_RUNTIME_PROPERTY, String.valueOf(true)); properties.setProperty(OpenmrsConstants.APPLICATION_DATA_DIRECTORY_RUNTIME_PROPERTY, path); properties.setProperty(ENABLE_HIBERNATE_SECOND_LEVEL_CACHE, String.valueOf(false)); logger.info(String.format("connecting to openmrs instance at %s", url)); org.openmrs.api.context.Context.startup(url, user, password, properties); logger.info(String.format("loaded %d modules", ModuleFactory.getLoadedModules().size())); } }