BeanCreationException возникает во время развертывания проекта на сервере Jetty - PullRequest
0 голосов
/ 11 февраля 2019

Я получаю сообщение об ошибке ниже.Может кто-нибудь пожалуйста скажите мне, какая строка в стеке ошибок определяет мою ошибку?

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 голосов
/ 11 февраля 2019

Основная причина находится в нижней части трассировки стека, это последняя часть сообщения BeanCreationException, в котором говорится, что для компонента shippingAndHandlingServiceImpl возникла проблема с автоматическим подключением:

Нетопределен квалифицируемый компонент типа [com.hpe.s4.integration.dao.interfaces.ShippingAndHandlingPricingDao]: ожидается один соответствующий компонент, но найден 2: dao.S4.Integration.dao, shippingAndHandlingDaoImpl

Spring canНе следует выбирать между dao.S4.Integration.dao и shippingAndHandlingDaoImpl bean-компонентами, поскольку они эквивалентны при автоматическом подключении по типу.Есть несколько способов решения этой проблемы:

  1. Используйте @Qualifier аннотацию и сообщите Spring, какой бин использовать
  2. Использовать @Primary аннотация для предоставления приоритета одному из компонентов
  3. Удаление одного из этих компонентов из контекста Spring.
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...