0
  1. I've created a new extension with ant extgen command using ycommercewebservices template.
  2. When I compile and start the server, I see this error:

The error that spring throws is:

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.

I didn't touch anything of the custom extension, am I missing something?

Nexussim Lements
  • 535
  • 1
  • 15
  • 47

1 Answers1

1

Always look at the last segment of these items to find the cause. In your case it seems fairly self-explanatory:

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.
  • But why it is happening? I didn't touch or modifiend any file of the new custom extension? – Nexussim Lements Jan 20 '22 at 08:32
  • Have you checked whether your project already has an extension based on ycommercewebservices, or is including the commercewebservices extension from the platform? – Neil Hubert-Price Jan 20 '22 at 13:39
  • the commercewebservice ootb extension is commented, however, before installing this new extension the ywebservice OCC custom extension has been removed and replaced by this one. Might this be the conflict? – Nexussim Lements Jan 20 '22 at 15:03