fixed startup and remove maven demo profile

This commit is contained in:
anhefti 2019-12-11 14:54:55 +01:00
parent b729eae9fa
commit 325ba982eb
6 changed files with 39 additions and 43 deletions

29
pom.xml
View file

@ -27,35 +27,6 @@
Java 11 (from eclipse and command-line) and one to build still on Java 8
to support the Jenkins build on CI-Server that still no Java 11 installed -->
<profiles>
<profile>
<id>Demo</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<properties>
<java.version>1.8</java.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
</dependency>
</dependencies>
</profile>
<profile>
<id>Java 11</id>
<activation>

View file

@ -29,7 +29,7 @@ public class GuiInit implements ApplicationListener<ApplicationReadyEvent> {
INIT_LOGGER.info("----> \\__ \\| _| | _ \\ \\__ \\/ -_)| '_|\\ V // -_)| '_|");
INIT_LOGGER.info("----> |___/|___||___/ |___/\\___||_| \\_/ \\___||_| ");
INIT_LOGGER.info("---->");
INIT_LOGGER.info("----> GUI Service");
INIT_LOGGER.info("----> **** GUI Service ****");
INIT_LOGGER.info("---->");
INIT_LOGGER.info("----> GUI Service sucessfully successfully started up!");

View file

@ -143,10 +143,16 @@ class AdminUserInitializer {
private void writeAdminCredentials(final String name, final CharSequence pwd) {
WebserviceInit.INIT_LOGGER.info("---->");
WebserviceInit.INIT_LOGGER.info(
"----> ******************************************************************************************"
+ "*****************************************************************************");
WebserviceInit.INIT_LOGGER.info("----> SEB Server initial admin-account; name: {}, pwd: {}", name, pwd);
WebserviceInit.INIT_LOGGER.info("---->");
WebserviceInit.INIT_LOGGER.info(
"----> !!!! NOTE: Do not forget to login and reset the generated admin password immediately !!!!");
WebserviceInit.INIT_LOGGER.info(
"----> ******************************************************************************************"
+ "*****************************************************************************");
WebserviceInit.INIT_LOGGER.info("---->");
}

View file

@ -52,27 +52,27 @@ public class WebserviceInit implements ApplicationListener<ApplicationReadyEvent
@Override
public void onApplicationEvent(final ApplicationReadyEvent event) {
INIT_LOGGER.info("----> ___ ___ ___ ___ ");
INIT_LOGGER.info("----> / __|| __|| _ ) / __| ___ _ _ __ __ ___ _ _ ");
INIT_LOGGER.info("----> \\__ \\| _| | _ \\ \\__ \\/ -_)| '_|\\ V // -_)| '_|");
INIT_LOGGER.info("----> |___/|___||___/ |___/\\___||_| \\_/ \\___||_| ");
INIT_LOGGER.info("---->");
INIT_LOGGER.info("----> Webservice");
if (!guiProfileActive()) {
INIT_LOGGER.info("----> ___ ___ ___ ___ ");
INIT_LOGGER.info("----> / __|| __|| _ ) / __| ___ _ _ __ __ ___ _ _ ");
INIT_LOGGER.info("----> \\__ \\| _| | _ \\ \\__ \\/ -_)| '_|\\ V // -_)| '_|");
INIT_LOGGER.info("----> |___/|___||___/ |___/\\___||_| \\_/ \\___||_| ");
INIT_LOGGER.info("---->");
}
INIT_LOGGER.info("----> **** Webservice ****");
INIT_LOGGER.info("---->");
INIT_LOGGER.info("----> Starting up...");
INIT_LOGGER.info("----> ");
INIT_LOGGER.info("----> Init Databse with flyway...");
INIT_LOGGER.info("----> Init Database with flyway...");
INIT_LOGGER.info("----> TODO ");
// TODO integration of Flyway for database initialization and migration: https://flywaydb.org
// see also https://flywaydb.org/getstarted/firststeps/api
INIT_LOGGER.info("----> ");
INIT_LOGGER.info("----> Init SEB Server Administrator account if needed...");
// Create an initial admin account if requested and not already in the data-base
this.adminUserInitializer.initAdminAccount();
INIT_LOGGER.info("----> ");
INIT_LOGGER.info("----> Start Services...");
INIT_LOGGER.info("----> ");
@ -104,6 +104,9 @@ public class WebserviceInit implements ApplicationListener<ApplicationReadyEvent
INIT_LOGGER.info("---->");
INIT_LOGGER.info("----> Property Override Test: {}", this.webserviceInfo.getTestProperty());
// Create an initial admin account if requested and not already in the data-base
this.adminUserInitializer.initAdminAccount();
}
@PreDestroy
@ -112,4 +115,19 @@ public class WebserviceInit implements ApplicationListener<ApplicationReadyEvent
this.webserviceInfo.getHostAddress());
}
private boolean guiProfileActive() {
final String[] activeProfiles = this.environment.getActiveProfiles();
if (activeProfiles == null) {
return false;
}
for (int i = 0; i < activeProfiles.length; i++) {
if (activeProfiles[i] != null && activeProfiles[i].contains("gui")) {
return true;
}
}
return false;
}
}

View file

@ -75,7 +75,7 @@ class ExamSessionControlTask {
controlExamEnd(updateId);
}
@Scheduled(fixedRate = Constants.SECOND_IN_MILLIS)
@Scheduled(fixedRate = 15 * Constants.SECOND_IN_MILLIS)
public void pingEventUpdateTask() {
this.sebClientConnectionService.updatePingEvents();
}

View file

@ -67,6 +67,7 @@ spring.datasource.initialize=true
spring.datasource.initialization-mode=always
spring.datasource.url=jdbc:mariadb://${datastore.mariadb.server.address}:${datastore.mariadb.server.port}/SEBServer?useSSL=false&createDatabaseIfNotExist=true
spring.datasource.driver-class-name=org.mariadb.jdbc.Driver
spring.datasource.platform=dev
spring.datasource.hikari.initializationFailTimeout=30000
spring.datasource.hikari.connectionTimeout=30000
spring.datasource.hikari.idleTimeout=600000