1

我收到以下错误。谁能告诉我错误堆栈中的哪一行定义了我的错误?

2019-02-11 19:26:02.681 [main] ERROR o.s.web.context.ContextLoader - Context initialization failed UserName=: UserIpAddress=: AppServer=: UserSessionId=: 
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dao.QidsDAO': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.hp.om.business.myworkspace.interfaces.MyWorkspaceService com.hp.om.integration.qidsdata.QidsDAOImpl.myWorkspaceService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'myWorkspaceServiceImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.hp.om.business.oca.OcaConfigService com.hp.om.business.myworkspace.MyWorkspaceServiceImpl.ocaConfigService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ocaConfigServiceImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: public com.hp.om.business.pricing.wngq.interfaces.PricingService com.hp.om.busines.ngq.product.ProductsService.pricingservice; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pricingServiceImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.hp.om.business.pricing.validation.interfaces.NgqValidatorService com.hp.om.business.pricing.wngq.PricingServiceImpl.ngqValidatorService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ngqValidatorServiceImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.hpe.s4.integration.service.interfaces.ShippingAndHandlingService com.hp.om.business.pricing.validation.NgqValidatorServiceImpl.shippingAndHandlingService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'shippingAndHandlingServiceImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.hpe.s4.integration.dao.interfaces.ShippingAndHandlingPricingDao com.hpe.s4.integration.service.ShippingAndHandlingServiceImpl.pricingDao; nested exception is org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type [com.hpe.s4.integration.dao.interfaces.ShippingAndHandlingPricingDao] is defined: expected single matching bean but found 2: dao.S4.Integration.dao,shippingAndHandlingDaoImpl

Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.hp.om.business.myworkspace.interfaces.MyWorkspaceService com.hp.om.integration.qidsdata.QidsDAOImpl.myWorkspaceService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'myWorkspaceServiceImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.hp.om.business.oca.OcaConfigService com.hp.om.business.myworkspace.MyWorkspaceServiceImpl.ocaConfigService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ocaConfigServiceImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: public com.hp.om.business.pricing.wngq.interfaces.PricingService com.hp.om.busines.ngq.product.ProductsService.pricingservice; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pricingServiceImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.hp.om.business.pricing.validation.interfaces.NgqValidatorService com.hp.om.business.pricing.wngq.PricingServiceImpl.ngqValidatorService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ngqValidatorServiceImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.hpe.s4.integration.service.interfaces.ShippingAndHandlingService com.hp.om.business.pricing.validation.NgqValidatorServiceImpl.shippingAndHandlingService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'shippingAndHandlingServiceImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.hpe.s4.integration.dao.interfaces.ShippingAndHandlingPricingDao com.hpe.s4.integration.service.ShippingAndHandlingServiceImpl.pricingDao; nested exception is org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type [com.hpe.s4.integration.dao.interfaces.ShippingAndHandlingPricingDao] is defined: expected single matching bean but found 2: dao.S4.Integration.dao,shippingAndHandlingDaoImpl
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:508) ~[spring-beans-4.0.4.RELEASE.jar:4.0.4.RELEASE]
    at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87) ~[spring-beans-4.0.4.RELEASE.jar:4.0.4.RELEASE]
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:289) ~[spring-beans-4.0.4.RELEASE.jar:4.0.4.RELEASE]
    ... 27 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'myWorkspaceServiceImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.hp.om.business.oca.OcaConfigService com.hp.om.business.myworkspace.MyWorkspaceServiceImpl.ocaConfigService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ocaConfigServiceImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: public com.hp.om.business.pricing.wngq.interfaces.PricingService com.hp.om.busines.ngq.product.ProductsService.pricingservice; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pricingServiceImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.hp.om.business.pricing.validation.interfaces.NgqValidatorService com.hp.om.business.pricing.wngq.PricingServiceImpl.ngqValidatorService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ngqValidatorServiceImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.hpe.s4.integration.service.interfaces.ShippingAndHandlingService com.hp.om.business.pricing.validation.NgqValidatorServiceImpl.shippingAndHandlingService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'shippingAndHandlingServiceImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.hpe.s4.integration.dao.interfaces.ShippingAndHandlingPricingDao com.hpe.s4.integration.service.ShippingAndHandlingServiceImpl.pricingDao; nested exception is org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type [com.hpe.s4.integration.dao.interfaces.ShippingAndHandlingPricingDao] is defined: expected single matching bean but found 2: dao.S4.Integration.dao,shippingAndHandlingDaoImpl
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:292) ~[spring-beans-4.0.4.RELEASE.jar:4.0.4.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1185) ~[spring-beans-4.0.4.RELEASE.jar:4.0.4.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537) ~[spring-beans-4.0.4.RELEASE.jar:4.0.4.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475) ~[spring-beans-4.0.4.RELEASE.jar:4.0.4.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304) ~[spring-beans-4.0.4.RELEASE.jar:4.0.4.RELEASE]
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) ~[spring-beans-4.0.4.RELEASE.jar:4.0.4.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300) ~[spring-beans-4.0.4.RELEASE.jar:4.0.4.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195) ~[spring-beans-4.0.4.RELEASE.jar:4.0.4.RELEASE]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1017) ~[spring-beans-4.0.4.RELEASE.jar:4.0.4.RELEASE]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:960) ~[spring-beans-4.0.4.RELEASE.jar:4.0.4.RELEASE]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:858) ~[spring-beans-4.0.4.RELEASE.jar:4.0.4.RELEASE]
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:480) ~[spring-beans-4.0.4.RELEASE.jar:4.0.4.RELEASE]
    ... 29 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.hp.om.business.oca.OcaConfigService com.hp.om.business.myworkspace.MyWorkspaceServiceImpl.ocaConfigService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ocaConfigServiceImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: public com.hp.om.business.pricing.wngq.interfaces.PricingService com.hp.om.busines.ngq.product.ProductsService.pricingservice; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pricingServiceImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.hp.om.business.pricing.validation.interfaces.NgqValidatorService com.hp.om.business.pricing.wngq.PricingServiceImpl.ngqValidatorService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ngqValidatorServiceImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.hpe.s4.integration.service.interfaces.ShippingAndHandlingService com.hp.om.business.pricing.validation.NgqValidatorServiceImpl.shippingAndHandlingService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'shippingAndHandlingServiceImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.hpe.s4.integration.dao.interfaces.ShippingAndHandlingPricingDao com.hpe.s4.integration.service.ShippingAndHandlingServiceImpl.pricingDao; nested exception is org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type [com.hpe.s4.integration.dao.interfaces.ShippingAndHandlingPricingDao] is defined: expected single matching bean but found 2: dao.S4.Integration.dao,shippingAndHandlingDaoImpl

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ocaConfigServiceImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: public com.hp.om.business.pricing.wngq.interfaces.PricingService com.hp.om.busines.ngq.product.ProductsService.pricingservice; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pricingServiceImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.hp.om.business.pricing.validation.interfaces.NgqValidatorService com.hp.om.business.pricing.wngq.PricingServiceImpl.ngqValidatorService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ngqValidatorServiceImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.hpe.s4.integration.service.interfaces.ShippingAndHandlingService com.hp.om.business.pricing.validation.NgqValidatorServiceImpl.shippingAndHandlingService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'shippingAndHandlingServiceImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.hpe.s4.integration.dao.interfaces.ShippingAndHandlingPricingDao com.hpe.s4.integration.service.ShippingAndHandlingServiceImpl.pricingDao; nested exception is org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type [com.hpe.s4.integration.dao.interfaces.ShippingAndHandlingPricingDao] is defined: expected single matching bean but found 2: dao.S4.Integration.dao,shippingAndHandlingDaoImpl

Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: public com.hp.om.business.pricing.wngq.interfaces.PricingService com.hp.om.busines.ngq.product.ProductsService.pricingservice; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pricingServiceImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.hp.om.business.pricing.validation.interfaces.NgqValidatorService com.hp.om.business.pricing.wngq.PricingServiceImpl.ngqValidatorService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ngqValidatorServiceImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.hpe.s4.integration.service.interfaces.ShippingAndHandlingService com.hp.om.business.pricing.validation.NgqValidatorServiceImpl.shippingAndHandlingService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'shippingAndHandlingServiceImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.hpe.s4.integration.dao.interfaces.ShippingAndHandlingPricingDao com.hpe.s4.integration.service.ShippingAndHandlingServiceImpl.pricingDao; nested exception is org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type [com.hpe.s4.integration.dao.interfaces.ShippingAndHandlingPricingDao] is defined: expected single matching bean but found 2: dao.S4.Integration.dao,shippingAndHandlingDaoImpl
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:508) ~[spring-beans-4.0.4.RELEASE.jar:4.0.4.RELEASE]
    at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87) ~[spring-beans-4.0.4.RELEASE.jar:4.0.4.RELEASE]
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:289) ~[spring-beans-4.0.4.RELEASE.jar:4.0.4.RELEASE]
    ... 53 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pricingServiceImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.hp.om.business.pricing.validation.interfaces.NgqValidatorService com.hp.om.business.pricing.wngq.PricingServiceImpl.ngqValidatorService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ngqValidatorServiceImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.hpe.s4.integration.service.interfaces.ShippingAndHandlingService com.hp.om.business.pricing.validation.NgqValidatorServiceImpl.shippingAndHandlingService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'shippingAndHandlingServiceImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.hpe.s4.integration.dao.interfaces.ShippingAndHandlingPricingDao com.hpe.s4.integration.service.ShippingAndHandlingServiceImpl.pricingDao; nested exception is org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type [com.hpe.s4.integration.dao.interfaces.ShippingAndHandlingPricingDao] is defined: expected single matching bean but found 2: dao.S4.Integration.dao,shippingAndHandlingDaoImpl
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:292) ~[spring-beans-4.0.4.RELEASE.jar:4.0.4.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1185) ~[spring-beans-4.0.4.RELEASE.jar:4.0.4.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537) ~[spring-beans-4.0.4.RELEASE.jar:4.0.4.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475) ~[spring-beans-4.0.4.RELEASE.jar:4.0.4.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304) ~[spring-beans-4.0.4.RELEASE.jar:4.0.4.RELEASE]
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) ~[spring-beans-4.0.4.RELEASE.jar:4.0.4.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300) ~[spring-beans-4.0.4.RELEASE.jar:4.0.4.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195) ~[spring-beans-4.0.4.RELEASE.jar:4.0.4.RELEASE]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1017) ~[spring-beans-4.0.4.RELEASE.jar:4.0.4.RELEASE]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:960) ~[spring-beans-4.0.4.RELEASE.jar:4.0.4.RELEASE]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:858) ~[spring-beans-4.0.4.RELEASE.jar:4.0.4.RELEASE]
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:480) ~[spring-beans-4.0.4.RELEASE.jar:4.0.4.RELEASE]
    ... 55 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.hp.om.business.pricing.validation.interfaces.NgqValidatorService com.hp.om.business.pricing.wngq.PricingServiceImpl.ngqValidatorService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ngqValidatorServiceImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.hpe.s4.integration.service.interfaces.ShippingAndHandlingService com.hp.om.business.pricing.validation.NgqValidatorServiceImpl.shippingAndHandlingService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'shippingAndHandlingServiceImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.hpe.s4.integration.dao.interfaces.ShippingAndHandlingPricingDao com.hpe.s4.integration.service.ShippingAndHandlingServiceImpl.pricingDao; nested exception is org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type [com.hpe.s4.integration.dao.interfaces.ShippingAndHandlingPricingDao] is defined: expected single matching bean but found 2: dao.S4.Integration.dao,shippingAndHandlingDaoImpl

