BeanCreationException发生在Jetty服务器中的项目部署期间

时间:2019-02-11 14:30:28

标签: java spring spring-bean beancreationexception

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

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

我的班级是:

@存储库 公共类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());
    }
}

}

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

1 个答案:

答案 0 :(得分:1)

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

  

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

Spring无法在dao.S4.Integration.daoshippingAndHandlingDaoImpl bean之间进行选择,因为按类型自动装配时,它们是等效的。解决此问题的方法很少:

  1. 使用@Qualifier批注并告诉Spring使用哪个bean
  2. 使用@Primary批注赋予其中一个bean优先级
  3. 从Spring上下文中删除其中一个bean。