I implemented login system using UserPrincipal in Tomcat. When I press wrong credentials, it correctly redirects to an error page. The problem is with correct data. Every time when I log in using correct data, I am redirected to HTTP Status 408 - Request Timeout. Terminal doesn't show any logs. None of StackOverflow solutions worked for me. What may be the reason?I completely don't know what to do. Please help me, I put a lot of effort into it and I would like to continue my work! Did I forget about something?
https://github.com/Dekrate/BlogApp.git
-- MySQL dump 10.13 Distrib 8.0.30, for Win64 (x86_64)
--
-- Host: 127.0.0.1 Database: blog
-- ------------------------------------------------------
-- Server version 8.0.30
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!50503 SET NAMES utf8mb4 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `articles`
--
DROP TABLE IF EXISTS `articles`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `articles` (
`id` int NOT NULL AUTO_INCREMENT,
`articles_category_id` int NOT NULL,
`date` datetime NOT NULL,
`title` varchar(45) COLLATE utf8mb3_polish_ci NOT NULL,
`content` varchar(15000) COLLATE utf8mb3_polish_ci NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `id_UNIQUE` (`id`),
KEY `fk_articles_articles_category_idx` (`articles_category_id`),
CONSTRAINT `fk_articles_articles_category` FOREIGN KEY (`articles_category_id`) REFERENCES `articles_categories` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_polish_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `articles`
--
LOCK TABLES `articles` WRITE;
/*!40000 ALTER TABLE `articles` DISABLE KEYS */;
INSERT INTO `articles` VALUES (1,1,'2022-09-19 15:59:15','Tytuł','Treść');
INSERT INTO `articles` VALUES (2,1,'2022-10-09 17:07:41','Tytuł2','sad ajsd jsa j ask jlk lk jlk jlk lk jlk klj j');
/*!40000 ALTER TABLE `articles` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `articles_categories`
--
DROP TABLE IF EXISTS `articles_categories`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `articles_categories` (
`id` int NOT NULL AUTO_INCREMENT,
`category_name` varchar(45) COLLATE utf8mb3_polish_ci NOT NULL,
`category_description` varchar(45) COLLATE utf8mb3_polish_ci NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `id_UNIQUE` (`id`),
UNIQUE KEY `category_name_UNIQUE` (`category_name`),
UNIQUE KEY `category_description_UNIQUE` (`category_description`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_polish_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `articles_categories`
--
LOCK TABLES `articles_categories` WRITE;
/*!40000 ALTER TABLE `articles_categories` DISABLE KEYS */;
INSERT INTO `articles_categories` VALUES (1,'Z kraju','Najnowsze wiadomości z kraju!');
INSERT INTO `articles_categories` VALUES (2,'Ze świata','Najnowsze wiadomości ze świata!');
/*!40000 ALTER TABLE `articles_categories` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `comments`
--
DROP TABLE IF EXISTS `comments`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `comments` (
`id` int NOT NULL AUTO_INCREMENT,
`articles_id` int NOT NULL,
`users_id` int NOT NULL,
`date` datetime NOT NULL,
`content` varchar(45) COLLATE utf8mb3_polish_ci NOT NULL,
PRIMARY KEY (`id`,`articles_id`),
UNIQUE KEY `id_UNIQUE` (`id`),
UNIQUE KEY `date_UNIQUE` (`date`),
KEY `fk_comments_articles1_idx` (`articles_id`),
KEY `fk_comments_users1_idx` (`users_id`),
CONSTRAINT `fk_comments_articles1` FOREIGN KEY (`articles_id`) REFERENCES `articles` (`id`),
CONSTRAINT `fk_comments_users1` FOREIGN KEY (`users_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_polish_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `comments`
--
LOCK TABLES `comments` WRITE;
/*!40000 ALTER TABLE `comments` DISABLE KEYS */;
/*!40000 ALTER TABLE `comments` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `user_role`
--
DROP TABLE IF EXISTS `user_role`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `user_role` (
`id` int NOT NULL AUTO_INCREMENT,
`username` varchar(45) COLLATE utf8mb4_polish_ci NOT NULL,
`user_role` varchar(45) COLLATE utf8mb4_polish_ci NOT NULL DEFAULT 'user',
PRIMARY KEY (`id`),
UNIQUE KEY `id_UNIQUE` (`id`),
KEY `fk_user_roles_users1_idx` (`username`),
CONSTRAINT `fk_user_roles_users1` FOREIGN KEY (`username`) REFERENCES `users` (`username`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_polish_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `user_role`
--
LOCK TABLES `user_role` WRITE;
/*!40000 ALTER TABLE `user_role` DISABLE KEYS */;
/*!40000 ALTER TABLE `user_role` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `users`
--
DROP TABLE IF EXISTS `users`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `users` (
`id` int NOT NULL AUTO_INCREMENT,
`email` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_polish_ci NOT NULL,
`username` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_polish_ci NOT NULL,
`password` varchar(45) CHARACTER SET utf8mb3 COLLATE utf8mb3_polish_ci NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `id_UNIQUE` (`id`),
UNIQUE KEY `username_UNIQUE` (`username`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_polish_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `users`
--
LOCK TABLES `users` WRITE;
/*!40000 ALTER TABLE `users` DISABLE KEYS */;
INSERT INTO `users` VALUES (1,'abc@def.pl','Login','Hasło');
INSERT INTO `users` VALUES (2,'e12e12','adwad2q','12r13r');
INSERT INTO `users` VALUES (3,'sadw','abd','22232');
INSERT INTO `users` VALUES (4,'afawf','asfdwd','afawfwg');
/*!40000 ALTER TABLE `users` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2022-11-02 23:20:02
I want the website to redirect to homepage right after logging in using correct credentials.