我的班级是:

@Repository 公共类 ShippingAndHandlingDaoImpl 实现 ShippingAndHandlingPricingDao {

private static final Q2CLogger LOG = Q2CLoggerFactory.getLogger(WatsonPricingDao.class, LoggingDomainType.OMUI);

@Value("${s4.shipping.pricing.url}")
private String endPointUrl;

private Gson gson;

public String getEndPointUrl() {
    return endPointUrl;
}

public void setEndPointUrl(String endPointUrl) {
    this.endPointUrl = endPointUrl;
}

public Gson getGson() {
    if (gson != null) {
        return gson;
    }
    return new Gson();
}

public void setGson(Gson gson) {
    this.gson = gson;
}

@Override
public ShippingAndHandlingResponse getShippingAndHandlingFee(ShippingAndHandlingRequest quoteRequest)
        throws S4IntegrationException {

    try {

        LOG.debug("Shipping and Handling - Rest Call Start");
        String truststorefilename = System.getProperty("CONFIG_DIR");
        truststorefilename += "/" + System.getProperty("ENV") + "/truststore.jks";
        LOG.debug("Shipping and Handling - Truststore File Name : " + truststorefilename);
        System.setProperty("javax.net.ssl.trustStore", truststorefilename);
        System.setProperty("javax.net.ssl.trustStorePassword", "wipro@123");

        Client restClient = Client.create();
        ClientResponse quotePricingResponse = null;
        LOG.debug("Shipping and Handling - Rest Call URL :" + getEndPointUrl());
        WebResource webResource = restClient.resource(getEndPointUrl());

        JSONObject inputHeaderDetailsForRequest = new JSONObject(gson.toJson(quoteRequest));
        quotePricingResponse = webResource.type(MediaType.APPLICATION_JSON).post(ClientResponse.class,
                inputHeaderDetailsForRequest.toString());

        if (quotePricingResponse.getStatus() != 200) {
            LOG.debug("Unable to connect to the server; responce Http Code : " + quotePricingResponse.getStatus());
            throw new S4IntegrationException(
                    "Unable to connect to the server; responce Http Code : " + quotePricingResponse.getStatus());
        } else {
            quotePricingResponse.bufferEntity();
            String strWriteQuoteResponse = quotePricingResponse.getEntity(String.class);
            LOG.debug("Shipping and Handling Response : " + strWriteQuoteResponse);
            LOG.debug("Shipping and Handling - Rest Call End");
            return gson.fromJson(strWriteQuoteResponse, ShippingAndHandlingResponse.class);
        }
    } catch (Exception e) {
        throw new S4IntegrationException("unexpected Error occur : " + e.getMessage());
    }
}

}

有人可以帮我解决这个问题吗?我应该将哪一行代码视为错误?我无法用来自互联网的数据破解它。任何 hep 都非常感谢

4

1 回答 1

1

根本原因在堆栈跟踪的底部,它是BeanCreationException消息的最后一部分,它指出对于shippingAndHandlingServiceImplbean 存在自动装配问题:

未定义 [com.hpe.s4.integration.dao.interfaces.ShippingAndHandlingPricingDao] 类型的合格 bean:预期单个匹配 bean,但找到 2:dao.S4.Integration.dao,shippingAndHandlingDaoImpl

Spring 无法在dao.S4.Integration.daoshippingAndHandlingDaoImplbean 之间做出决定,因为它们在按类型自动装配时是等价的。有几种方法可以解决这个问题:

  1. 使用@Qualifier注解并告诉 Spring 使用哪个 bean
  2. 使用@Primary注释为 bean 之一提供优先级
  3. 从 Spring 上下文中删除这些 bean 之一。
于 2019-02-11T14:33:16.537 回答