Java Spring app - HTTP Status 404 – Not Found

Kozin Latif 1 Reputation point
2022-12-21T22:57:02.43+00:00

Hi!

I have created this hello world app using Java 17 with Spring web.

https://github.com/KozinLatif/demo-1
https://demo-3.azurewebsites.net/

Tried to deploy it with App Service using GitHub:
Repository: demo-1
Branch: master
provider: GitHub Actions
Runtime stack: Java
Version: Java 17

Can you please help me understand why I keep getting "HTTP Status 404 – Not Found"? The app works fine when I run it at local.

Kind regards
Kozin Latif

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,500 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. ajkuma 28,116 Reputation points Microsoft Employee
    2022-12-22T19:21:30.85+00:00

    KozinLatifAref-7783, Thanks for posting this question.

    --To begin with, you may leverage App Service diagnostics from Azure Portal> Navigate to your App Service app in the Azure Portal. (Screenshot below)
    -- In the left navigation, click on Diagnose and solve problems - Review - “Configuration and Management and “Availability and Performance” ||“Web App down” and “Web App Restarted” options.
    (screenshot below)

    --Review your POM.xml file. Validate/change the packaging type is “war” and spring-boot-starter-tomcat is set to “provided” and then test.

    Just as a sample:

    [<packaging>war</packaging>  
    ..  
    <dependency>  
        <groupId>org.springframework.boot</groupId>  
        <artifactId>spring-boot-starter-tomcat</artifactId>  
        <scope>provided</scope><!-- this line must be present-->  
    </dependency>][1]  
    

    273471-image.png ( screenshot )

    I see the following from backend logs- Please verify correctness of the URL.

    273472-image.png

    Please let us know how it goes, I'll follow-up further. Thanks for your patience and collaboration!

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.