Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

404 when deploying war on tomcat 10.0.22 #7

Open
zAbuQasem opened this issue Jul 20, 2022 · 5 comments
Open

404 when deploying war on tomcat 10.0.22 #7

zAbuQasem opened this issue Jul 20, 2022 · 5 comments

Comments

@zAbuQasem
Copy link

  • OS-Release:
NAME="Ubuntu"
VERSION="20.04.4 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.4 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal
  • Maven/Java Version
Apache Maven 3.8.6 (84538c9988a25aec085021c365c560670ad80f63)
Maven home: /opt/maven
Java version: 18.0.1.1, vendor: Oracle Corporation, runtime: /usr/local/jdk-18.0.1.1
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "5.4.0-122-generic", arch: "amd64", family: "unix"
  • Added a war plugin to this project pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.lms</groupId>
<artifactId>leave-management-system</artifactId>
<version>1.0</version>
<packaging>war</packaging>

<name>leave-management-system</name>
<description>Leave Management System</description>

<parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.5.7.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
</parent>

<properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <java.version>1.7</java.version>
        <start-class>com.lms.LeaveManagementSystemApplication</start-class>
</properties>

<dependencies>
        <dependency>
                <groupId>org.hibernate</groupId>
                <artifactId>hibernate-core</artifactId>
                <version>5.0.12.Final</version>
        </dependency>
        <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>
        <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-mail</artifactId>
        </dependency>
        <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-security</artifactId>
        </dependency>
        <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-thymeleaf</artifactId>
        </dependency>
        <dependency>
                <groupId>org.thymeleaf.extras</groupId>
                <artifactId>thymeleaf-extras-springsecurity4</artifactId>
        </dependency>
        <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

        <dependency>
                <groupId>org.postgresql</groupId>
                <artifactId>postgresql</artifactId>
                <scope>runtime</scope>
        </dependency>
        <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-tomcat</artifactId>
                <scope>provided</scope>
        </dependency>
        <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-test</artifactId>
                <scope>test</scope>
        </dependency>
        <dependency>
                <groupId>org.springframework.security</groupId>
                <artifactId>spring-security-test</artifactId>
                <scope>test</scope>
        </dependency>
        <dependency>
                <groupId>net.sourceforge.nekohtml</groupId>
                <artifactId>nekohtml</artifactId>
        </dependency>
        <dependency>
                <groupId>org.json</groupId>
                <artifactId>json</artifactId>
        </dependency>
</dependencies>

<build>
        <plugins>
                <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-war-plugin</artifactId>
                        <version>3.3.2</version>
                        <configuration>
                                <failOnMissingWebXml>false</failOnMissingWebXml>
                        </configuration>
                </plugin>
                <plugin>
                        <groupId>org.springframework.boot</groupId>
                        <artifactId>spring-boot-maven-plugin</artifactId>
                </plugin>
        </plugins>
</build>


</project>

My Postgres user password is similar to the one in the ./target/classes/application.properties

@BigFlyTea
Copy link

Hi, have you solved your 404 error? I meet the same problem. After mvn install the project and deploying the war file in tomcat 7, the 404 error occurs when accessing the web page.

@zAbuQasem
Copy link
Author

Yes, i remember i solved it but i don't remember how. it's been almost 2 years

@BigFlyTea
Copy link

Hi, do you remember where to set username manager@email.com and password 123456?

@BigFlyTea
Copy link

Hi, i have solved the problem. The 404 error is caused by the failing database lms creation. I create lms in psql shell with the "psql -U postgres lms < app-DB-Script.sql". It fails with not any notification.

@gstgrace
Copy link

Hi, i have solved the problem. The 404 error is caused by the failing database lms creation. I create lms in psql shell with the "psql -U postgres lms < app-DB-Script.sql". It fails with not any notification.

Hi, I got the same 404 error, but I believe I am able to create lms database since I can check its content via PostgreSQL. Any idea about how to debug?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants