0
  1. 我使用 ycommercewebservices 模板创建了一个带有 ant extgen 命令的新扩展。
  2. 当我编译并启动服务器时,我看到了这个错误:

spring 抛出的错误是:

ERROR [localhost-startStop-6] (junit) [ContextLoader] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with 
name 'extendedCartsController': Injection of resource dependencies failed; nested 
exception is org.springframework.beans.factory.BeanCreationException: Error creating 
bean with name 'defaultDataMapper' defined in ServletContext resource [/WEB- 
INF/config/v2/dto-mappings-v2-spring.xml]: Cannot resolve reference to bean 
'fieldSetBuilder' while setting bean property 'fieldSetBuilder'; nested exception is 
org.springframework.beans.factory.BeanCreationException: Error creating bean with 
name 'defaultFieldSetBuilder' defined in ServletContext resource [/WEB- 
INF/config/v2/dto-level-mappings-v2-spring.xml]: Initialization of bean failed; 
nested exception is org.springframework.aop.framework.AopConfigException: Unexpected 
AOP exception; nested exception is 
org.springframework.beans.factory.BeanCreationException: Error creating bean with 
name 'org.springframework.cache.interceptor.CacheInterceptor#0': Cannot resolve 
reference to bean 'compositeWsCacheManager' while setting bean property 
'cacheManager'; nested exception is 
org.springframework.beans.factory.BeanCreationException: Error creating bean with 
name 'defaultCompositeWSCacheManager' defined in ServletContext resource [/WEB- 
INF/config/common/cache-config-spring.xml]: Cannot resolve reference to bean 
'wsCacheManagerList' while setting bean property 'cacheManagers'; nested exception is 
org.springframework.beans.factory.BeanCreationException: Error creating bean with 
name 'defaultWsCacheManagerList': Cannot resolve reference to bean 
'defaultWSCacheManager' while setting bean property 'sourceList' with key [0]; nested 
exception is org.springframework.beans.factory.BeanCreationException: Error creating 
bean with name 'defaultWSCacheManager' defined in ServletContext resource [/WEB- 
INF/config/common/cache-config-spring.xml]: Cannot resolve reference to bean 
'wsEhcache' while setting bean property 'cacheManager'; nested exception is 
org.springframework.beans.factory.BeanCreationException: Error creating bean with 
name 'defaultWSEhcache' defined in ServletContext resource [/WEB- 
INF/config/common/cache-config-spring.xml]: Invocation of init method failed; nested 
exception is net.sf.ehcache.CacheException: Another CacheManager with same name 
'wsCache_junit' already exists in the same VM. Please provide unique names for each 
CacheManager in the config or do one of following:
1. Use one of the CacheManager.create() static factory methods to reuse same 
CacheManager with same name or create one if necessary
2. Shutdown the earlier cacheManager before creating new one with same name.

我没有触及任何自定义扩展,我错过了什么吗?

4

1 回答 1

0

始终查看这些项目的最后一部分以查找原因。在您的情况下,这似乎是不言自明的:

在 ServletContext 资源 [/WEB-INF/config/common/cache-config-spring.xml] 中定义名称为“defaultWSEhcache”的 bean 创建错误:调用 init 方法失败;嵌套异常是 net.sf.ehcache.CacheException:同一个虚拟机中已经存在另一个同名 'wsCache_junit' 的 CacheManager。请为配置中的每个 CacheManager 提供唯一名称或执行以下操作之一:

  1. 使用 CacheManager.create() 静态工厂方法之一来重用具有相同名称的相同 CacheManager 或在必要时创建一个
  2. 在创建具有相同名称的新缓存管理器之前关闭早期的缓存管理器。
于 2022-01-20T08:15:22.333 回答