Skip to Content
2
Former Member
Jul 23, 2014 at 02:05 PM

ycommercewebservices and multi-tenants in 5.2 problems

836 Views

Hi, We have an addon to ycommercewebservices with some custom controllers. Also we have two tenants running one master and other is say testing.

And next we have overridden ycommercewebservices.webroot for testing tenant:

ycommercewebservices.webroot = /rest_test

It was okay with hybris 5.1. we have both /rest and /rest_test accessible roots

But with newest 5.2 version the error occures:

 SEVERE: Exception sending context initialized event to listener instance of class de.hybris.platform.spring.HybrisContextLoa
 derListener
 org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.cache.intercepto
 r.CacheInterceptor#0': Cannot resolve reference to bean 'wsCacheManager' while setting bean property 'cacheManager'; nested
 exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'wsCacheManager' defined
  in ServletContext resource [/WEB-INF/config/cache-config-spring.xml]: Cannot resolve reference to bean 'wsEhcache' while se
 tting bean property 'cacheManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creat
 ing bean with name 'wsEhcache' defined in ServletContext resource [/WEB-INF/config/cache-config-spring.xml]: Invocation of i
 nit method failed; nested exception is net.sf.ehcache.CacheException: Another CacheManager with same name 'wsCache' 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 ne
 cessary
 2. Shutdown the earlier cacheManager before creating new one with same name.
 The source of the existing CacheManager is: InputStreamConfigurationSource [stream=java.io.ByteArrayInputStream@3c1c1eb0]

If we do not override ycommercewebservices.webroot for testing tenant then error dissappears, and /rest root becomes working.

Also If in file:

hybris\bin\ext-template\ycommercewebservices\web\webroot\WEB-INF\ycommercewebservices-web-spring.xml

we remove this line:

 <import resource="config/cache-config-spring.xml"/>

then everything start working for two tenants! And no error observed.

Do you have any thoughts why it can be or have any ideas how to fix that without touching hybris internal files?