Java Maven构建成功,但仍然未找到404错误

Java Maven构建成功,但仍然未找到404错误,java,spring,spring-boot,maven,spring-mvc,Java,Spring,Spring Boot,Maven,Spring Mvc,因此,我正在尝试执行该指南,并通过在目标选项中使用clean install执行“runas”“maven build”来安装maven项目。我想不出是什么问题。我还使用m2e插件来运行maven构建,因为我搜索了其他人的答案,人们说使用EclipseMaven命令行很糟糕 但我在broswer中发现了这个错误 HTTP状态404–未找到 类型状态报告 信息/问候语 说明源服务器找不到目标资源的当前表示形式,或者不愿意透露存在该表示形式 ApacheTomcat/9.0.31 通过以下操作,生成

因此,我正在尝试执行该指南,并通过在目标选项中使用clean install执行“runas”“maven build”来安装maven项目。我想不出是什么问题。我还使用m2e插件来运行maven构建,因为我搜索了其他人的答案,人们说使用EclipseMaven命令行很糟糕

但我在broswer中发现了这个错误

HTTP状态404–未找到 类型状态报告

信息/问候语

说明源服务器找不到目标资源的当前表示形式,或者不愿意透露存在该表示形式

ApacheTomcat/9.0.31

通过以下操作,生成成功:

我之所以将其粘贴到这里,是因为堆栈溢出将其标记为垃圾邮件,并且我再次粘贴了几行代码,因为链接未被接受:/

mockHttpServletRequest:
      HTTP Method = GET
      Request URI = /greeting
       Parameters = {}
          Headers = []
             Body = null
    Session Attrs = {}

Handler:
             Type = com.example.restservice.GreetingController
           Method = com.example.restservice.GreetingController#greeting(String)

Async:
    Async started = false
     Async result = null

Resolved Exception:
             Type = null

ModelAndView:
        View name = null
             View = null
            Model = null

FlashMap:
       Attributes = null

MockHttpServletResponse:
           Status = 200
    Error message = null
          Headers = [Content-Type:"application/json"]
     Content type = application/json
             Body = {"id":1,"content":"Hello, World!"}
    Forwarded URL = null
   Redirected URL = null
          Cookies = []

MockHttpServletRequest:
      HTTP Method = GET
      Request URI = /greeting
       Parameters = {name=[Spring Community]}
          Headers = []
             Body = null
    Session Attrs = {}

Handler:
             Type = com.example.restservice.GreetingController
           Method = com.example.restservice.GreetingController#greeting(String)

Async:
    Async started = false
     Async result = null

Resolved Exception:
             Type = null

ModelAndView:
        View name = null
             View = null
            Model = null

FlashMap:
       Attributes = null

MockHttpServletResponse:
           Status = 200
    Error message = null
          Headers = [Content-Type:"application/json"]
     Content type = application/json
             Body = {"id":2,"content":"Hello, Spring Community!"}
    Forwarded URL = null
   Redirected URL = null
          Cookies = []

除了maven build之外,运行启动应用程序的spring boot应用程序类。在项目级别的命令下运行

mvn spring-boot:run

如果您使用任何IDE,右键单击SpringBoot应用程序类并调用“运行应用程序”

这回答了你的问题吗?