404 not found postman

i run my spring application and it’s showing no errors, here’s my controller

package com.testAOP.controller;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.testAOP.model.Employee;
import com.testAOP.service.EmployeeService;

@RestController
public class EmployeeController {
@Autowired
private EmployeeService employeeService;
@GetMapping("/add/employee")
public Employee addEmployee(@RequestParam("name") String name, @RequestParam("empId") String empId) {
return employeeService.createEmployee(name, empId);
}
}

and my 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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>3.2.5</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <groupId>com.example</groupId>
    <artifactId>TPSpring5</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>TPSpring5</name>
    <description>Demo project for Spring Boot</description>
    <properties>
        <java.version>17</java.version>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
        </dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
</dependency>
        <dependency>
            <groupId>com.mysql</groupId>
            <artifactId>mysql-connector-j</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

</project>

so my app is running on port 8080 , but when i enter http://localhost:8080/add/employee?name=test&empId=1 (GET) on postman , i get 404 not found {
“timestamp”: “2024-05-10T21:59:18.175+00:00”,
“status”: 404,
“error”: “Not Found”,
“path”: “/add/employee”
}

i tried checking annotations but i dont see anything wrong, and my console shows that my app is running


  .   ____          _            __ _ _
 /\ / ___'_ __ _ _(_)_ __  __ _    
