So i'm trying to do the https://spring.io/guides/gs/rest-service/#scratch guide and i'm installing the maven project by doing "run as" "maven build" with clean install in the goal option. I can't figure out what is the problem. I'm also using m2e plugin to run the maven build, because i searched others answers and people say that using eclipse maven command line is awful.
But i get this error in the broswer at http://localhost:8080/greeting
HTTP Status 404 – Not Found Type Status Report
Message /greeting
Description The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.
Apache Tomcat/9.0.31
The build is successfull tho:
I have pasted it here because stack overflow marks it as spam and also i pasted a few line of codes again because the link was not being accepted :/
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 = []