Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled. 2019-05-26 16:54:56.276 ERROR 8516 --- [ restartedMain] o.s.b.d.LoggingFailureAnalysisReporter : *************************** APPLICATION FAILED TO START *************************** Description: Field roomService in edu.hpu.controller.GuestController required a bean of type 'edu.hpu.service.RoomService' that could not be found. Action: Consider defining a bean of type 'edu.hpu.service.RoomService' in your configuration.
用spring boot报了这么个错,其实解决办法很简单,在edu.hpu.service.impl.RoomServiceImpl添加一个@Service注解。具体原因以后再学习,先跑起来。
上面这个是service,接下来,mapper也面临了同样的问题
Field roomMapper in edu.hpu.service.impl.RoomServiceImpl required a bean of type 'edu.hpu.mapper.RoomMapper' that could not be found. Action: Consider defining a bean of type 'edu.hpu.mapper.RoomMapper' in your configuration. Process finished with exit code 0
同样思路,在RoomMapper接口中添加@Mapper注解。