use of org.springframework.boot.SpringApplication in project kylo by Teradata.
the class KyloServerApplication method main.
public static void main(String[] args) {
// Configure java.util.logging for Kylo Spark Shell
SLF4JBridgeHandler.removeHandlersForRootLogger();
SLF4JBridgeHandler.install();
// Run upgrader
KyloUpgrader upgrader = new KyloUpgrader();
if (upgrader.isUpgradeRequired()) {
try {
KyloVersion currentVersion = upgrader.getCurrentVersion();
log.info("***** Upgrade required - this may take some time *****");
log.info("Beginning upgrade from version {} ...", currentVersion == null ? "unknown" : currentVersion);
upgrader.upgrade();
log.info("***** Upgrading complete *****");
} catch (Exception e) {
log.error("Error during upgrade: {}", e.getMessage());
log.error("***** Upgrading failed *****");
System.exit(1);
}
} else {
log.info("Kylo v{} is up to date. Starting the application.", KyloVersionUtil.getBuildVersion());
}
// Run services
System.setProperty(SpringApplication.BANNER_LOCATION_PROPERTY, "banner.txt");
SpringApplication application = new SpringApplication("classpath:application-context.xml");
application.addInitializers(ctx -> validateMinProfiles(ctx));
application.run(args);
}
use of org.springframework.boot.SpringApplication in project alf.io by alfio-event.
the class SpringBootLauncher method main.
/**
* Entry point for spring boot
* @param args original arguments
*/
public static void main(String[] args) {
Thread.setDefaultUncaughtExceptionHandler(new DefaultExceptionHandler());
String profiles = System.getProperty("spring.profiles.active", "");
SpringApplication application = new SpringApplication(SpringBootInitializer.class, BaseConfiguration.class, DataSourceConfiguration.class, WebSecurityConfig.class, MvcConfiguration.class);
List<String> additionalProfiles = new ArrayList<>();
additionalProfiles.add(Initializer.PROFILE_SPRING_BOOT);
if ("true".equals(System.getenv("ALFIO_LOG_STDOUT_ONLY"))) {
// -> will load application-stdout.properties on top to override the logger configuration
additionalProfiles.add("stdout");
}
if ("true".equals(System.getenv("ALFIO_DEMO_ENABLED"))) {
additionalProfiles.add(Initializer.PROFILE_DEMO);
}
application.setAdditionalProfiles(additionalProfiles.toArray(new String[0]));
ConfigurableApplicationContext applicationContext = application.run(args);
ConfigurableEnvironment environment = applicationContext.getEnvironment();
log.info("profiles: requested {}, active {}", profiles, String.join(", ", environment.getActiveProfiles()));
}
use of org.springframework.boot.SpringApplication in project sofa-ark by alipay.
the class SpringBoot2IntrospectBizEndpointOnArkDisabledTest method testIntrospectBizEndpoint.
@Test
public void testIntrospectBizEndpoint() {
SpringApplication springApplication = new SpringApplication(EmptyConfiguration.class);
ConfigurableApplicationContext applicationContext = springApplication.run(new String[] {});
Assert.assertFalse(applicationContext.containsBean("introspectBizEndpoint"));
applicationContext.close();
}
use of org.springframework.boot.SpringApplication in project sofa-ark by alipay.
the class SpringBoot2IntrospectBizEndpointOnArkEnabledTest method testDisableBizStateEndpoint.
@Test
public void testDisableBizStateEndpoint() {
Map<String, Object> properties = new HashMap<>();
properties.put("management.endpoint.bizState.enabled", "false");
SpringApplication springApplication = new SpringApplication(EmptyConfiguration.class);
springApplication.setDefaultProperties(properties);
ConfigurableApplicationContext applicationContext = springApplication.run(new String[] {});
Assert.assertFalse(applicationContext.containsBean("introspectBizEndpoint"));
applicationContext.close();
}
use of org.springframework.boot.SpringApplication in project sofa-ark by alipay.
the class BaseSpringApplication method main.
public static void main(String[] args) {
SpringApplication springApplication = new SpringApplication(BaseSpringApplication.class);
springApplication.run(args);
}
Aggregations