这是我的服务:
这是我的服务实现:
@Service
public class CategoryServiceImpl implements CategoryService {
@Autowired()
private CategoryRepo categoryRepo;
}
这是输出结果
Description:
Field categoryRepo in com.example.demo.services.impl.CategoryServiceImpl required a bean of type 'com.example.demo.repositories.CategoryRepo' that could not be found.
The injection point has the following annotations:
- @org.springframework.beans.factory.annotation.Autowired(required=true)
Action:
Consider defining a bean of type 'com.example.demo.repositories.CategoryRepo' in your configuration.
1条答案
按热度按时间70gysomp1#
要将
CategoryRepo
定义为bean,它应该扩展CrudRepository