( ( )___ | '_ | '_| | '_ / _` |    
 \/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |___, | / / / /
 =========|_|==============|___/=/_/_/_/
[32m :: Spring Boot :: [39m              [2m (v3.2.5)[0;39m

[2m2024-05-10T22:57:51.735+01:00[0;39m [32m INFO[0;39m [35m21860[0;39m [2m---[0;39m [2m[TPSpring5] [           main][0;39m [2m[0;39m[36mcom.example.demo.TpSpring5Application   [0;39m [2m:[0;39m Starting TpSpring5Application using Java 17.0.10 with PID 21860 (C:UsersDELLDesktopstudies 2AS4java apitp1TPSpring5targetclasses started by DELL in C:UsersDELLDesktopstudies 2AS4java apitp1TPSpring5)
[2m2024-05-10T22:57:51.737+01:00[0;39m [32m INFO[0;39m [35m21860[0;39m [2m---[0;39m [2m[TPSpring5] [           main][0;39m [2m[0;39m[36mcom.example.demo.TpSpring5Application   [0;39m [2m:[0;39m No active profile set, falling back to 1 default profile: "default"
[2m2024-05-10T22:57:52.357+01:00[0;39m [32m INFO[0;39m [35m21860[0;39m [2m---[0;39m [2m[TPSpring5] [           main][0;39m [2m[0;39m[36m.s.d.r.c.RepositoryConfigurationDelegate[0;39m [2m:[0;39m Bootstrapping Spring Data JPA repositories in DEFAULT mode.
[2m2024-05-10T22:57:52.390+01:00[0;39m [32m INFO[0;39m [35m21860[0;39m [2m---[0;39m [2m[TPSpring5] [           main][0;39m [2m[0;39m[36m.s.d.r.c.RepositoryConfigurationDelegate[0;39m [2m:[0;39m Finished Spring Data repository scanning in 25 ms. Found 0 JPA repository interfaces.
[2m2024-05-10T22:57:52.900+01:00[0;39m [32m INFO[0;39m [35m21860[0;39m [2m---[0;39m [2m[TPSpring5] [           main][0;39m [2m[0;39m[36mo.s.b.w.embedded.tomcat.TomcatWebServer [0;39m [2m:[0;39m Tomcat initialized with port 8080 (http)
[2m2024-05-10T22:57:52.925+01:00[0;39m [32m INFO[0;39m [35m21860[0;39m [2m---[0;39m [2m[TPSpring5] [           main][0;39m [2m[0;39m[36mo.apache.catalina.core.StandardService  [0;39m [2m:[0;39m Starting service [Tomcat]
[2m2024-05-10T22:57:52.925+01:00[0;39m [32m INFO[0;39m [35m21860[0;39m [2m---[0;39m [2m[TPSpring5] [           main][0;39m [2m[0;39m[36mo.apache.catalina.core.StandardEngine   [0;39m [2m:[0;39m Starting Servlet engine: [Apache Tomcat/10.1.20]
[2m2024-05-10T22:57:52.995+01:00[0;39m [32m INFO[0;39m [35m21860[0;39m [2m---[0;39m [2m[TPSpring5] [           main][0;39m [2m[0;39m[36mo.a.c.c.C.[Tomcat].[localhost].[/]      [0;39m [2m:[0;39m Initializing Spring embedded WebApplicationContext
[2m2024-05-10T22:57:52.995+01:00[0;39m [32m INFO[0;39m [35m21860[0;39m [2m---[0;39m [2m[TPSpring5] [           main][0;39m [2m[0;39m[36mw.s.c.ServletWebServerApplicationContext[0;39m [2m:[0;39m Root WebApplicationContext: initialization completed in 1202 ms
[2m2024-05-10T22:57:53.114+01:00[0;39m [32m INFO[0;39m [35m21860[0;39m [2m---[0;39m [2m[TPSpring5] [           main][0;39m [2m[0;39m[36mcom.zaxxer.hikari.HikariDataSource      [0;39m [2m:[0;39m HikariPool-1 - Starting...
[2m2024-05-10T22:57:53.325+01:00[0;39m [32m INFO[0;39m [35m21860[0;39m [2m---[0;39m [2m[TPSpring5] [           main][0;39m [2m[0;39m[36mcom.zaxxer.hikari.pool.HikariPool       [0;39m [2m:[0;39m HikariPool-1 - Added connection conn0: url=jdbc:h2:mem:39fc9a6a-c78c-45d5-853b-97c116ba1079 user=SA
[2m2024-05-10T22:57:53.327+01:00[0;39m [32m INFO[0;39m [35m21860[0;39m [2m---[0;39m [2m[TPSpring5] [           main][0;39m [2m[0;39m[36mcom.zaxxer.hikari.HikariDataSource      [0;39m [2m:[0;39m HikariPool-1 - Start completed.
[2m2024-05-10T22:57:53.372+01:00[0;39m [32m INFO[0;39m [35m21860[0;39m [2m---[0;39m [2m[TPSpring5] [           main][0;39m [2m[0;39m[36mo.hibernate.jpa.internal.util.LogHelper [0;39m [2m:[0;39m HHH000204: Processing PersistenceUnitInfo [name: default]
[2m2024-05-10T22:57:53.418+01:00[0;39m [32m INFO[0;39m [35m21860[0;39m [2m---[0;39m [2m[TPSpring5] [           main][0;39m [2m[0;39m[36morg.hibernate.Version                   [0;39m [2m:[0;39m HHH000412: Hibernate ORM core version 6.4.4.Final
[2m2024-05-10T22:57:53.454+01:00[0;39m [32m INFO[0;39m [35m21860[0;39m [2m---[0;39m [2m[TPSpring5] [           main][0;39m [2m[0;39m[36mo.h.c.internal.RegionFactoryInitiator   [0;39m [2m:[0;39m HHH000026: Second-level cache disabled
[2m2024-05-10T22:57:53.677+01:00[0;39m [32m INFO[0;39m [35m21860[0;39m [2m---[0;39m [2m[TPSpring5] [           main][0;39m [2m[0;39m[36mo.s.o.j.p.SpringPersistenceUnitInfo     [0;39m [2m:[0;39m No LoadTimeWeaver setup: ignoring JPA class transformer
[2m2024-05-10T22:57:54.010+01:00[0;39m [32m INFO[0;39m [35m21860[0;39m [2m---[0;39m [2m[TPSpring5] [           main][0;39m [2m[0;39m[36mo.h.e.t.j.p.i.JtaPlatformInitiator      [0;39m [2m:[0;39m HHH000489: No JTA platform available (set 'hibernate.transaction.jta.platform' to enable JTA platform integration)
[2m2024-05-10T22:57:54.016+01:00[0;39m [32m INFO[0;39m [35m21860[0;39m [2m---[0;39m [2m[TPSpring5] [           main][0;39m [2m[0;39m[36mj.LocalContainerEntityManagerFactoryBean[0;39m [2m:[0;39m Initialized JPA EntityManagerFactory for persistence unit 'default'
[2m2024-05-10T22:57:54.075+01:00[0;39m [33m WARN[0;39m [35m21860[0;39m [2m---[0;39m [2m[TPSpring5] [           main][0;39m [2m[0;39m[36mJpaBaseConfiguration$JpaWebConfiguration[0;39m [2m:[0;39m 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
[2m2024-05-10T22:57:54.469+01:00[0;39m [32m INFO[0;39m [35m21860[0;39m [2m---[0;39m [2m[TPSpring5] [           main][0;39m [2m[0;39m[36mo.s.b.w.embedded.tomcat.TomcatWebServer [0;39m [2m:[0;39m Tomcat started on port 8080 (http) with context path ''
[2m2024-05-10T22:57:54.482+01:00[0;39m [32m INFO[0;39m [35m21860[0;39m [2m---[0;39m [2m[TPSpring5] [           main][0;39m [2m[0;39m[36mcom.example.demo.TpSpring5Application   [0;39m [2m:[0;39m Started TpSpring5Application in 3.112 seconds (process running for 3.723)
[2m2024-05-10T22:59:10.174+01:00[0;39m [32m INFO[0;39m [35m21860[0;39m [2m---[0;39m [2m[TPSpring5] [nio-8080-exec-3][0;39m [2m[0;39m[36mo.a.c.c.C.[Tomcat].[localhost].[/]      [0;39m [2m:[0;39m Initializing Spring DispatcherServlet 'dispatcherServlet'
[2m2024-05-10T22:59:10.174+01:00[0;39m [32m INFO[0;39m [35m21860[0;39m [2m---[0;39m [2m[TPSpring5] [nio-8080-exec-3][0;39m [2m[0;39m[36mo.s.web.servlet.DispatcherServlet       [0;39m [2m:[0;39m Initializing Servlet 'dispatcherServlet'
[2m2024-05-10T22:59:10.183+01:00[0;39m [32m INFO[0;39m [35m21860[0;39m [2m---[0;39m [2m[TPSpring5] [nio-8080-exec-3][0;39m [2m[0;39m[36mo.s.web.servlet.DispatcherServlet       [0;39m [2m:[0;39m Completed initialization in 9 ms

New contributor

Mariam Takrida is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật