gpt4 book ai didi

java - Jetty 服务器中项目部署期间发生 BeanCreationException

转载 作者:行者123 更新时间:2023-11-30 05:47:15 27 4
gpt4 key购买 nike

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

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

我的类(class)是:

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

}

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

最佳答案

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

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 无法在 dao.S4.Integration.daoshippingAndHandlingDaoImpl bean 之间做出决定,因为它们在按类型 Autowiring 时是等效的。有几种方法可以解决这个问题:

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

关于java - Jetty 服务器中项目部署期间发生 BeanCreationException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54632777/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com