cancel
Showing results for 
Search instead for 
Did you mean: 

Hybris 5.7. Installing B2B addons on custom store front. Cannot find class de.hybris.platform.yacceleratorstorefront.interceptors.BeforeViewHandler

Former Member
0 Kudos

Dear hybris experts,

trying to add new b2b addons to generated store front extension (customstorefront) and get 'java.lang.IllegalArgumentException: Cannot find class [de.hybris.platform.yacceleratorstorefront.interceptors.BeforeViewHandler].' Seems the problem that there is dependency on yacceleratorstorefront in the file 'b2bacceleratoraddon-web-spring.xml'

Hybris version: 5.7

Steps to reproduce:

  1. Generate new module based on yaccelerator

  2. Install b2b addons: b2bacceleratoraddon,commerceorgaddon to generated custom store front extension

Exception:

 Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'commerceorgaddonBeforeViewHandler' defined in class path resource [commerceorgaddon/web/spring/commerceorgaddon-web-spring.xml]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Cannot find class [de.hybris.platform.yacceleratorstorefront.interceptors.BeforeViewHandler]
 Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'getB2bacceleratoraddonBeforeViewHandler' defined in class path resource [b2bacceleratoraddon/web/spring/b2bacceleratoraddon-web-spring.xml]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Cannot find class [de.hybris.platform.yacceleratorstorefront.interceptors.BeforeViewHandler]

Workaround:

in the file b2bacceleratoraddon-web-spring.xml

Replace:

 <bean id="beforeViewHandlerAdapter" abstract="true" class="de.hybris.platform.addonsupport.interceptors.BeforeViewHandlerAdapter">
 <property name="proxyInterfaceName" value="de.hybris.platform.yacceleratorstorefront.interceptors.BeforeViewHandler" />
 </bean>

To:

 <bean id="beforeViewHandlerAdapter" abstract="true" class="de.hybris.platform.addonsupport.interceptors.BeforeViewHandlerAdapter">
 <property name="proxyInterfaceName" value="${b2cstorefront.package}.interceptors.BeforeViewHandler" />
 </bean>


Recipe used for configuration:

 def config = {
         localProperties {
                 property 'commerceservices.default.desktop.ui.experience', 'desktop'
         }
 
         extensions {
                 extName 'mcc'
                 extName 'backoffice'
                 extName 'commercesearchbackoffice'
                 extName 'b2bcommercebackoffice'
                 extName 'commerceservicesbackoffice'
                 extName 'solrfacetsearchbackoffice'
                 extName 'b2badmincockpit'
                 extName 'addonsupport'
                 extName 'yaddon'
                 extName 'ycommercewebservices'
 
                 extName 'customb2bcore'
                 extName 'customb2bfacades'
                 extName 'customb2bstorefront'
                 extName 'customb2bcockpits'
                 extName 'customb2bfulfilmentprocess'
                 extName 'customb2binitialdata'
                 extName 'customb2bstorefront'
 
                 extName 'solrserver'
                 extName 'acceleratorwebservicesaddon'
                 extName 'b2bacceleratoraddon'
                 extName 'commerceorgaddon'
         }
 }
 
 task setup << {
         apply plugin: 'installer-platform-plugin'
         apply plugin: 'installer-addon-plugin'
         def pl = platform(config)
         pl.setup()
 
         pl.project.addons {
                 names "b2bacceleratoraddon,commerceorgaddon"
                 template "yacceleratorstorefront"
                 storeFronts "customb2bstorefront"
                 platform pl
         }
 
         pl.project.addons {
                 names "acceleratorwebservicesaddon"
                 template "ycommercewebservices"
                 storeFronts "ycommercewebservices"
                 platform pl
         }
 }
 
 task initialize << {
         apply plugin: 'installer-platform-plugin'
         def pl = platform(config)
         pl.build()
         pl.initialize()
 }
 
 
 task start << {
         apply plugin: 'installer-platform-plugin'
         def pl = platform(config)
         pl.start()
 }



Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi, We had a similar issue, Either, you can use the your work around solution or you can replace b2b to b2c the below likes in your custom storefront project.properties file.

customstorefront.additionalWebSpringConfigs.addonsupport=classpath:/addonsupport/web/spring/addonsupport-b2c-web-spring.xml

b2cstorefront.package=com.capgemini.hybriscx.storefront

Thanks .

Former Member
0 Kudos

<property name="proxyInterfaceName" value="com.custom.hybris.b2b.storefront.interceptors.BeforeViewHandler" /> </bean>

Thats my bean for beforeviewhandleradapter. It is working fine.

Replace "value" with the package of yours custom for beforeviewHandler interface.

This should work.

Former Member
0 Kudos

Where did you put the beforeviewHandler definition? If you put it in storefront web spring config it will be overridden in addons.