[英]Unsatisfied dependencies for type [***<T>] with qualifiers [@Default] at injection point [[field] @Inject
When deploying to a jboss arquilian server, I've the following issue (that I don't seem to have when I deploy my local jboss server 部署到jboss Arquilian服务器时,出现以下问题(部署本地jboss服务器时似乎没有
org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependencies for type [CarPolicyServiceWithContext] with qualifiers [@Default] at injection point [[field] @Inject com.athlon.thrift.web.utils.MSFOTContextUtils.carPolicyService] org.jboss.weld.exceptions.DeploymentException:WELD-001408类型[CarPolicyServiceWithContext]的不满意依赖项,在注入点[[field] @Inject @Inject com.athlon.thrift.web.utils.MSFOTContextUtils.carPolicyService]中带有限定符[@Default]
@ApplicationScoped
public class MSFOTContextUtils {
@Inject
Logger logger;
@Inject
CarPolicyServiceWithContext carPolicyService;
@ApplicationScoped
public class ServiceProvider {
@Inject
@Any
private Instance<CarPolicyServiceWithContext> carPolicyServices;
private static final String COUNTRY = "NL";
private static final Logger LOGGER = LoggerFactory.getLogger(ServiceProvider.class);
@Produces
public CarPolicyServiceWithContext getCarPolicyService() {
Instance<CarPolicyServiceWithContext> found = carPolicyServices.select(
new CountryQualifier(COUNTRY));
LOGGER.info("CarPolicyServiceWithContext loaded"+found.toString());
return found.get();
}
public static class CountryQualifier
extends AnnotationLiteral<Country>
implements Country {
private String value;
public CountryQualifier(String value) {
this.value = value;
}
public String value() {
return value;
}
}
}
@Country("NL")
@ApplicationScoped
public class CarPolicyNetherlandsService implements CarPolicyServiceWithContext<MSFOTContext> {
I added some logging in the provider, but I don't see it printed in the arquillian jboss logs... 我在提供程序中添加了一些日志,但是我看不到它在Arquillian jboss日志中打印...
Thanks ! 谢谢 !
在@Deployment存档中,由于某种原因,上面的ServiceProvider类未添加到存档中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.