cancel
Showing results for 
Search instead for 
Did you mean: 

about before view handler in 6.0

Former Member
0 Kudos

I am migrating my project from hybris 5.7 to 6.0. While server running, it gives some error about beforViewhandler. I am unable to resolve it. The stackTrace of error will be like this

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping#0': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.handler.MappedInterceptor#2': Cannot resolve reference to bean 'beforeViewHandlerInterceptor' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultBeforeViewHandlerInterceptor' defined in ServletContext resource [/WEB-INF/config/spring-mvc-config.xml]:

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultBeforeViewHandlerInterceptor' defined in ServletContext resource [/WEB-INF/config/spring-mvc-config.xml]: Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'java.util.ArrayList' to required type 'java.util.List' for property 'beforeViewHandlers'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [com.sun.proxy.$Proxy111 implementing de.hybris.platform.acceleratorstorefrontcommons.interceptors.BeforeViewHandler,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised] to required type [au.com.pillowtalk.storefront.interceptors.BeforeViewHandler] for property 'beforeViewHandlers[10]': no matching editors or conversion strategy found INFO | jvm 1 | main | 2016/08/01 17:10:48.292 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:547) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE] INFO | jvm 1 | main | 2016/08/01 17:10:48.292 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE] INFO | jvm 1 | main | 2016/08/01 17:10:48.294 | at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE] INFO | jvm 1 | main | 2016/08/01 17:10:48.294 | at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE] INFO | jvm 1 | main | 2016/08/01 17:10:48.295 | at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE] INFO | jvm 1 | main | 2016/08/01 17:10:48.295 | at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE] INFO | jvm 1 | main | 2016/08/01 17:10:48.295 | at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:351) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE] INFO | jvm 1 | main | 2016/08/01 17:10:48.296 | at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE] INFO | jvm 1 | main | 2016/08/01 17:10:48.296 | at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:634) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE] INFO | jvm 1 | main | 2016/08/01 17:10:48.300 |

Caused by: org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'java.util.ArrayList' to required type 'java.util.List' for property 'beforeViewHandlers'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [com.sun.proxy.$Proxy111 implementing de.hybris.platform.acceleratorstorefrontcommons.interceptors.BeforeViewHandler,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised] to required type [au.com.pillowtalk.storefront.interceptors.BeforeViewHandler] for property 'beforeViewHandlers[10]': no matching editors or conversion strategy found INFO | jvm 1 | main | 2016/08/01 17:10:48.314 | at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:476) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE] INFO | jvm 1 | main | 2016/08/01 17:10:48.314 | at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:512) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE] INFO | jvm 1 | main | 2016/08/01 17:10:48.315 | at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE] INFO | jvm 1 | main | 2016/08/01 17:10:48.330 | at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE] INFO | jvm 1 | main | 2016/08/01 17:10:48.331 |

Can anyone help me..

Accepted Solutions (0)

Answers (1)

Answers (1)

mansurarisoy
Contributor
0 Kudos

I had experienced same issue when I'm trying to migrate from 5.7 to 6.0. The reason of this problem is a property change of a bean in the web-spring.xml file of addonsupport extension (addonsupport-b2c-web-spring.xml for b2c accelerator). In Hybris 5.7, beforeViewHandlerAdapter bean have a property named proxyInterfaceName which has value ${b2cstorefront.package}.interceptors.BeforeViewHandler. Here b2cstorefront.package is defined in your storefront extension's project.properties file (which is au.com.pillowtalk.storefront, in your case). Therefore, it is expected to write your own BeforeViewHandler interface in your storefront package in Hybris 5.7. However, this approach changed in Hybris 6.0.

In Hybris 6.0, beforeViewHandlerAdapter bean's property proxyInterfaceName has value de.hybris.platform.acceleratorstorefrontcommons.interceptors.BeforeViewHandler which means that BeforeViewHandler class is already shipped within acceleratorstorefrontcommons extension. So it conflicts with your BeforeViewHandler interface in storefront.

I solved the problem by deleting BeforeViewHandler.java file from storefront and adding import de.hybris.platform.acceleratorstorefrontcommons.interceptors.BeforeViewHandler line to the classes that implements BeforeViewHandler interface and to the BeforeViewHandlerInterceptor class.

The procedure above is valid for BeforeControllerHandler class since the same change applied beforeControllerHandlerAdapter bean.

Best regards,

srinivasulu_mula
Participant
0 Kudos

Hi

we are migrating from 5.7 to 6.4 ,I did the same configurations but still not rendering secureportal login page.

Appreciate your response on this.

srinivasulu_mula
Participant

Hi I have resolved the issue.

former_member627008
Participant
0 Kudos

Hi srinivasulu.mula did you do something different than what mansurarisoy said? Cause I removed my BeforeViewHandler and BeforeControllerHandler to use acceleratorstorefrontcommons ones, but I still get the same error.

mansurarisoy
Contributor
0 Kudos

Hi larissaoliveira did you add correct import statements? What is the error you are getting exactly? It may be the different from the one in the question.