Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. 2023-05-31 10:37:32.708 [main] ERROR o.s.b.diagnostics.LoggingFailureAnalysisReporter:40 - *************************** APPLICATION FAILED TO START *************************** Description: Field orderformService in org.jeecg.modules.demo.orders.controller.OrderformController required a bean of type 'org.jeecg.modules.demo.orders.service.IOrderformService' 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 'org.jeecg.modules.demo.orders.service.IOrderformService' in your configuration.报错如何解决
时间: 2023-07-01 07:23:57 浏览: 158
详解spring applicationContext.xml 配置文件
5星 · 资源好评率100%
这个报错提示你需要在配置中定义一个类型为 'org.jeecg.modules.demo.orders.service.IOrderformService' 的 bean。可以尝试在配置文件中添加以下代码:
```
@Configuration
public class MyConfig {
@Bean
public IOrderformService orderformService() {
return new OrderformServiceImpl();
}
}
```
其中,OrderformServiceImpl 是 IOrderformService 接口的实现类,你可以根据自己的实际情况进行修改。同时,确保在 OrderformController 类中使用了 @Autowired 注解注入了 orderformService。
阅读全文