Get access to endpoints of the deployed application

date
Aug 25, 2022
slug
access-to-endpoints-of-deployed-app
status
Published
tags
Bugfix
AWS
CI/CD
Docker
Jenkins
Tomcat
summary
type
Post

Background

I had my eCommerce application deployed to a Tomcat server which is on the same EC2 instance as Jenkins but in a different Docker container.
Tomcat
Tomcat

Problem

Now I want to make requests to the endpoints in Postman using the public IP addresses of the EC2 instance, but I got an HTTP 404 error.
I also got this error when I tried to get access to the application through Tomcat management page.

Solution

To solve this problem, follow the steps below:
  1. Use the correct Tomcat version
    1. The Tomcat image I used is built using the Tomcat version 10:
      We have to use Tomcat version 9.0 instead:
      Tomcat version 9.0
      Tomcat version 9.0
  1. Configure the scope of Tomcat dependency
    1. notion image
  1. Initialize the Servlet context required by Tomcat by implementing the SpringBootServletInitializer interface
    1. notion image
  1. Make a deployment again
    1. Now we can make request to the endpoints successfully.
      Create User
      Create User

References


© Foy Wan 2022 - 2025