在注入点 [[field] @Inject

Unsatisfied dependencies for type [***<T>] with qualifiers [@Default] at injection point [[field] @Inject

部署到 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]

注射

@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> {

我在提供程序中添加了一些日志记录,但我没有在 arquillian jboss 日志中看到它...

谢谢!

在@Deployment 存档中,由于某种原因,上面的ServiceProvider class 没有添加到存档中。