java - 创建名称为“centralPagamentoPfController”的 bean 时出错:通过字段“服务”表示的依赖关系不满足;
问题描述
创建名称为“centralPagamentoPfController”的 bean 时出错:通过字段“服务”表示的依赖关系不满足;嵌套异常是 org.springframework.beans.factory.UnsatisfiedDependencyException:创建名为 'centralPagamentoPfImpl' 的 bean 时出错:通过字段 'simulaPagamentoEntryDTO' 表达的依赖关系不满足;嵌套异常是 org.springframework.beans.factory.NoSuchBeanDefinitionException:没有“br.com.itau.internet.mobile.pagamento.model.dto.PagamentoPfSimulacaoRequest”类型的合格 bean 可用:预计至少有 1 个符合自动装配候选资格的 bean。依赖注解:{@org.springframework.beans.factory.annotation.Autowired(required=true)}
@RestController
@RequestMapping("/central_pagamentos")
public class CentralPagamentoPfController extends SummerControllerBase{
@Autowired
private CentralPagamentoPfService service;
//-------PAGAMENTO------------//
@PostMapping(value = "/pagamento/simular")
public Protocol simularPagamentoPf(@RequestBody EntryProtocol entryProtocol){
return service.simularPagamento(entryProtocol, ACTION_SIMULAR_PAGAMENTO, OPKEY_SIMULAR_PAGAMENTO);
}
...................................................
public interface CentralPagamentoPfService {
Protocol simularPagamento(final EntryProtocol entryProtocol, String action, String opkey);
}
……………………………………………………………………………………………………………………………………
@Service
public class CentralPagamentoPfImpl implements CentralPagamentoPfService, EstatisticaFactory {
@Autowired
private PagamentoPfSimulacaoRequest simulaPagamentoEntryDTO;
@Override
public Protocol simularPagamento(EntryProtocol entryProtocol, String action, String opkey){
PagamentoPfSimulacaoRequest entity = entryProtocol.getBodyAs(PagamentoPfSimulacaoRequest.class);
//code
}
}
………………………………………………………………………………
public class PagamentoPfSimulacaoRequest implements Serializable{
@JsonProperty("canal_pagamento")
private CanalPagamentoDto canalPagamento;
@JsonProperty("codigo_terminal")
private String codigoTerminal;
// geter e setter
}
解决方案
推荐阅读
- visual-studio-code - VS Code 扩展列表中的扩展图标上的数字徽章是什么意思?
- java - 如何使用其片段使 RelativeLayout 可滚动?- 科特林
- r - 在使用 ggplot2 打印为条形图之前按 R 中的数字排序
- laravel-5 - yaijra 数据表中的多个数组
- android - 如何更改android studio中的默认主题?
- mongodb - 如何通过字符串输入查找集合中的项目?
- laravel - 命令线:jQuery中的poll.1000ms
- angular - 有没有办法在 Excel 阅读时将 XLSX 单元格格式更改为 Angular 中的文本?
- android-studio - Firebase 查询获取密钥
- java - 如何在 Java 中获取包含特定字符的名称?