From e9e9cfca970c0d9cc1e8859bb836287dd9919ec2 Mon Sep 17 00:00:00 2001 From: Simon Date: Mon, 4 Jan 2021 02:22:00 +0100 Subject: [PATCH] Made final changes --- logs/Voting.log | 411 ++++++++++++++++++ .../controller/VotingController.java | 73 ++-- .../entities/Motto.java | 58 --- .../entities/Voter.java | 8 - .../repositories/MottoRepository.java | 14 - .../table/TableAction.java | 38 +- src/main/resources/Categories2.txt | 7 +- src/main/resources/Q2_emails.txt | 4 +- .../resources/templates/addingCandidates.html | 4 +- 9 files changed, 449 insertions(+), 168 deletions(-) delete mode 100644 src/main/java/com/github/cato447/AbizeitungVotingSystem/entities/Motto.java delete mode 100644 src/main/java/com/github/cato447/AbizeitungVotingSystem/repositories/MottoRepository.java diff --git a/logs/Voting.log b/logs/Voting.log index 0afbe0e..d31b40e 100644 --- a/logs/Voting.log +++ b/logs/Voting.log @@ -118,3 +118,414 @@ Caused by: org.hibernate.LazyInitializationException: could not initialize proxy 2021-01-04 00:10:45,404 WARN [http-nio-8000-exec-2] no code 2021-01-04 00:11:08,813 WARN [http-nio-8000-exec-3] 045081 2021-01-04 00:11:08,814 WARN [http-nio-8000-exec-3] matched +2021-01-04 00:52:46,403 INFO [restartedMain] Starting AbizeitungVotingSystemApplication on bitecoding-System-Product-Name with PID 40643 (/home/bitecoding/Code/GitHub/AbizeitungVotingSystem/target/classes started by bitecoding in /home/bitecoding/Code/GitHub/AbizeitungVotingSystem) +2021-01-04 00:52:46,407 INFO [restartedMain] No active profile set, falling back to default profiles: default +2021-01-04 00:52:46,499 INFO [restartedMain] Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable +2021-01-04 00:52:46,500 INFO [restartedMain] For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG' +2021-01-04 00:52:46,913 INFO [restartedMain] Bootstrapping Spring Data JPA repositories in DEFAULT mode. +2021-01-04 00:52:46,971 INFO [restartedMain] Finished Spring Data repository scanning in 51ms. Found 6 JPA repository interfaces. +2021-01-04 00:52:47,721 INFO [restartedMain] Tomcat initialized with port(s): 8000 (http) +2021-01-04 00:52:47,733 INFO [restartedMain] Initializing ProtocolHandler ["http-nio-8000"] +2021-01-04 00:52:47,734 INFO [restartedMain] Starting service [Tomcat] +2021-01-04 00:52:47,734 INFO [restartedMain] Starting Servlet engine: [Apache Tomcat/9.0.38] +2021-01-04 00:52:47,792 INFO [restartedMain] Initializing Spring embedded WebApplicationContext +2021-01-04 00:52:47,792 INFO [restartedMain] Root WebApplicationContext: initialization completed in 1292 ms +2021-01-04 00:52:47,989 INFO [restartedMain] HHH000204: Processing PersistenceUnitInfo [name: default] +2021-01-04 00:52:48,040 INFO [restartedMain] HHH000412: Hibernate ORM core version 5.4.21.Final +2021-01-04 00:52:48,127 INFO [restartedMain] HCANN000001: Hibernate Commons Annotations {5.1.0.Final} +2021-01-04 00:52:48,190 INFO [restartedMain] HikariPool-1 - Starting... +2021-01-04 00:52:48,549 INFO [restartedMain] HikariPool-1 - Start completed. +2021-01-04 00:52:48,581 INFO [restartedMain] HHH000400: Using dialect: org.hibernate.dialect.MySQL8Dialect +2021-01-04 00:52:49,215 INFO [restartedMain] HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform] +2021-01-04 00:52:49,224 INFO [restartedMain] Initialized JPA EntityManagerFactory for persistence unit 'default' +2021-01-04 00:52:49,241 INFO [restartedMain] LiveReload server is running on port 35729 +2021-01-04 00:52:49,654 INFO [restartedMain] Program started with arguments: votingPhase=false mottoPhase=false addingPhase=true +2021-01-04 00:52:49,884 WARN [restartedMain] spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning +2021-01-04 00:52:49,986 INFO [restartedMain] Initializing ExecutorService 'applicationTaskExecutor' +2021-01-04 00:52:50,184 INFO [restartedMain] Starting ProtocolHandler ["http-nio-8000"] +2021-01-04 00:52:50,202 INFO [restartedMain] Tomcat started on port(s): 8000 (http) with context path '' +2021-01-04 00:52:50,213 INFO [restartedMain] Started AbizeitungVotingSystemApplication in 4.194 seconds (JVM running for 4.896) +2021-01-04 00:53:17,803 INFO [http-nio-8000-exec-1] Initializing Spring DispatcherServlet 'dispatcherServlet' +2021-01-04 00:53:17,803 INFO [http-nio-8000-exec-1] Initializing Servlet 'dispatcherServlet' +2021-01-04 00:53:17,815 INFO [http-nio-8000-exec-1] Completed initialization in 12 ms +2021-01-04 00:53:17,851 WARN [http-nio-8000-exec-1] in Bounds +2021-01-04 00:53:20,237 WARN [http-nio-8000-exec-4] simon.bussmann@adolfinum.de +2021-01-04 00:53:20,252 WARN [http-nio-8000-exec-4] simon.bussmann@adolfinum.de has already submitted its candidates +2021-01-04 00:54:00,564 WARN [http-nio-8000-exec-7] in Bounds +2021-01-04 00:54:02,641 WARN [http-nio-8000-exec-10] simon.bussmann@adolfinum.de +2021-01-04 00:54:18,658 WARN [http-nio-8000-exec-2] matched +2021-01-04 00:54:50,636 INFO [SpringContextShutdownHook] Shutting down ExecutorService 'applicationTaskExecutor' +2021-01-04 00:54:50,639 INFO [SpringContextShutdownHook] Closing JPA EntityManagerFactory for persistence unit 'default' +2021-01-04 00:54:50,642 INFO [SpringContextShutdownHook] HikariPool-1 - Shutdown initiated... +2021-01-04 00:54:50,657 INFO [SpringContextShutdownHook] HikariPool-1 - Shutdown completed. +2021-01-04 00:54:52,942 INFO [restartedMain] Starting AbizeitungVotingSystemApplication on bitecoding-System-Product-Name with PID 41069 (/home/bitecoding/Code/GitHub/AbizeitungVotingSystem/target/classes started by bitecoding in /home/bitecoding/Code/GitHub/AbizeitungVotingSystem) +2021-01-04 00:54:52,946 INFO [restartedMain] No active profile set, falling back to default profiles: default +2021-01-04 00:54:53,010 INFO [restartedMain] Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable +2021-01-04 00:54:53,011 INFO [restartedMain] For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG' +2021-01-04 00:54:53,415 INFO [restartedMain] Bootstrapping Spring Data JPA repositories in DEFAULT mode. +2021-01-04 00:54:53,478 INFO [restartedMain] Finished Spring Data repository scanning in 56ms. Found 6 JPA repository interfaces. +2021-01-04 00:54:54,188 INFO [restartedMain] Tomcat initialized with port(s): 8000 (http) +2021-01-04 00:54:54,198 INFO [restartedMain] Initializing ProtocolHandler ["http-nio-8000"] +2021-01-04 00:54:54,199 INFO [restartedMain] Starting service [Tomcat] +2021-01-04 00:54:54,199 INFO [restartedMain] Starting Servlet engine: [Apache Tomcat/9.0.38] +2021-01-04 00:54:54,258 INFO [restartedMain] Initializing Spring embedded WebApplicationContext +2021-01-04 00:54:54,259 INFO [restartedMain] Root WebApplicationContext: initialization completed in 1248 ms +2021-01-04 00:54:54,462 INFO [restartedMain] HHH000204: Processing PersistenceUnitInfo [name: default] +2021-01-04 00:54:54,518 INFO [restartedMain] HHH000412: Hibernate ORM core version 5.4.21.Final +2021-01-04 00:54:54,612 INFO [restartedMain] HCANN000001: Hibernate Commons Annotations {5.1.0.Final} +2021-01-04 00:54:54,684 INFO [restartedMain] HikariPool-1 - Starting... +2021-01-04 00:54:55,051 INFO [restartedMain] HikariPool-1 - Start completed. +2021-01-04 00:54:55,082 INFO [restartedMain] HHH000400: Using dialect: org.hibernate.dialect.MySQL8Dialect +2021-01-04 00:54:55,801 INFO [restartedMain] HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform] +2021-01-04 00:54:55,811 INFO [restartedMain] Initialized JPA EntityManagerFactory for persistence unit 'default' +2021-01-04 00:54:55,829 INFO [restartedMain] LiveReload server is running on port 35729 +2021-01-04 00:54:56,282 INFO [restartedMain] Program started with arguments: votingPhase=false mottoPhase=false addingPhase=true +2021-01-04 00:54:56,535 INFO [restartedMain] Categories successfully set up +2021-01-04 00:54:56,624 WARN [restartedMain] spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning +2021-01-04 00:54:56,753 INFO [restartedMain] Initializing ExecutorService 'applicationTaskExecutor' +2021-01-04 00:54:56,967 INFO [restartedMain] Starting ProtocolHandler ["http-nio-8000"] +2021-01-04 00:54:56,984 INFO [restartedMain] Tomcat started on port(s): 8000 (http) with context path '' +2021-01-04 00:54:56,995 INFO [restartedMain] Started AbizeitungVotingSystemApplication in 4.438 seconds (JVM running for 5.061) +2021-01-04 00:55:47,131 INFO [SpringContextShutdownHook] Shutting down ExecutorService 'applicationTaskExecutor' +2021-01-04 00:55:47,134 INFO [SpringContextShutdownHook] Closing JPA EntityManagerFactory for persistence unit 'default' +2021-01-04 00:55:47,137 INFO [SpringContextShutdownHook] HikariPool-1 - Shutdown initiated... +2021-01-04 00:55:47,147 INFO [SpringContextShutdownHook] HikariPool-1 - Shutdown completed. +2021-01-04 00:55:49,350 INFO [restartedMain] Starting AbizeitungVotingSystemApplication on bitecoding-System-Product-Name with PID 41256 (/home/bitecoding/Code/GitHub/AbizeitungVotingSystem/target/classes started by bitecoding in /home/bitecoding/Code/GitHub/AbizeitungVotingSystem) +2021-01-04 00:55:49,354 INFO [restartedMain] No active profile set, falling back to default profiles: default +2021-01-04 00:55:49,431 INFO [restartedMain] Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable +2021-01-04 00:55:49,432 INFO [restartedMain] For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG' +2021-01-04 00:55:49,867 INFO [restartedMain] Bootstrapping Spring Data JPA repositories in DEFAULT mode. +2021-01-04 00:55:49,925 INFO [restartedMain] Finished Spring Data repository scanning in 52ms. Found 6 JPA repository interfaces. +2021-01-04 00:55:50,632 INFO [restartedMain] Tomcat initialized with port(s): 8000 (http) +2021-01-04 00:55:50,642 INFO [restartedMain] Initializing ProtocolHandler ["http-nio-8000"] +2021-01-04 00:55:50,643 INFO [restartedMain] Starting service [Tomcat] +2021-01-04 00:55:50,643 INFO [restartedMain] Starting Servlet engine: [Apache Tomcat/9.0.38] +2021-01-04 00:55:50,702 INFO [restartedMain] Initializing Spring embedded WebApplicationContext +2021-01-04 00:55:50,703 INFO [restartedMain] Root WebApplicationContext: initialization completed in 1271 ms +2021-01-04 00:55:50,870 INFO [restartedMain] HHH000204: Processing PersistenceUnitInfo [name: default] +2021-01-04 00:55:50,909 INFO [restartedMain] HHH000412: Hibernate ORM core version 5.4.21.Final +2021-01-04 00:55:51,000 INFO [restartedMain] HCANN000001: Hibernate Commons Annotations {5.1.0.Final} +2021-01-04 00:55:51,071 INFO [restartedMain] HikariPool-1 - Starting... +2021-01-04 00:55:51,433 INFO [restartedMain] HikariPool-1 - Start completed. +2021-01-04 00:55:51,454 INFO [restartedMain] HHH000400: Using dialect: org.hibernate.dialect.MySQL8Dialect +2021-01-04 00:55:52,136 INFO [restartedMain] HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform] +2021-01-04 00:55:52,144 INFO [restartedMain] Initialized JPA EntityManagerFactory for persistence unit 'default' +2021-01-04 00:55:52,162 INFO [restartedMain] LiveReload server is running on port 35729 +2021-01-04 00:55:52,583 INFO [restartedMain] Program started with arguments: votingPhase=false mottoPhase=false addingPhase=true +2021-01-04 00:55:52,819 INFO [restartedMain] Categories successfully set up +2021-01-04 00:55:52,924 WARN [restartedMain] spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning +2021-01-04 00:55:53,037 INFO [restartedMain] Initializing ExecutorService 'applicationTaskExecutor' +2021-01-04 00:55:53,244 INFO [restartedMain] Starting ProtocolHandler ["http-nio-8000"] +2021-01-04 00:55:53,262 INFO [restartedMain] Tomcat started on port(s): 8000 (http) with context path '' +2021-01-04 00:55:53,274 INFO [restartedMain] Started AbizeitungVotingSystemApplication in 4.304 seconds (JVM running for 4.939) +2021-01-04 00:56:06,936 INFO [http-nio-8000-exec-1] Initializing Spring DispatcherServlet 'dispatcherServlet' +2021-01-04 00:56:06,937 INFO [http-nio-8000-exec-1] Initializing Servlet 'dispatcherServlet' +2021-01-04 00:56:06,943 INFO [http-nio-8000-exec-1] Completed initialization in 6 ms +2021-01-04 00:56:06,987 WARN [http-nio-8000-exec-1] wrong +2021-01-04 00:56:27,658 WARN [http-nio-8000-exec-7] matched +2021-01-04 00:57:16,096 INFO [SpringContextShutdownHook] Shutting down ExecutorService 'applicationTaskExecutor' +2021-01-04 00:57:16,098 INFO [SpringContextShutdownHook] Closing JPA EntityManagerFactory for persistence unit 'default' +2021-01-04 00:57:16,102 INFO [SpringContextShutdownHook] HikariPool-1 - Shutdown initiated... +2021-01-04 00:57:16,118 INFO [SpringContextShutdownHook] HikariPool-1 - Shutdown completed. +2021-01-04 00:57:18,376 INFO [restartedMain] Starting AbizeitungVotingSystemApplication on bitecoding-System-Product-Name with PID 41573 (/home/bitecoding/Code/GitHub/AbizeitungVotingSystem/target/classes started by bitecoding in /home/bitecoding/Code/GitHub/AbizeitungVotingSystem) +2021-01-04 00:57:18,381 INFO [restartedMain] No active profile set, falling back to default profiles: default +2021-01-04 00:57:18,457 INFO [restartedMain] Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable +2021-01-04 00:57:18,457 INFO [restartedMain] For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG' +2021-01-04 00:57:18,888 INFO [restartedMain] Bootstrapping Spring Data JPA repositories in DEFAULT mode. +2021-01-04 00:57:18,953 INFO [restartedMain] Finished Spring Data repository scanning in 58ms. Found 6 JPA repository interfaces. +2021-01-04 00:57:19,618 INFO [restartedMain] Tomcat initialized with port(s): 8000 (http) +2021-01-04 00:57:19,627 INFO [restartedMain] Initializing ProtocolHandler ["http-nio-8000"] +2021-01-04 00:57:19,628 INFO [restartedMain] Starting service [Tomcat] +2021-01-04 00:57:19,628 INFO [restartedMain] Starting Servlet engine: [Apache Tomcat/9.0.38] +2021-01-04 00:57:19,694 INFO [restartedMain] Initializing Spring embedded WebApplicationContext +2021-01-04 00:57:19,694 INFO [restartedMain] Root WebApplicationContext: initialization completed in 1236 ms +2021-01-04 00:57:19,873 INFO [restartedMain] HHH000204: Processing PersistenceUnitInfo [name: default] +2021-01-04 00:57:19,907 INFO [restartedMain] HHH000412: Hibernate ORM core version 5.4.21.Final +2021-01-04 00:57:20,002 INFO [restartedMain] HCANN000001: Hibernate Commons Annotations {5.1.0.Final} +2021-01-04 00:57:20,083 INFO [restartedMain] HikariPool-1 - Starting... +2021-01-04 00:57:20,501 INFO [restartedMain] HikariPool-1 - Start completed. +2021-01-04 00:57:20,522 INFO [restartedMain] HHH000400: Using dialect: org.hibernate.dialect.MySQL8Dialect +2021-01-04 00:57:21,158 INFO [restartedMain] HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform] +2021-01-04 00:57:21,167 INFO [restartedMain] Initialized JPA EntityManagerFactory for persistence unit 'default' +2021-01-04 00:57:21,182 INFO [restartedMain] LiveReload server is running on port 35729 +2021-01-04 00:57:21,614 INFO [restartedMain] Program started with arguments: votingPhase=false mottoPhase=false addingPhase=true +2021-01-04 00:57:21,839 INFO [restartedMain] Categories successfully set up +2021-01-04 00:57:21,938 WARN [restartedMain] spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning +2021-01-04 00:57:22,050 INFO [restartedMain] Initializing ExecutorService 'applicationTaskExecutor' +2021-01-04 00:57:22,271 INFO [restartedMain] Starting ProtocolHandler ["http-nio-8000"] +2021-01-04 00:57:22,289 INFO [restartedMain] Tomcat started on port(s): 8000 (http) with context path '' +2021-01-04 00:57:22,303 INFO [restartedMain] Started AbizeitungVotingSystemApplication in 4.331 seconds (JVM running for 4.978) +2021-01-04 01:10:30,792 INFO [http-nio-8000-exec-1] Initializing Spring DispatcherServlet 'dispatcherServlet' +2021-01-04 01:10:30,793 INFO [http-nio-8000-exec-1] Initializing Servlet 'dispatcherServlet' +2021-01-04 01:10:30,801 INFO [http-nio-8000-exec-1] Completed initialization in 7 ms +2021-01-04 01:10:30,827 WARN [http-nio-8000-exec-1] in Bounds +2021-01-04 01:10:35,161 WARN [http-nio-8000-exec-4] simon.bussmann@adolfinum.de +2021-01-04 01:10:55,660 WARN [http-nio-8000-exec-6] matched +2021-01-04 01:11:31,032 WARN [http-nio-8000-exec-10] in Bounds +2021-01-04 01:11:44,561 WARN [http-nio-8000-exec-2] in Bounds +2021-01-04 01:12:00,937 WARN [http-nio-8000-exec-4] simon.bussmann@adolfinum.de +2021-01-04 01:45:45,703 INFO [SpringContextShutdownHook] Shutting down ExecutorService 'applicationTaskExecutor' +2021-01-04 01:45:45,707 INFO [SpringContextShutdownHook] Closing JPA EntityManagerFactory for persistence unit 'default' +2021-01-04 01:45:45,710 INFO [SpringContextShutdownHook] HikariPool-1 - Shutdown initiated... +2021-01-04 01:45:45,723 INFO [SpringContextShutdownHook] HikariPool-1 - Shutdown completed. +2021-01-04 01:45:48,882 INFO [restartedMain] Starting AbizeitungVotingSystemApplication on bitecoding-System-Product-Name with PID 69675 (/home/bitecoding/Code/GitHub/AbizeitungVotingSystem/target/classes started by bitecoding in /home/bitecoding/Code/GitHub/AbizeitungVotingSystem) +2021-01-04 01:45:48,885 INFO [restartedMain] No active profile set, falling back to default profiles: default +2021-01-04 01:45:48,946 INFO [restartedMain] Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable +2021-01-04 01:45:48,947 INFO [restartedMain] For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG' +2021-01-04 01:45:49,494 INFO [restartedMain] Bootstrapping Spring Data JPA repositories in DEFAULT mode. +2021-01-04 01:45:49,558 INFO [restartedMain] Finished Spring Data repository scanning in 57ms. Found 6 JPA repository interfaces. +2021-01-04 01:45:50,235 INFO [restartedMain] Tomcat initialized with port(s): 8000 (http) +2021-01-04 01:45:50,243 INFO [restartedMain] Initializing ProtocolHandler ["http-nio-8000"] +2021-01-04 01:45:50,244 INFO [restartedMain] Starting service [Tomcat] +2021-01-04 01:45:50,244 INFO [restartedMain] Starting Servlet engine: [Apache Tomcat/9.0.38] +2021-01-04 01:45:50,299 INFO [restartedMain] Initializing Spring embedded WebApplicationContext +2021-01-04 01:45:50,299 INFO [restartedMain] Root WebApplicationContext: initialization completed in 1352 ms +2021-01-04 01:45:50,467 INFO [restartedMain] HHH000204: Processing PersistenceUnitInfo [name: default] +2021-01-04 01:45:50,502 INFO [restartedMain] HHH000412: Hibernate ORM core version 5.4.21.Final +2021-01-04 01:45:50,593 INFO [restartedMain] HCANN000001: Hibernate Commons Annotations {5.1.0.Final} +2021-01-04 01:45:50,661 INFO [restartedMain] HikariPool-1 - Starting... +2021-01-04 01:45:51,019 INFO [restartedMain] HikariPool-1 - Start completed. +2021-01-04 01:45:51,040 INFO [restartedMain] HHH000400: Using dialect: org.hibernate.dialect.MySQL8Dialect +2021-01-04 01:45:51,637 INFO [restartedMain] HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform] +2021-01-04 01:45:51,642 INFO [restartedMain] Initialized JPA EntityManagerFactory for persistence unit 'default' +2021-01-04 01:45:51,653 INFO [restartedMain] LiveReload server is running on port 35729 +2021-01-04 01:45:52,079 INFO [restartedMain] Program started with arguments: votingPhase=false mottoPhase=false addingPhase=true +2021-01-04 01:45:52,808 INFO [restartedMain] Categories successfully set up +2021-01-04 01:45:52,872 WARN [restartedMain] spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning +2021-01-04 01:45:52,968 INFO [restartedMain] Initializing ExecutorService 'applicationTaskExecutor' +2021-01-04 01:45:53,130 INFO [restartedMain] Starting ProtocolHandler ["http-nio-8000"] +2021-01-04 01:45:53,147 INFO [restartedMain] Tomcat started on port(s): 8000 (http) with context path '' +2021-01-04 01:45:53,157 INFO [restartedMain] Started AbizeitungVotingSystemApplication in 4.628 seconds (JVM running for 5.231) +2021-01-04 01:46:12,002 INFO [http-nio-8000-exec-1] Initializing Spring DispatcherServlet 'dispatcherServlet' +2021-01-04 01:46:12,002 INFO [http-nio-8000-exec-1] Initializing Servlet 'dispatcherServlet' +2021-01-04 01:46:12,007 INFO [http-nio-8000-exec-1] Completed initialization in 5 ms +2021-01-04 01:46:12,038 WARN [http-nio-8000-exec-1] in Bounds +2021-01-04 01:46:14,776 WARN [http-nio-8000-exec-4] simon.bussmann@adolfinum.de +2021-01-04 01:46:28,201 WARN [http-nio-8000-exec-6] matched +2021-01-04 01:48:25,518 INFO [SpringContextShutdownHook] Shutting down ExecutorService 'applicationTaskExecutor' +2021-01-04 01:48:25,522 INFO [SpringContextShutdownHook] Closing JPA EntityManagerFactory for persistence unit 'default' +2021-01-04 01:48:25,525 INFO [SpringContextShutdownHook] HikariPool-1 - Shutdown initiated... +2021-01-04 01:48:25,536 INFO [SpringContextShutdownHook] HikariPool-1 - Shutdown completed. +2021-01-04 01:48:28,739 INFO [restartedMain] Starting AbizeitungVotingSystemApplication on bitecoding-System-Product-Name with PID 69907 (/home/bitecoding/Code/GitHub/AbizeitungVotingSystem/target/classes started by bitecoding in /home/bitecoding/Code/GitHub/AbizeitungVotingSystem) +2021-01-04 01:48:28,741 INFO [restartedMain] No active profile set, falling back to default profiles: default +2021-01-04 01:48:28,801 INFO [restartedMain] Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable +2021-01-04 01:48:28,802 INFO [restartedMain] For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG' +2021-01-04 01:48:29,187 INFO [restartedMain] Bootstrapping Spring Data JPA repositories in DEFAULT mode. +2021-01-04 01:48:29,239 INFO [restartedMain] Finished Spring Data repository scanning in 46ms. Found 6 JPA repository interfaces. +2021-01-04 01:48:29,874 INFO [restartedMain] Tomcat initialized with port(s): 8000 (http) +2021-01-04 01:48:29,886 INFO [restartedMain] Initializing ProtocolHandler ["http-nio-8000"] +2021-01-04 01:48:29,887 INFO [restartedMain] Starting service [Tomcat] +2021-01-04 01:48:29,888 INFO [restartedMain] Starting Servlet engine: [Apache Tomcat/9.0.38] +2021-01-04 01:48:29,950 INFO [restartedMain] Initializing Spring embedded WebApplicationContext +2021-01-04 01:48:29,951 INFO [restartedMain] Root WebApplicationContext: initialization completed in 1149 ms +2021-01-04 01:48:30,107 INFO [restartedMain] HHH000204: Processing PersistenceUnitInfo [name: default] +2021-01-04 01:48:30,143 INFO [restartedMain] HHH000412: Hibernate ORM core version 5.4.21.Final +2021-01-04 01:48:30,242 INFO [restartedMain] HCANN000001: Hibernate Commons Annotations {5.1.0.Final} +2021-01-04 01:48:30,306 INFO [restartedMain] HikariPool-1 - Starting... +2021-01-04 01:48:30,636 INFO [restartedMain] HikariPool-1 - Start completed. +2021-01-04 01:48:30,655 INFO [restartedMain] HHH000400: Using dialect: org.hibernate.dialect.MySQL8Dialect +2021-01-04 01:48:31,249 INFO [restartedMain] HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform] +2021-01-04 01:48:31,254 INFO [restartedMain] Initialized JPA EntityManagerFactory for persistence unit 'default' +2021-01-04 01:48:31,268 INFO [restartedMain] LiveReload server is running on port 35729 +2021-01-04 01:48:31,636 INFO [restartedMain] Program started with arguments: votingPhase=false mottoPhase=false addingPhase=true +2021-01-04 01:48:31,861 WARN [restartedMain] spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning +2021-01-04 01:48:31,957 INFO [restartedMain] Initializing ExecutorService 'applicationTaskExecutor' +2021-01-04 01:48:32,131 INFO [restartedMain] Starting ProtocolHandler ["http-nio-8000"] +2021-01-04 01:48:32,152 INFO [restartedMain] Tomcat started on port(s): 8000 (http) with context path '' +2021-01-04 01:48:32,162 INFO [restartedMain] Started AbizeitungVotingSystemApplication in 3.777 seconds (JVM running for 4.348) +2021-01-04 01:48:40,988 INFO [http-nio-8000-exec-1] Initializing Spring DispatcherServlet 'dispatcherServlet' +2021-01-04 01:48:40,989 INFO [http-nio-8000-exec-1] Initializing Servlet 'dispatcherServlet' +2021-01-04 01:48:40,994 INFO [http-nio-8000-exec-1] Completed initialization in 5 ms +2021-01-04 01:48:41,019 WARN [http-nio-8000-exec-1] in Bounds +2021-01-04 01:48:43,036 WARN [http-nio-8000-exec-3] simon.bussmann@adolfinum.de +2021-01-04 01:48:56,138 WARN [http-nio-8000-exec-5] matched +2021-01-04 01:50:00,090 ERROR [http-nio-8000-exec-8] Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1] with root cause +java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1 + at com.github.cato447.AbizeitungVotingSystem.controller.VotingController.candidateSaving(VotingController.java:221) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.base/java.lang.reflect.Method.invoke(Method.java:566) + at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190) + at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138) + at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:105) + at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:878) + at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:792) + at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) + at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1040) + at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943) + at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) + at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909) + at javax.servlet.http.HttpServlet.service(HttpServlet.java:652) + at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) + at javax.servlet.http.HttpServlet.service(HttpServlet.java:733) + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) + at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) + at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) + at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) + at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) + at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) + at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) + at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) + at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202) + at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97) + at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541) + at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:143) + at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) + at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78) + at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) + at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:374) + at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) + at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868) + at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1590) + at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) + at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) + at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) + at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) + at java.base/java.lang.Thread.run(Thread.java:829) +2021-01-04 01:51:39,048 INFO [SpringContextShutdownHook] Shutting down ExecutorService 'applicationTaskExecutor' +2021-01-04 01:51:39,051 INFO [SpringContextShutdownHook] Closing JPA EntityManagerFactory for persistence unit 'default' +2021-01-04 01:51:39,055 INFO [SpringContextShutdownHook] HikariPool-1 - Shutdown initiated... +2021-01-04 01:51:39,070 INFO [SpringContextShutdownHook] HikariPool-1 - Shutdown completed. +2021-01-04 01:51:42,185 INFO [restartedMain] Starting AbizeitungVotingSystemApplication on bitecoding-System-Product-Name with PID 70219 (/home/bitecoding/Code/GitHub/AbizeitungVotingSystem/target/classes started by bitecoding in /home/bitecoding/Code/GitHub/AbizeitungVotingSystem) +2021-01-04 01:51:42,188 INFO [restartedMain] No active profile set, falling back to default profiles: default +2021-01-04 01:51:42,247 INFO [restartedMain] Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable +2021-01-04 01:51:42,247 INFO [restartedMain] For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG' +2021-01-04 01:51:42,648 INFO [restartedMain] Bootstrapping Spring Data JPA repositories in DEFAULT mode. +2021-01-04 01:51:42,695 INFO [restartedMain] Finished Spring Data repository scanning in 41ms. Found 6 JPA repository interfaces. +2021-01-04 01:51:43,313 INFO [restartedMain] Tomcat initialized with port(s): 8000 (http) +2021-01-04 01:51:43,322 INFO [restartedMain] Initializing ProtocolHandler ["http-nio-8000"] +2021-01-04 01:51:43,322 INFO [restartedMain] Starting service [Tomcat] +2021-01-04 01:51:43,323 INFO [restartedMain] Starting Servlet engine: [Apache Tomcat/9.0.38] +2021-01-04 01:51:43,388 INFO [restartedMain] Initializing Spring embedded WebApplicationContext +2021-01-04 01:51:43,389 INFO [restartedMain] Root WebApplicationContext: initialization completed in 1141 ms +2021-01-04 01:51:43,554 INFO [restartedMain] HHH000204: Processing PersistenceUnitInfo [name: default] +2021-01-04 01:51:43,588 INFO [restartedMain] HHH000412: Hibernate ORM core version 5.4.21.Final +2021-01-04 01:51:43,675 INFO [restartedMain] HCANN000001: Hibernate Commons Annotations {5.1.0.Final} +2021-01-04 01:51:43,742 INFO [restartedMain] HikariPool-1 - Starting... +2021-01-04 01:51:44,116 INFO [restartedMain] HikariPool-1 - Start completed. +2021-01-04 01:51:44,136 INFO [restartedMain] HHH000400: Using dialect: org.hibernate.dialect.MySQL8Dialect +2021-01-04 01:51:44,743 INFO [restartedMain] HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform] +2021-01-04 01:51:44,750 INFO [restartedMain] Initialized JPA EntityManagerFactory for persistence unit 'default' +2021-01-04 01:51:44,761 INFO [restartedMain] LiveReload server is running on port 35729 +2021-01-04 01:51:45,215 INFO [restartedMain] Program started with arguments: votingPhase=false mottoPhase=false addingPhase=true +2021-01-04 01:51:45,448 WARN [restartedMain] spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning +2021-01-04 01:51:45,546 INFO [restartedMain] Initializing ExecutorService 'applicationTaskExecutor' +2021-01-04 01:51:45,725 INFO [restartedMain] Starting ProtocolHandler ["http-nio-8000"] +2021-01-04 01:51:45,742 INFO [restartedMain] Tomcat started on port(s): 8000 (http) with context path '' +2021-01-04 01:51:45,752 INFO [restartedMain] Started AbizeitungVotingSystemApplication in 3.915 seconds (JVM running for 4.496) +2021-01-04 01:59:41,880 INFO [SpringContextShutdownHook] Shutting down ExecutorService 'applicationTaskExecutor' +2021-01-04 01:59:41,885 INFO [SpringContextShutdownHook] Closing JPA EntityManagerFactory for persistence unit 'default' +2021-01-04 01:59:41,890 INFO [SpringContextShutdownHook] HikariPool-1 - Shutdown initiated... +2021-01-04 01:59:41,905 INFO [SpringContextShutdownHook] HikariPool-1 - Shutdown completed. +2021-01-04 01:59:45,027 INFO [restartedMain] Starting AbizeitungVotingSystemApplication on bitecoding-System-Product-Name with PID 70580 (/home/bitecoding/Code/GitHub/AbizeitungVotingSystem/target/classes started by bitecoding in /home/bitecoding/Code/GitHub/AbizeitungVotingSystem) +2021-01-04 01:59:45,030 INFO [restartedMain] No active profile set, falling back to default profiles: default +2021-01-04 01:59:45,087 INFO [restartedMain] Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable +2021-01-04 01:59:45,088 INFO [restartedMain] For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG' +2021-01-04 01:59:45,506 INFO [restartedMain] Bootstrapping Spring Data JPA repositories in DEFAULT mode. +2021-01-04 01:59:45,553 INFO [restartedMain] Finished Spring Data repository scanning in 41ms. Found 6 JPA repository interfaces. +2021-01-04 01:59:46,181 INFO [restartedMain] Tomcat initialized with port(s): 8000 (http) +2021-01-04 01:59:46,192 INFO [restartedMain] Initializing ProtocolHandler ["http-nio-8000"] +2021-01-04 01:59:46,193 INFO [restartedMain] Starting service [Tomcat] +2021-01-04 01:59:46,193 INFO [restartedMain] Starting Servlet engine: [Apache Tomcat/9.0.38] +2021-01-04 01:59:46,250 INFO [restartedMain] Initializing Spring embedded WebApplicationContext +2021-01-04 01:59:46,251 INFO [restartedMain] Root WebApplicationContext: initialization completed in 1163 ms +2021-01-04 01:59:46,413 INFO [restartedMain] HHH000204: Processing PersistenceUnitInfo [name: default] +2021-01-04 01:59:46,450 INFO [restartedMain] HHH000412: Hibernate ORM core version 5.4.21.Final +2021-01-04 01:59:46,539 INFO [restartedMain] HCANN000001: Hibernate Commons Annotations {5.1.0.Final} +2021-01-04 01:59:46,609 INFO [restartedMain] HikariPool-1 - Starting... +2021-01-04 01:59:46,960 INFO [restartedMain] HikariPool-1 - Start completed. +2021-01-04 01:59:46,987 INFO [restartedMain] HHH000400: Using dialect: org.hibernate.dialect.MySQL8Dialect +2021-01-04 01:59:47,589 INFO [restartedMain] HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform] +2021-01-04 01:59:47,597 INFO [restartedMain] Initialized JPA EntityManagerFactory for persistence unit 'default' +2021-01-04 01:59:47,609 INFO [restartedMain] LiveReload server is running on port 35729 +2021-01-04 01:59:48,005 INFO [restartedMain] Program started with arguments: votingPhase=false mottoPhase=false addingPhase=true +2021-01-04 01:59:48,237 WARN [restartedMain] spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning +2021-01-04 01:59:48,333 INFO [restartedMain] Initializing ExecutorService 'applicationTaskExecutor' +2021-01-04 01:59:48,494 INFO [restartedMain] Starting ProtocolHandler ["http-nio-8000"] +2021-01-04 01:59:48,514 INFO [restartedMain] Tomcat started on port(s): 8000 (http) with context path '' +2021-01-04 01:59:48,523 INFO [restartedMain] Started AbizeitungVotingSystemApplication in 3.849 seconds (JVM running for 4.447) +2021-01-04 01:59:58,093 INFO [http-nio-8000-exec-1] Initializing Spring DispatcherServlet 'dispatcherServlet' +2021-01-04 01:59:58,094 INFO [http-nio-8000-exec-1] Initializing Servlet 'dispatcherServlet' +2021-01-04 01:59:58,100 INFO [http-nio-8000-exec-1] Completed initialization in 6 ms +2021-01-04 01:59:58,120 WARN [http-nio-8000-exec-1] in Bounds +2021-01-04 02:00:05,646 WARN [http-nio-8000-exec-3] simon.bussmann@adolfinum.de +2021-01-04 02:00:20,714 WARN [http-nio-8000-exec-5] matched +2021-01-04 02:03:40,152 WARN [http-nio-8000-exec-1] in Bounds +2021-01-04 02:05:15,532 INFO [SpringContextShutdownHook] Shutting down ExecutorService 'applicationTaskExecutor' +2021-01-04 02:05:15,534 INFO [SpringContextShutdownHook] Closing JPA EntityManagerFactory for persistence unit 'default' +2021-01-04 02:05:15,539 INFO [SpringContextShutdownHook] HikariPool-1 - Shutdown initiated... +2021-01-04 02:05:15,551 INFO [SpringContextShutdownHook] HikariPool-1 - Shutdown completed. +2021-01-04 02:05:18,784 INFO [restartedMain] Starting AbizeitungVotingSystemApplication on bitecoding-System-Product-Name with PID 70908 (/home/bitecoding/Code/GitHub/AbizeitungVotingSystem/target/classes started by bitecoding in /home/bitecoding/Code/GitHub/AbizeitungVotingSystem) +2021-01-04 02:05:18,787 INFO [restartedMain] No active profile set, falling back to default profiles: default +2021-01-04 02:05:18,857 INFO [restartedMain] Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable +2021-01-04 02:05:18,858 INFO [restartedMain] For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG' +2021-01-04 02:05:19,291 INFO [restartedMain] Bootstrapping Spring Data JPA repositories in DEFAULT mode. +2021-01-04 02:05:19,352 INFO [restartedMain] Finished Spring Data repository scanning in 52ms. Found 6 JPA repository interfaces. +2021-01-04 02:05:20,006 INFO [restartedMain] Tomcat initialized with port(s): 8000 (http) +2021-01-04 02:05:20,016 INFO [restartedMain] Initializing ProtocolHandler ["http-nio-8000"] +2021-01-04 02:05:20,016 INFO [restartedMain] Starting service [Tomcat] +2021-01-04 02:05:20,016 INFO [restartedMain] Starting Servlet engine: [Apache Tomcat/9.0.38] +2021-01-04 02:05:20,079 INFO [restartedMain] Initializing Spring embedded WebApplicationContext +2021-01-04 02:05:20,079 INFO [restartedMain] Root WebApplicationContext: initialization completed in 1220 ms +2021-01-04 02:05:20,259 INFO [restartedMain] HHH000204: Processing PersistenceUnitInfo [name: default] +2021-01-04 02:05:20,291 INFO [restartedMain] HHH000412: Hibernate ORM core version 5.4.21.Final +2021-01-04 02:05:20,376 INFO [restartedMain] HCANN000001: Hibernate Commons Annotations {5.1.0.Final} +2021-01-04 02:05:20,440 INFO [restartedMain] HikariPool-1 - Starting... +2021-01-04 02:05:20,766 INFO [restartedMain] HikariPool-1 - Start completed. +2021-01-04 02:05:20,787 INFO [restartedMain] HHH000400: Using dialect: org.hibernate.dialect.MySQL8Dialect +2021-01-04 02:05:21,402 INFO [restartedMain] HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform] +2021-01-04 02:05:21,410 INFO [restartedMain] Initialized JPA EntityManagerFactory for persistence unit 'default' +2021-01-04 02:05:21,426 INFO [restartedMain] LiveReload server is running on port 35729 +2021-01-04 02:05:21,838 INFO [restartedMain] Program started with arguments: votingPhase=false mottoPhase=false addingPhase=true +2021-01-04 02:05:22,065 WARN [restartedMain] spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning +2021-01-04 02:05:22,161 INFO [restartedMain] Initializing ExecutorService 'applicationTaskExecutor' +2021-01-04 02:05:22,329 INFO [restartedMain] Starting ProtocolHandler ["http-nio-8000"] +2021-01-04 02:05:22,348 INFO [restartedMain] Tomcat started on port(s): 8000 (http) with context path '' +2021-01-04 02:05:22,358 INFO [restartedMain] Started AbizeitungVotingSystemApplication in 3.937 seconds (JVM running for 4.514) +2021-01-04 02:11:07,453 INFO [SpringContextShutdownHook] Shutting down ExecutorService 'applicationTaskExecutor' +2021-01-04 02:11:07,457 INFO [SpringContextShutdownHook] Closing JPA EntityManagerFactory for persistence unit 'default' +2021-01-04 02:11:07,461 INFO [SpringContextShutdownHook] HikariPool-1 - Shutdown initiated... +2021-01-04 02:11:07,473 INFO [SpringContextShutdownHook] HikariPool-1 - Shutdown completed. +2021-01-04 02:11:10,707 INFO [restartedMain] Starting AbizeitungVotingSystemApplication on bitecoding-System-Product-Name with PID 71248 (/home/bitecoding/Code/GitHub/AbizeitungVotingSystem/target/classes started by bitecoding in /home/bitecoding/Code/GitHub/AbizeitungVotingSystem) +2021-01-04 02:11:10,710 INFO [restartedMain] No active profile set, falling back to default profiles: default +2021-01-04 02:11:10,772 INFO [restartedMain] Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable +2021-01-04 02:11:10,773 INFO [restartedMain] For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG' +2021-01-04 02:11:11,169 INFO [restartedMain] Bootstrapping Spring Data JPA repositories in DEFAULT mode. +2021-01-04 02:11:11,214 INFO [restartedMain] Finished Spring Data repository scanning in 40ms. Found 5 JPA repository interfaces. +2021-01-04 02:11:11,836 INFO [restartedMain] Tomcat initialized with port(s): 8000 (http) +2021-01-04 02:11:11,845 INFO [restartedMain] Initializing ProtocolHandler ["http-nio-8000"] +2021-01-04 02:11:11,845 INFO [restartedMain] Starting service [Tomcat] +2021-01-04 02:11:11,845 INFO [restartedMain] Starting Servlet engine: [Apache Tomcat/9.0.38] +2021-01-04 02:11:11,905 INFO [restartedMain] Initializing Spring embedded WebApplicationContext +2021-01-04 02:11:11,906 INFO [restartedMain] Root WebApplicationContext: initialization completed in 1132 ms +2021-01-04 02:11:12,078 INFO [restartedMain] HHH000204: Processing PersistenceUnitInfo [name: default] +2021-01-04 02:11:12,111 INFO [restartedMain] HHH000412: Hibernate ORM core version 5.4.21.Final +2021-01-04 02:11:12,202 INFO [restartedMain] HCANN000001: Hibernate Commons Annotations {5.1.0.Final} +2021-01-04 02:11:12,274 INFO [restartedMain] HikariPool-1 - Starting... +2021-01-04 02:11:12,614 INFO [restartedMain] HikariPool-1 - Start completed. +2021-01-04 02:11:12,639 INFO [restartedMain] HHH000400: Using dialect: org.hibernate.dialect.MySQL8Dialect +2021-01-04 02:11:13,257 INFO [restartedMain] HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform] +2021-01-04 02:11:13,266 INFO [restartedMain] Initialized JPA EntityManagerFactory for persistence unit 'default' +2021-01-04 02:11:13,279 INFO [restartedMain] LiveReload server is running on port 35729 +2021-01-04 02:11:13,646 INFO [restartedMain] Program started with arguments: votingPhase=false addingPhase=true +2021-01-04 02:11:13,902 INFO [restartedMain] Voters successfully set up +2021-01-04 02:11:13,955 INFO [restartedMain] Categories successfully set up +2021-01-04 02:11:13,995 WARN [restartedMain] spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning +2021-01-04 02:11:14,092 INFO [restartedMain] Initializing ExecutorService 'applicationTaskExecutor' +2021-01-04 02:11:14,268 INFO [restartedMain] Starting ProtocolHandler ["http-nio-8000"] +2021-01-04 02:11:14,282 INFO [restartedMain] Tomcat started on port(s): 8000 (http) with context path '' +2021-01-04 02:11:14,292 INFO [restartedMain] Started AbizeitungVotingSystemApplication in 3.946 seconds (JVM running for 4.512) +2021-01-04 02:13:20,085 INFO [SpringContextShutdownHook] Shutting down ExecutorService 'applicationTaskExecutor' +2021-01-04 02:13:20,088 INFO [SpringContextShutdownHook] Closing JPA EntityManagerFactory for persistence unit 'default' +2021-01-04 02:13:20,092 INFO [SpringContextShutdownHook] HikariPool-1 - Shutdown initiated... +2021-01-04 02:13:20,107 INFO [SpringContextShutdownHook] HikariPool-1 - Shutdown completed. diff --git a/src/main/java/com/github/cato447/AbizeitungVotingSystem/controller/VotingController.java b/src/main/java/com/github/cato447/AbizeitungVotingSystem/controller/VotingController.java index c6b778f..eb13216 100644 --- a/src/main/java/com/github/cato447/AbizeitungVotingSystem/controller/VotingController.java +++ b/src/main/java/com/github/cato447/AbizeitungVotingSystem/controller/VotingController.java @@ -6,7 +6,6 @@ import com.github.cato447.AbizeitungVotingSystem.helper.RandomNumber; import com.github.cato447.AbizeitungVotingSystem.repositories.*; import com.github.cato447.AbizeitungVotingSystem.table.TableAction; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; import org.springframework.mail.SimpleMailMessage; import org.springframework.mail.javamail.JavaMailSender; import org.springframework.stereotype.Controller; @@ -26,9 +25,8 @@ import java.util.*; @Controller public class VotingController { - private boolean votingPhase = false; - private boolean mottoPhase = false; - private boolean addingPhase = false; + private boolean votingPhase; + private boolean addingPhase; private static final Logger LOGGER = LogManager.getLogger(VotingController.class); private TableAction tableAction = new TableAction(); @@ -42,9 +40,6 @@ public class VotingController { @Autowired CategoryRepository categoryRepository; - @Autowired - MottoRepository mottoRepository; - @Autowired PossibleCandidateRepository possibleCandidateRepository; @@ -57,11 +52,10 @@ public class VotingController { @PostConstruct public void init() { - mottoPhase = false; - votingPhase = true; - addingPhase = false; + votingPhase = false; + addingPhase = true; - LOGGER.info("Program started with arguments: votingPhase="+ votingPhase + " mottoPhase=" + mottoPhase + " addingPhase=" + addingPhase); + LOGGER.info("Program started with arguments: votingPhase="+ votingPhase + " addingPhase=" + addingPhase); if (voterRepository.findAll().size() == 0) { tableAction.setUpVoters(voterRepository); @@ -70,14 +64,10 @@ public class VotingController { if (categoryRepository.findAll().size() == 0) { tableAction.setUpCategories(categoryRepository); + possibleCandidateRepository.deleteAll(); LOGGER.info("Categories successfully set up"); } - if (mottoRepository.findAll().size() == 0){ - tableAction.setUpMottos(mottoRepository); - LOGGER.info("Mottos successfully set up"); - } - if (candidateRepository.findAll().size() == 0 && votingPhase == true && possibleCandidateRepository.findAll().size() != 0) { tableAction.setUpCandidates(possibleCandidateRepository, candidateRepository); LOGGER.info("Candidates successfully set up"); @@ -122,9 +112,6 @@ public class VotingController { } else if (voter.getCandidatesubmit_status() && addingPhase) { LOGGER.warn(name + " has already submitted its candidates"); return "errors/alreadyVoted.html"; - } else if (voter.getMotto_status() && mottoPhase) { - LOGGER.warn(name + " has already chose their motto"); - return "errors/alreadyVoted.html"; } else { if (authCodesRepository.findByName(name) == null) { AuthCode authCode = tableAction.generateToken(name, RandomNumber.getRandomNumberString(), authCodesRepository); @@ -165,12 +152,7 @@ public class VotingController { String tokenStatus = tableAction.checkToken(name, code, authCodesRepository); if (tokenStatus.equals("matched")) { LOGGER.warn("matched"); - if (mottoPhase) { - List mottos = mottoRepository.findAll(); - model.addAttribute("mottos", mottos); - model.addAttribute("name", name); - return "mottoVoting.html"; - } else if (addingPhase) { + if (addingPhase) { PossibleCandidateWrapper possibleCandidates = new PossibleCandidateWrapper(); List categories = categoryRepository.findAll(); for (int i = 0; i < categories.size(); i++) { @@ -204,54 +186,59 @@ public class VotingController { @RequestMapping("/saveCandidates") public String candidateSaving(@ModelAttribute PossibleCandidateWrapper possibleCandidates, @RequestParam String name) { - if (voterRepository.findByEmail(name).getVote_status()) { + if (voterRepository.findByEmail(name).getCandidatesubmit_status()) { return "errors/alreadyVoted.html"; } else { LinkedList posCandidates = possibleCandidates.getPossibleCandidates(); + LinkedList voteForPosCandidates = new LinkedList<>(); + LinkedList addToPosCandidates = new LinkedList<>(); long index = 1; for (PossibleCandidate posCandidate : posCandidates) { if (posCandidate.getName() != "") { if (possibleCandidateRepository.findByNameAndCategory(posCandidate.getName(), categoryRepository.findById(index).get()) != null) { PossibleCandidate p = possibleCandidateRepository.findByNameAndCategory(posCandidate.getName(), categoryRepository.findById(index).get()); - p.setVotes(p.getVotes() + 1); - possibleCandidateRepository.save(p); + voteForPosCandidates.add(p); } else { + if(index > 31 && posCandidate.getName().indexOf(" ") != -1){ + posCandidate.setName(posCandidate.getName().split(" ")[1]); + } PossibleCandidate possibleCandidate = new PossibleCandidate(posCandidate.getName(), categoryRepository.findById(index).get()); - possibleCandidateRepository.save(possibleCandidate); + addToPosCandidates.add(possibleCandidate); } } index++; } + for (PossibleCandidate p: voteForPosCandidates) { + p.setVotes(p.getVotes() + 1); + possibleCandidateRepository.save(p); + } + + for (PossibleCandidate p: addToPosCandidates) { + possibleCandidateRepository.save(p); + } + tableAction.updateCandidatesubmit_status(name, voterRepository); return "voteSuccessful.html"; } } - @RequestMapping("/saveMotto") - public String mottoSaving(@RequestParam String name, @RequestParam String voteValue) { - LOGGER.info(name); - if (voterRepository.findByEmail(name).getMotto_status()) { - return "errors/alreadySubmitted.html"; - } else { - tableAction.voteForMotto(voteValue, mottoRepository); - tableAction.updateMottoStatus(name, voterRepository); - LOGGER.info(name + " has choose his motto"); - } - return "voteSuccessful.html"; - } - @RequestMapping("/processVote") public String ProcessVote(@RequestParam String name, @RequestParam String voteValues) { if (voterRepository.findByEmail(name).getVote_status()) { return "errors/alreadyVoted.html"; } else { + LinkedList voteFor = new LinkedList<>(); if(!voteValues.equals("")) { String[] partVoteValues = voteValues.split(","); for (String s : partVoteValues) { - tableAction.voteForCandidate(s, candidateRepository); + voteFor.add(s); } LOGGER.info(name + " has voted!"); } + for (String s: voteFor) { + tableAction.voteForCandidate(s, candidateRepository); + } + tableAction.updateVotingStatus(name, voterRepository); return "voteSuccessful.html"; } diff --git a/src/main/java/com/github/cato447/AbizeitungVotingSystem/entities/Motto.java b/src/main/java/com/github/cato447/AbizeitungVotingSystem/entities/Motto.java deleted file mode 100644 index e3d6334..0000000 --- a/src/main/java/com/github/cato447/AbizeitungVotingSystem/entities/Motto.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.github.cato447.AbizeitungVotingSystem.entities; - -import javax.persistence.*; - -@Entity -@Table(name = "mottos") -public class Motto implements Comparable{ - - public Motto() { - super(); - } - - public Motto(String name) { - super(); - this.name = name; - this.votes = 0; - } - - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - private Long id; - private String name; - - private Integer votes; - - - public Long getId() { - return id; - } - - public String getName() { - return name; - } - - public Integer getVotes() { - return votes; - } - - public void setName(String name) { - this.name = name; - } - - public void setVotes(Integer votes) { - this.votes = votes; - } - - public void voteFor() { - this.votes += 1; - } - - @Override - public int compareTo(Motto m) { - if (getVotes() == null || m.getVotes() == null) { - return 0; - } - return m.getVotes().compareTo(getVotes()); - } -} diff --git a/src/main/java/com/github/cato447/AbizeitungVotingSystem/entities/Voter.java b/src/main/java/com/github/cato447/AbizeitungVotingSystem/entities/Voter.java index 3bbe10a..97a2c51 100644 --- a/src/main/java/com/github/cato447/AbizeitungVotingSystem/entities/Voter.java +++ b/src/main/java/com/github/cato447/AbizeitungVotingSystem/entities/Voter.java @@ -14,7 +14,6 @@ public class Voter { this.email = email; this.vote_status = false; this.candidatesubmit_status = false; - this.motto_status = false; } @Id @@ -22,7 +21,6 @@ public class Voter { private Long id; private String email; private Boolean vote_status; - private Boolean motto_status; private Boolean candidatesubmit_status; public Long getId() { @@ -41,10 +39,6 @@ public class Voter { return candidatesubmit_status; } - public Boolean getMotto_status() { - return motto_status; - } - public void vote(){ vote_status = true; } @@ -52,6 +46,4 @@ public class Voter { public void submitCandidates() { candidatesubmit_status = true; } - - public void voteMotto() { motto_status = true;} } diff --git a/src/main/java/com/github/cato447/AbizeitungVotingSystem/repositories/MottoRepository.java b/src/main/java/com/github/cato447/AbizeitungVotingSystem/repositories/MottoRepository.java deleted file mode 100644 index 0d3ecb0..0000000 --- a/src/main/java/com/github/cato447/AbizeitungVotingSystem/repositories/MottoRepository.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.github.cato447.AbizeitungVotingSystem.repositories; - -import com.github.cato447.AbizeitungVotingSystem.entities.Motto; -import org.springframework.data.jpa.repository.JpaRepository; - -import java.util.Optional; - -public interface MottoRepository extends JpaRepository { - - public Motto findByName(String name); - - Optional findById(Long id); - -} diff --git a/src/main/java/com/github/cato447/AbizeitungVotingSystem/table/TableAction.java b/src/main/java/com/github/cato447/AbizeitungVotingSystem/table/TableAction.java index 25117f8..c4bc283 100644 --- a/src/main/java/com/github/cato447/AbizeitungVotingSystem/table/TableAction.java +++ b/src/main/java/com/github/cato447/AbizeitungVotingSystem/table/TableAction.java @@ -1,16 +1,9 @@ package com.github.cato447.AbizeitungVotingSystem.table; -import com.github.cato447.AbizeitungVotingSystem.controller.VotingController; import com.github.cato447.AbizeitungVotingSystem.entities.*; import com.github.cato447.AbizeitungVotingSystem.repositories.*; -import org.aspectj.weaver.loadtime.definition.LightXMLParser; import java.io.*; -import java.lang.reflect.Array; -import java.net.JarURLConnection; -import java.net.URL; -import java.net.URLConnection; -import java.nio.Buffer; import java.util.*; public class TableAction { @@ -31,12 +24,6 @@ public class TableAction { voterRepository.save(voter); } - public void updateMottoStatus(String email, VoterRepository voterRepository){ - Voter voter = voterRepository.findByEmail(email); - voter.voteMotto(); - voterRepository.save(voter); - } - public AuthCode generateToken(String name, String code, AuthCodesRepository authCodesRepository) { AuthCode authCode = new AuthCode(name, code); try{ @@ -82,13 +69,6 @@ public class TableAction { candidateRepository.save(candidate); } - public void voteForMotto(String id, MottoRepository mottoRepository){ - long mottoID = Long.valueOf(id); - Motto motto = mottoRepository.findById(mottoID).get(); - motto.voteFor(); - mottoRepository.save(motto); - } - public void setUpVoters(VoterRepository voterRepository){ try (InputStream inputStream = getClass().getResourceAsStream("/Q2_emails.txt"); BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream))) { @@ -142,7 +122,7 @@ public class TableAction { } public void setUpCategories(CategoryRepository categoryRepository){ - try (InputStream inputStream = getClass().getResourceAsStream("/Categories.txt"); + try (InputStream inputStream = getClass().getResourceAsStream("/Categories2.txt"); BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream))) { String line = ""; ArrayList categories = new ArrayList(); @@ -156,20 +136,4 @@ public class TableAction { e.printStackTrace(); } } - - public void setUpMottos(MottoRepository mottoRepository){ - try (InputStream inputStream = getClass().getResourceAsStream("/Mottos.txt"); - BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream))) { - String line = ""; - ArrayList mottos = new ArrayList<>(); - while ((line = reader.readLine())!= null){ - String name = line; - Motto motto = new Motto(name); - mottos.add(motto); - } - mottoRepository.saveAll(mottos); - } catch (IOException e) { - e.printStackTrace(); - } - } } diff --git a/src/main/resources/Categories2.txt b/src/main/resources/Categories2.txt index 51986db..204a4a2 100644 --- a/src/main/resources/Categories2.txt +++ b/src/main/resources/Categories2.txt @@ -10,7 +10,7 @@ Ehrgeizig, ehrgeiziger, ... Miss Make-Up Meiste Punkte in Flensburg Im Bundestag -Leber als Bimsstein +Bimsstein als Leber Bester Schwiegersohn Beste Schwiegertochter Lebt im Fitnessstudio @@ -47,7 +47,4 @@ Unterrichtet auch, wenn die Schule brennt Ist immer da Lebt in der Schule Musste einen Wald für Arbeitsblätter roden lassen -Top gestylt - - - +Top gestylt \ No newline at end of file diff --git a/src/main/resources/Q2_emails.txt b/src/main/resources/Q2_emails.txt index 57e2756..25d79ef 100644 --- a/src/main/resources/Q2_emails.txt +++ b/src/main/resources/Q2_emails.txt @@ -158,4 +158,6 @@ niklas.klaffki@adolfinum.de alessio.padovano@adolfinum.de jonas.breder@adolfinum.de ben.maas@adolfinum.de -mina.ercan@adolfinum.de \ No newline at end of file +mina.ercan@adolfinum.de +maya.springstein@adolfinum.de +can.patir@adolfinum.de \ No newline at end of file diff --git a/src/main/resources/templates/addingCandidates.html b/src/main/resources/templates/addingCandidates.html index 7d0c149..908566b 100644 --- a/src/main/resources/templates/addingCandidates.html +++ b/src/main/resources/templates/addingCandidates.html @@ -42,10 +42,10 @@
-
+

Lehrer

-
+

Schüler