简体   繁体   English

对于使用 Maven 的 Spring 引导应用程序,所有页面都在 Postman 中给出 404 错误

[英]All pages are giving 404 Error in Postman for Spring Boot application using Maven

https://github.com/SREEJA-PALLA/SpringBootCoursesAPI/tree/master https://github.com/SREEJA-PALLA/SpringBootCoursesAPI/tree/master

I'm getting a 404 error in postman this is my project.我在 postman 这是我的项目中收到 404 错误。

{ "timestamp": "2021-05-18T17:46:24.979+00:00", "status": 404, "error": "Not Found", "message": "", "path": "/topics" } { “时间戳”:“2021-05-18T17:46:24.979+00:00”,“状态”:404,“错误”:“未找到”,“消息”:“”,“路径”:“/主题" }

I checked the dependencies and also tried many ways but nothing seemed to work.我检查了依赖项并尝试了很多方法,但似乎没有任何效果。 Can someone please help?有人可以帮忙吗? Thank you in advance.先感谢您。

You have annotated your main application class with您已经用

@ComponentScan({"com.delivery.request"})

But this package does not exist in your codebase.但是这个 package 在您的代码库中不存在。 So Spring does not find the Controller that you want it to find.所以 Spring 没有找到您希望它找到的 Controller。 This is in the package com.example.courseData.topic .这是在 package com.example.courseData.topic

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM