1

I am getting the below error. Can anyone pls tell me which line in the error stack defines my error ?

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

My Class is:

@Repository public class ShippingAndHandlingDaoImpl implements 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());
    }
}

}

Can someone help me resolve this ? Which line of code should i consider as an error? I am not able to crack it with the data from internet. Any hep is highly thanked

arun
  • 57
  • 7

1 Answers1

1

The root cause is in the bottom of your stack trace, it's the last part of the BeanCreationException message which states that for shippingAndHandlingServiceImpl bean there was auto-wiring problem:

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

Spring can't decide between dao.S4.Integration.dao and shippingAndHandlingDaoImpl beans as they are equivalent when auto-wiring by type. There are few ways to resolve this problem:

  1. Use @Qualifier annotation and tell Spring which bean to use
  2. Use @Primary annotation to give one of the beans precedence
  3. Remove one of these beans from the Spring context.
Karol Dowbecki
  • 43,645
  • 9
  • 78
  • 111
  • I have added the class file in the code. Can you pls let me know where to use the @qualifier annotation here ? – arun Feb 11 '19 at 14:44
  • @arun in the `ShippingAndHandlingServiceImpl` class field for `ShippingAndHandlingPricingDao` type. Please read the Spring docs on what is auto-wiring, you posted the wrong class. – Karol Dowbecki Feb 11 '19 at 14:46