0

我有一个装有最新版本 Java (java/jdk1.7.0_25) 和 tomcat (apache-tomcat-7.0.42) 的 Linux 机器。当我部署战争时,我得到:

ERROR 2013-07-12 09:55:36,591: Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'engageOrderConfig': Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'deliveryDtoToEngageRetailTransactionDelivery': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.company.engage.adapter.converter.customer.CustomerDTOToRetailTransactionCustomerExtension com.company.engage.order.adapter.converter.DeliveryDtoToEngageRetailTransactionDelivery.customerConverter; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [com.company.engage.adapter.converter.customer.CustomerDTOToRetailTransactionCustomerExtension] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}

还有一些...

事情是在另一个 linux 机器上部署这场战争,它开始时没有问题。

我尝试了几个版本的tomcat,我更改为OpenJDK。另外,我从正在部署 jar 的 linux 框中复制没有错误的 tomcat,并且我遇到了相同的错误。

任何人都可以对此有所了解吗?

编辑:完整的堆栈跟踪

4

1 回答 1

0

将注解限定符添加到 bean 示例中的依赖项:

public interface I{

}

public class IImpl1 implements I {
}

public class IImpl2 implements I {
}

class A {
//Without qualifier the exception that you see will be thrown
@Qualifier("impl1")

@Autowired
private I i;
}
于 2015-11-04T15:30:02.053 回答