[英]Spring IoC - Dependency Injection -> NullPointerException
[英]Spring IoC: Dependency not found
这是我的代码:
@Bean("incidencies")
public Jaxb2Marshaller incidenciesMarshaller() {
Jaxb2Marshaller marshaller = new Jaxb2Marshaller();
marshaller.setContextPath("cat.gencat.catsalut.hes.visor.api.common.domain.incidencies");
return marshaller;
}
@Bean
public IncidenciesWebServiceGatewaySupport incidenciesClientConnector(
@Qualifier("incidencies") Jaxb2Marshaller marshaller,
...
我收到此错误消息:
***************************
APPLICATION FAILED TO START
***************************
Description:
Parameter 0 of method incidenciesClientConnector in cat.gencat.catsalut.hes.visor.api.common.configuration.VisorApiConfiguration required a bean of type 'org.springframework.oxm.jaxb.Jaxb2Marshaller' that could not be found.
我不太明白出了什么问题。
有任何想法吗?
你只需要一个带有Bean
的Qualifier
。
@Bean()
@Qualifier("incidencies")
public Jaxb2Marshaller incidenciesMarshaller() {
...
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.