Getting “No message available” error with Spring Boot + REST application

后端 未结 10 2464
感动是毒
感动是毒 2020-12-30 02:02

I have created demo Spring Boot project and implemented Restful services as shown here

@RestController
public class GreetingsController {
    @RequestMappin         


        
10条回答
  •  爱一瞬间的悲伤
    2020-12-30 02:26

    If you are using @SpringBootApplication alone, then make sure your rest service controller is in the same package like below -

    com.testSpring->SpringBootApplication class
    com.testSpring.controller->RestfulController classes
    com.testSpring.model->Model classes
    ..etc
    

    If you are using @ComponentScan(basePackageClasses = UserController.class), then mention specific controller class names.

提交回复
热议问题