on 10-12-2015 2:04 PM
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:
Generate new module based on yaccelerator
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()
}
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 .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
<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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
5 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.