Skip to Content
author's profile photo Former Member
Former Member

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

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()
 }



Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Oct 16, 2015 at 12:09 PM

    <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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 05, 2015 at 06:28 AM

    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 .

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.