cancel
Showing results for 
Search instead for 
Did you mean: 

No Scope registered for scope 'tenant'

Former Member
0 Kudos

I am working on hybris migration from 4.5.15 to 5.6 As we know tenant scope has been deprecated now. So I am following this article mentioned in hyvris wiki. https://wiki.hybris.com/display/release5/Spring+Framework+in+the+hybris+Commerce+Suite#SpringFramewo...

But now I am getting this error related to tenant scope on load of webapplication.

 enter code here [hybrisHTTP32] [LCHandlerExceptionResolver] Unexpected error [GEX15850CAA143]: 
 java.lang.IllegalStateException: No Scope registered for scope 'tenant'
     at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:334)
     at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
     at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:956)
     at org.springframework.web.servlet.handler.AbstractUrlHandlerMapping.lookupHandler(AbstractUrlHandlerMapping.java:249

This error comes after removing this code from spring xml.

     <bean class="org.springframework.beans.factory.config.CustomScopeConfigurer">
         <property name="scopes">
             <map>
                 <entry key="tenant" value="de.hybris.platform.spring.TenantScope"/>
             </map>
         </property>
     </bean>

If I include above xml configuration then following error come

 ERROR [hybrisHTTP25] [LCHandlerExceptionResolver] Unexpected error [GEX15850DDE8D7]: 
 java.lang.UnsupportedOperationException
     at de.hybris.platform.spring.TenantScope.get(TenantScope.java:51)
     at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:337)
     at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
     at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:956)
     at org.springframework.web.servlet.handler.AbstractUrlHandlerMapping.lookupHandler(AbstractUrlHandlerMapping.java:249)
     at org.springframework.web.servlet.handler.AbstractUrlHandlerMapping.getHandlerInternal(AbstractUrlHandlerMapping.java:185)
 

 

Any suggestion.

Accepted Solutions (0)

Answers (2)

Answers (2)

0 Kudos

Hi you are able to resolve this issue ?

former_member469962
Contributor
0 Kudos

Hi Rahul,

Have you also tried adding a ignore-scope-resolver to the xmls and used the TenantIgnoreXmlWebApplicationContext in the web config as this link describes?

-Shwetha

Former Member
0 Kudos

Yes. I have added this to spring configuration file.

   <context:component-scan base-package="com.lc.storefront.controllers" scope-resolver="de.hybris.platform.spring.IgnoreTenantScopeMetadataResolver"></context:component-scan>

and this entry to web.xml

          <init-param>    
             <param-name>contextClass</param-name>
             <param-value>de.hybris.platform.spring.ctx.TenantIgnoreXmlWebApplicationContext</param-value>
         </init-param>