Getting Null pointer exception on overriding assistedServiceService in hybris - sap-commerce-cloud

After overriding OOB assistedServiceService I am getting NPE in OOB class DefaultAssistedServiceFacade.java for line assistedServiceService.getAsmSession()
To override service I have followed below steps.
1- Declared bean in customextension-core-spring.xml file as below
<alias name="defaultcustomAssistedServiceService" alias="assistedServiceService"/>
<bean id="defaultcustomAssistedServiceService" class="com.custom.core.services.impl.DefaultCustomAssistedServiceService" parent ="defaultAssistedServiceService"><br> <property name="flexibleSearchService" ref="flexibleSearchService"/>
</bean>
2- Created a custom class overriding OOB defaultCustomAssistedServiceService class
public class DefaultCustomAssistedServiceService extends DefaultAssistedServiceService implements CustomAssistedServiceService {
private FlexibleSearchService flexibleSearchService;
#Override
public CartModel getCartByCode(final String cartCode) {
}
public FlexibleSearchService getFlexibleSearchService() {
return flexibleSearchService;
}
public void setFlexibleSearchService(FlexibleSearchService flexibleSearchService) {
this.flexibleSearchService = flexibleSearchService;
}
Since Object of assistedServiceService is already been used in other OOB classes, So wherever its been called it is giving NPE. Am I missing something in service overriding?
Please note OOB assistedServiceService is defined in OOB extension 'assistedServiceService' in file assistedserviceservices-spring.xml as
<alias name="defaultAssistedServiceService" alias="assistedServiceService"/>
<bean id="defaultAssistedServiceService" class="de.hybris.platform.assistedserviceservices.impl.DefaultAssistedServiceService">
<property name="modelService" ref="modelService"/>
<property name="userService" ref="userService"/>
<property name="baseSiteService" ref="baseSiteService"/>
<property name="cartService" ref="cartService"/>
<property name="sessionService" ref="sessionService"/>
<property name="flexibleSearchService" ref="flexibleSearchService"/>
<property name="pagedFlexibleSearchService" ref="pagedFlexibleSearchService"/>
<property name="commerceCartService" ref="commerceCartService"/>
<property name="customerAccountService" ref="customerAccountService"/>
<property name="commonI18NService" ref="commonI18NService"/>
<property name="timeService" ref="timeService"/>
</bean>
Below is stacktrace which I am getting
SEVERE: Servlet.service() for servlet [DispatcherServlet] in context with path [] threw exception [Error while processing internal filterchain. Exception occurred at chain position: 11 of 17. Current filter: 'FilterChainProxy[Filter Chains: [[ Ant [pattern='/_ui/'], []], [ Ant [pattern='/checkout/'], [org.springframework.security.web.access.channel.ChannelProcessingFilter#63e1e0e7, org.springframework.security.web.context.SecurityContextPersistenceFilter#6b94c056, org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter#21cc977c, org.springframework.security.web.header.HeaderWriterFilter#473f7e49, org.springframework.security.web.authentication.logout.LogoutFilter#2b355891, org.springframework.security.web.csrf.CsrfFilter#666ebbd1, org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter#235ca717, org.springframework.security.web.savedrequest.RequestCacheAwareFilter#1fad4803, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter#1edd7ab7, org.springframework.security.web.authentication.AnonymousAuthenticationFilter#dfefa8e, org.springframework.security.web.session.SessionManagementFilter#4bdc9039, org.springframework.security.web.access.ExceptionTranslationFilter#3ec43411, org.springframework.security.web.access.intercept.FilterSecurityInterceptor#4b39f9bc]], [ com.custom.equipment.security.ExcludeUrlRequestMatcher#7c8d71a8, [org.springframework.security.web.access.channel.ChannelProcessingFilter#1b535de5, org.springframework.security.web.context.SecurityContextPersistenceFilter#13338461, org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter#10e5e5df, org.springframework.security.web.header.HeaderWriterFilter#772c65a, org.springframework.security.web.authentication.logout.LogoutFilter#2b355891, org.springframework.security.web.csrf.CsrfFilter#6cf0f24, org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter#9d09310, org.springframework.security.web.savedrequest.RequestCacheAwareFilter#36a444e8, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter#27750470, org.springframework.security.web.authentication.AnonymousAuthenticationFilter#59bd9995, org.springframework.security.web.session.SessionManagementFilter#5478c9a1, org.springframework.security.web.access.ExceptionTranslationFilter#406f54c2, org.springframework.security.web.access.intercept.FilterSecurityInterceptor#4fb68e3b]], [ org.springframework.security.web.util.matcher.RegexRequestMatcher#76ae7043, [org.springframework.security.web.access.channel.ChannelProcessingFilter#557fbc59, org.springframework.security.web.context.SecurityContextPersistenceFilter#5d8731bd, org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter#7d6c98eb, org.springframework.security.web.header.HeaderWriterFilter#7845d36d, org.springframework.security.web.csrf.CsrfFilter#50703548, org.springframework.security.web.authentication.logout.LogoutFilter#349efc22, org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter#2d2c919a, org.springframework.security.web.savedrequest.RequestCacheAwareFilter#7ba4f1e9, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter#2a2f51a0, org.springframework.security.web.authentication.AnonymousAuthenticationFilter#6993c72b, org.springframework.security.web.session.SessionManagementFilter#207a3bc2, org.springframework.security.web.access.ExceptionTranslationFilter#7c0dbd9d, org.springframework.security.web.access.intercept.FilterSecurityInterceptor#2cff51ed]]]]'!; nested exception is java.lang.NullPointerException] with root cause
java.lang.NullPointerException
at de.hybris.platform.assistedservicefacades.impl.DefaultAssistedServiceFacade.getAsmSession(DefaultAssistedServiceFacade.java:725)
at de.hybris.platform.assistedservicefacades.impl.DefaultAssistedServiceFacade.isAssistedServiceModeLaunched(DefaultAssistedServiceFacade.java:140)
at com.custom.asm.aspect.ChannelDecisionAspect.isAssistedServiceMode(ChannelDecisionAspect.java:87)
at com.custom.asm.aspect.ChannelDecisionAspect.decideAround(ChannelDecisionAspect.java:53)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:627)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:616)
at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:671)
at org.springframework.security.web.access.channel.ChannelDecisionManagerImpl$$EnhancerBySpringCGLIB$$59a46d4f.decide()
at org.springframework.security.web.access.channel.ChannelProcessingFilter.doFilter(ChannelProcessingFilter.java:150)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:214)
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:177)
at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain.doFilter(AbstractPlatformFilterChain.java:297)
at com.custom.equipment.filters.FileUploadFilter.doFilterInternal(FileUploadFilter.java:51)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain.doFilter(AbstractPlatformFilterChain.java:297)
at com.custom.equipment.filters.UrlEncoderFilter.doFilterInternal(UrlEncoderFilter.java:85)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain.doFilter(AbstractPlatformFilterChain.java:297)
at com.custom.equipment.filters.StorefrontFilter.doFilterInternal(StorefrontFilter.java:74)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain.doFilter(AbstractPlatformFilterChain.java:297)
at com.custom.equipment.filters.cms.CMSSiteFilter.doFilterInternal(CMSSiteFilter.java:100)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain.doFilter(AbstractPlatformFilterChain.java:297)
at com.custom.equipment.filters.RequestLoggerFilter.doFilterInternal(RequestLoggerFilter.java:71)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain.doFilter(AbstractPlatformFilterChain.java:297)
at com.custom.equipment.filters.AcceleratorAddOnFilter.doFilter(AcceleratorAddOnFilter.java:90)
at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain.doFilter(AbstractPlatformFilterChain.java:297)
at de.hybris.platform.servicelayer.web.WebAppMediaFilter.doFilter(WebAppMediaFilter.java:128)
at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain.doFilter(AbstractPlatformFilterChain.java:297)
at de.hybris.platform.servicelayer.web.SessionFilter.doFilter(SessionFilter.java:99)
at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain.doFilter(AbstractPlatformFilterChain.java:297)
at de.hybris.platform.servicelayer.web.Log4JFilter.doFilter(Log4JFilter.java:44)
at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain.doFilter(AbstractPlatformFilterChain.java:297)
at de.hybris.platform.servicelayer.web.session.HybrisSpringSessionFilter.doFilter(HybrisSpringSessionFilter.java:69)
at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain.doFilter(AbstractPlatformFilterChain.java:297)
at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain.processStandardFilterChain(AbstractPlatformFilterChain.java:206)
at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain.doFilterInternal(AbstractPlatformFilterChain.java:183)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at com.custom.equipment.filters.UrlPathFilter.doFilterInternal(UrlPathFilter.java:82)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:347)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:263)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at com.custom.equipment.filters.AcceleratorAddOnFilter.doFilter(AcceleratorAddOnFilter.java:90)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:347)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:263)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at de.hybris.platform.servicelayer.web.XSSFilter.processPatternsAndDoFilter(XSSFilter.java:358)
at de.hybris.platform.servicelayer.web.XSSFilter.doFilter(XSSFilter.java:306)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:800)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:800)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1471)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:750)
Mar 02, 2022 11:02:19 AM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [DispatcherServlet] in context with path [] threw exception [Error while processing internal filterchain. Exception occurred at chain position: 11 of 17. Current filter: 'FilterChainProxy[Filter Chains: [[ Ant [pattern='/_ui/'], []], [ Ant [pattern='/checkout/'], [org.springframework.security.web.access.channel.ChannelProcessingFilter#63e1e0e7, org.springframework.security.web.context.SecurityContextPersistenceFilter#6b94c056, org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter#21cc977c, org.springframework.security.web.header.HeaderWriterFilter#473f7e49, org.springframework.security.web.authentication.logout.LogoutFilter#2b355891, org.springframework.security.web.csrf.CsrfFilter#666ebbd1, org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter#235ca717, org.springframework.security.web.savedrequest.RequestCacheAwareFilter#1fad4803, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter#1edd7ab7, org.springframework.security.web.authentication.AnonymousAuthenticationFilter#dfefa8e, org.springframework.security.web.session.SessionManagementFilter#4bdc9039, org.springframework.security.web.access.ExceptionTranslationFilter#3ec43411, org.springframework.security.web.access.intercept.FilterSecurityInterceptor#4b39f9bc]], [ com.custom.equipment.security.ExcludeUrlRequestMatcher#7c8d71a8, [org.springframework.security.web.access.channel.ChannelProcessingFilter#1b535de5, org.springframework.security.web.context.SecurityContextPersistenceFilter#13338461, org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter#10e5e5df, org.springframework.security.web.header.HeaderWriterFilter#772c65a, org.springframework.security.web.authentication.logout.LogoutFilter#2b355891, org.springframework.security.web.csrf.CsrfFilter#6cf0f24, org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter#9d09310, org.springframework.security.web.savedrequest.RequestCacheAwareFilter#36a444e8, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter#27750470, org.springframework.security.web.authentication.AnonymousAuthenticationFilter#59bd9995, org.springframework.security.web.session.SessionManagementFilter#5478c9a1, org.springframework.security.web.access.ExceptionTranslationFilter#406f54c2, org.springframework.security.web.access.intercept.FilterSecurityInterceptor#4fb68e3b]], [ org.springframework.security.web.util.matcher.RegexRequestMatcher#76ae7043, [org.springframework.security.web.access.channel.ChannelProcessingFilter#557fbc59, org.springframework.security.web.context.SecurityContextPersistenceFilter#5d8731bd, org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter#7d6c98eb, org.springframework.security.web.header.HeaderWriterFilter#7845d36d, org.springframework.security.web.csrf.CsrfFilter#50703548, org.springframework.security.web.authentication.logout.LogoutFilter#349efc22, org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter#2d2c919a, org.springframework.security.web.savedrequest.RequestCacheAwareFilter#7ba4f1e9, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter#2a2f51a0, org.springframework.security.web.authentication.AnonymousAuthenticationFilter#6993c72b, org.springframework.security.web.session.SessionManagementFilter#207a3bc2, org.springframework.security.web.access.ExceptionTranslationFilter#7c0dbd9d, org.springframework.security.web.access.intercept.FilterSecurityInterceptor#2cff51ed]]]]'!; nested exception is java.lang.NullPointerException] with root cause
java.lang.NullPointerException
at de.hybris.platform.assistedservicefacades.impl.DefaultAssistedServiceFacade.getAsmSession(DefaultAssistedServiceFacade.java:725)
at de.hybris.platform.assistedservicefacades.impl.DefaultAssistedServiceFacade.isAssistedServiceModeLaunched(DefaultAssistedServiceFacade.java:140)
at com.custom.asm.aspect.ChannelDecisionAspect.isAssistedServiceMode(ChannelDecisionAspect.java:87)
at com.custom.asm.aspect.ChannelDecisionAspect.decideAround(ChannelDecisionAspect.java:53)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:627)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:616)
at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:671)
at org.springframework.security.web.access.channel.ChannelDecisionManagerImpl$$EnhancerBySpringCGLIB$$59a46d4f.decide()
at org.springframework.security.web.access.channel.ChannelProcessingFilter.doFilter(ChannelProcessingFilter.java:150)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:214)
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:177)
at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain.doFilter(AbstractPlatformFilterChain.java:297)
at com.custom.equipment.filters.FileUploadFilter.doFilterInternal(FileUploadFilter.java:51)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain.doFilter(AbstractPlatformFilterChain.java:297)
at com.custom.equipment.filters.UrlEncoderFilter.doFilterInternal(UrlEncoderFilter.java:85)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain.doFilter(AbstractPlatformFilterChain.java:297)
at com.custom.equipment.filters.StorefrontFilter.doFilterInternal(StorefrontFilter.java:74)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain.doFilter(AbstractPlatformFilterChain.java:297)
at com.custom.equipment.filters.cms.CMSSiteFilter.doFilterInternal(CMSSiteFilter.java:100)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain.doFilter(AbstractPlatformFilterChain.java:297)
at com.custom.equipment.filters.RequestLoggerFilter.doFilterInternal(RequestLoggerFilter.java:71)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain.doFilter(AbstractPlatformFilterChain.java:297)
at com.custom.equipment.filters.AcceleratorAddOnFilter.doFilter(AcceleratorAddOnFilter.java:90)
at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain.doFilter(AbstractPlatformFilterChain.java:297)
at de.hybris.platform.servicelayer.web.WebAppMediaFilter.doFilter(WebAppMediaFilter.java:128)
at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain.doFilter(AbstractPlatformFilterChain.java:297)
at de.hybris.platform.servicelayer.web.SessionFilter.doFilter(SessionFilter.java:99)
at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain.doFilter(AbstractPlatformFilterChain.java:297)
at de.hybris.platform.servicelayer.web.Log4JFilter.doFilter(Log4JFilter.java:44)
at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain.doFilter(AbstractPlatformFilterChain.java:297)
at de.hybris.platform.servicelayer.web.session.HybrisSpringSessionFilter.doFilter(HybrisSpringSessionFilter.java:69)
at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain.doFilter(AbstractPlatformFilterChain.java:297)
at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain.processStandardFilterChain(AbstractPlatformFilterChain.java:206)
at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain.doFilterInternal(AbstractPlatformFilterChain.java:183)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at com.custom.equipment.filters.UrlPathFilter.doFilterInternal(UrlPathFilter.java:82)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:347)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:263)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at com.custom.equipment.filters.AcceleratorAddOnFilter.doFilter(AcceleratorAddOnFilter.java:90)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:347)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:263)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at de.hybris.platform.servicelayer.web.XSSFilter.processPatternsAndDoFilter(XSSFilter.java:358)
at de.hybris.platform.servicelayer.web.XSSFilter.doFilter(XSSFilter.java:306)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:800)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:800)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1471)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:750)

fixed the error by calling super method in facade, where I was setting the object of service.
public void setAssistedServiceService(CustomAssistedServiceService assistedServiceService) {
super.setAssistedServiceService(assistedServiceService);
this.assistedServiceService = assistedServiceService;
}

Related

How can'i download a PDF file from iframe in internet explorer 8

I would to download a PDF file from iframe it worked in Google chrome and firefox but it not worked in Internet explorer.
This is my code
public void downloadSubscriptionDocument(SessionObject object) {
Document dt = getBlobCode(object);
if (dt != null && dt.getData() != null) {
final FacesContext fContext = FacesContext.getCurrentInstance();
ExternalContext eContext = null;
if (fContext != null && dt != null) {
eContext = fContext.getExternalContext();
if (eContext != null) {
final HttpServletResponse response = (HttpServletResponse) eContext.getResponse();
response.setContentType("application/pdf");
response.addHeader("content-disposition", "attachment; filename=" + "BulletinAdhesion" + ".pdf");
if (dt != null && dt.getData() != null) {
response.addHeader("Content-Length", String.valueOf(dt.getData().length));
}
try {
final ServletOutputStream sos = response.getOutputStream();
sos.write(dt.getData());
sos.flush();
sos.close();
fContext.responseComplete();
} catch (final Exception ex) {
LOGGER.log(Level.SEVERE, ex.getMessage());
}
}
}
}
else {
Locale locale = new Locale("fr");
this.addMessageError(ResourceBundle.getBundle("messages", locale).getString("eu.spb.afflelou.pdv.ba.not.found"));
return ;
}
}
I have this exception in console
Servlet] - 2019-12-04 10:30:29,289 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/spb-extranet-afflelou-pdv].[Faces Servlet]] (ajp-/10.7.2.55 {s2jbossrecex.spb.eu} :8809-3) JBWEB000236: Servlet.service() for servlet Faces Servlet threw exception: java.lang.IllegalStateException: JBWEB000028: getOutputStream() has already been called for this response
at org.apache.catalina.connector.Response.getWriter(Response.java:621) [jbossweb-7.5.30.Final-redhat-1.jar:7.5.30.Final-redhat-1]
at org.apache.catalina.connector.ResponseFacade.getWriter(ResponseFacade.java:191) [jbossweb-7.5.30.Final-redhat-1.jar:7.5.30.Final-redhat-1]
at com.sun.faces.context.ExternalContextImpl.getResponseOutputWriter(ExternalContextImpl.java:778) [jsf-impl-2.1.28.SP11-redhat-1.jar:2.1.28.SP11-redhat-1]
at javax.faces.context.ExternalContextWrapper.getResponseOutputWriter(ExternalContextWrapper.java:669) [jboss-jsf-api_2.1_spec-2.1.28.SP2-redhat-1.jar:2.1.28.SP2-redhat-1]
at com.sun.faces.application.view.FaceletViewHandlingStrategy.createResponseWriter(FaceletViewHandlingStrategy.java:1110) [jsf-impl-2.1.28.SP11-redhat-1.jar:2.1.28.SP11-redhat-1]
at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:399) [jsf-impl-2.1.28.SP11-redhat-1.jar:2.1.28.SP11-redhat-1]
at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:125) [jsf-impl-2.1.28.SP11-redhat-1.jar:2.1.28.SP11-redhat-1]
at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:286) [jboss-jsf-api_2.1_spec-2.1.28.SP2-redhat-1.jar:2.1.28.SP2-redhat-1]
at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:286) [jboss-jsf-api_2.1_spec-2.1.28.SP2-redhat-1.jar:2.1.28.SP2-redhat-1]
at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:286) [jboss-jsf-api_2.1_spec-2.1.28.SP2-redhat-1.jar:2.1.28.SP2-redhat-1]
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120) [jsf-impl-2.1.28.SP11-redhat-1.jar:2.1.28.SP11-redhat-1]
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) [jsf-impl-2.1.28.SP11-redhat-1.jar:2.1.28.SP11-redhat-1]
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139) [jsf-impl-2.1.28.SP11-redhat-1.jar:2.1.28.SP11-redhat-1]
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:594) [jboss-jsf-api_2.1_spec-2.1.28.SP2-redhat-1.jar:2.1.28.SP2-redhat-1]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:295) [jbossweb-7.5.30.Final-redhat-1.jar:7.5.30.Final-redhat-1]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) [jbossweb-7.5.30.Final-redhat-1.jar:7.5.30.Final-redhat-1]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:231) [jbossweb-7.5.30.Final-redhat-1.jar:7.5.30.Final-redhat-1]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:149) [jbossweb-7.5.30.Final-redhat-1.jar:7.5.30.Final-redhat-1]
at org.jboss.modcluster.container.jbossweb.JBossWebContext$RequestListenerValve.event(JBossWebContext.java:91)
at org.jboss.modcluster.container.jbossweb.JBossWebContext$RequestListenerValve.invoke(JBossWebContext.java:72)
at org.jboss.as.web.security.SubjectInfoSetupValve.invoke(SubjectInfoSetupValve.java:34) [jboss-as-web-7.5.22.Final-redhat-1.jar:7.5.22.Final-redhat-1]
at org.jboss.as.web.session.ClusteredSessionValve.handleRequest(ClusteredSessionValve.java:134) [jboss-as-web-7.5.22.Final-redhat-1.jar:7.5.22.Final-redhat-1]
at org.jboss.as.web.session.ClusteredSessionValve.invoke(ClusteredSessionValve.java:99) [jboss-as-web-7.5.22.Final-redhat-1.jar:7.5.22.Final-redhat-1]
at org.jboss.as.web.session.JvmRouteValve.invoke(JvmRouteValve.java:95) [jboss-as-web-7.5.22.Final-redhat-1.jar:7.5.22.Final-redhat-1]
at org.jboss.as.web.session.LockingValve.invoke(LockingValve.java:64) [jboss-as-web-7.5.22.Final-redhat-1.jar:7.5.22.Final-redhat-1]
at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50) [jboss-as-jpa-7.5.22.Final-redhat-1.jar:7.5.22.Final-redhat-1]
at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50) [jboss-as-jpa-7.5.22.Final-redhat-1.jar:7.5.22.Final-redhat-1]
at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169) [jboss-as-web-7.5.22.Final-redhat-1.jar:7.5.22.Final-redhat-1]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:151) [jbossweb-7.5.30.Final-redhat-1.jar:7.5.30.Final-redhat-1]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97) [jbossweb-7.5.30.Final-redhat-1.jar:7.5.30.Final-redhat-1]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102) [jbossweb-7.5.30.Final-redhat-1.jar:7.5.30.Final-redhat-1]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97) [jbossweb-7.5.30.Final-redhat-1.jar:7.5.30.Final-redhat-1]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) [jbossweb-7.5.30.Final-redhat-1.jar:7.5.30.Final-redhat-1]
at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:490) [jbossweb-7.5.30.Final-redhat-1.jar:7.5.30.Final-redhat-1]
at org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(AjpProtocol.java:422) [jbossweb-7.5.30.Final-redhat-1.jar:7.5.30.Final-redhat-1]
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:926) [jbossweb-7.5.30.Final-redhat-1.jar:7.5.30.Final-redhat-1]

Can not run sample test Koin

I want to run sample test from this site https://insert-koin.io/docs/2.0/getting-started/junit-test/
class HelloAppTest : AutoCloseKoinTest() {
val model by inject<HelloMessageData>()
val service by inject<HelloService>()
#Before
fun before() {
startKoin {
modules(helloModule)
}
}
#Test
fun tesKoinComponents() {
val helloApp = HelloApplication()
helloApp.sayHello()
assertEquals(service, helloApp.helloService)
assertEquals("Hey, ${model.message}", service.hello())
}
}
But it gives following error :
No tests found for given includes: [HelloAppTest]
(filter.includeTestsMatching)
My gradle file is this :
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
buildscript {
dependencies {
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.31")
}
}
plugins {
kotlin("jvm") version "1.3.21" // duplicate for variable
}
group = "adf"
version = "1.0-SNAPSHOT"
repositories {
mavenCentral()
jcenter()
}
dependencies {
implementation(kotlin("stdlib-jdk8"))
implementation("org.koin:koin-core:2.0.0-rc-1")
testCompile("org.koin:koin-test:2.0.0-rc-1")
}
tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
}
tasks.withType<Test> {
useJUnitPlatform()
}
How to handle it? Anybody, please help me
And this is just for stackoverflow.com:
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
you need to include following imports:
testImplementation "junit:junit:4.12"

C++/CX No Suitable Copy Constructor

I have a problem with C++/CX. I'm trying to create a class that is actually a collection of other Class. The class is declared here in the header file:
#pragma once
namespace AdeptlyAdaptiveLayout
{
public ref class NewsItem sealed
{
public:
NewsItem(int init_Id, Platform::String^ init_Category, Platform::String^ init_Headline, Platform::String^ init_Subhead, Platform::String^ init_DateLine, Platform::String^ Image);
property int Id;
property Platform::String^ Category;
property Platform::String^ Headline;
property Platform::String^ Subhead;
property Platform::String^ DateLine;
property Platform::String^ Image;
};
public ref class NewsItemCollection sealed
{
public:
Platform::Collections::Vector<NewsItem> getNewsItems();
};
}
and this is the source file
#include "pch.h"
#include "NewsItem.h"
using namespace Platform;
using namespace Platform::Collections;
namespace AdeptlyAdaptiveLayout
{
NewsItem::NewsItem(int init_Id,
String^ init_Category,
String^ init_Headline,
String^ init_Subhead,
String^ init_DateLine,
String^ init_Image)
{
Id = init_Id;
Category = init_Category;
Headline = init_Headline;
Subhead = init_Subhead;
DateLine = init_DateLine;
Image = init_Image;
}
Vector<NewsItem> NewsItemCollection::getNewsItems()
{
Vector<NewsItem> temp;
temp.Append(*ref new NewsItem(1, "Financial", "Lorem Ipsum", "doro sit amet", "Nunc tristique nec", "Assets/Financial1.png"));
temp.Append(*ref new NewsItem(2, "Financial", "Etiam ac felis viverra", "vulputate nisl ac, aliquet nisi", "tortor porttitor, eu fermentum ante congue", "Assets/Financial2.png"));
temp.Append(*ref new NewsItem(3, "Financial", "Integer sed turpis erat", "Sed quis hendrerit lorem, quis interdum dolor", "in viverra metus facilisis sed", "Assets/Financial3.png"));
temp.Append(*ref new NewsItem(4, "Financial", "Proin sem neque", "aliquet quis ipsum tincidunt", "Integer eleifend", "Assets/Financial4.png" ));
temp.Append(*ref new NewsItem(5, "Financial", "Mauris bibendum non leo vitae tempor", "In nisl tortor, eleifend sed ipsum eget", "Curabitur dictum augue vitae elementum ultrices", "Assets/Financial5.png" ));
temp.Append(*ref new NewsItem(6, "Food", "Lorem ipsum", "dolor sit amet", "Nunc tristique nec", "Assets/Food1.png" ));
temp.Append(*ref new NewsItem(7, "Food", "Etiam ac felis viverra", "vulputate nisl ac, aliquet nisi", "tortor porttitor, eu fermentum ante congue", "Assets/Food2.png" ));
temp.Append(*ref new NewsItem(8,"Food", "Integer sed turpis erat", "Sed quis hendrerit lorem, quis interdum dolor", "in viverra metus facilisis sed","Assets/Food3.png" ));
temp.Append(*ref new NewsItem(9, "Food","Proin sem neque", "aliquet quis ipsum tincidunt", "Integer eleifend", "Assets/Food4.png" ));
temp.Append(*ref new NewsItem(10, "Food", "Mauris bibendum non leo vitae tempor", "In nisl tortor, eleifend sed ipsum eget", "Curabitur dictum augue vitae elementum ultrices", "Assets/Food5.png" ));
return temp;
}
}
The problem is that I keep having this error message "class 'AdeptlyAdaptiveLayout::NewsItem' has no suitable copy constructor". I don't have any idea what I've done wrong. Can you guys me a clue?
Okay, I found the answer now. I've changed the type from Vector to IVector, explicitly create the copy constructor, and adding several changes in the implementation. Here is the changed code in the header and in the source.
Header:
namespace AdeptlyAdaptiveLayout
{
public ref class NewsItem sealed
{
public:
NewsItem(int init_Id, Platform::String^ init_Category, Platform::String^ init_Headline, Platform::String^ init_Subhead, Platform::String^ init_DateLine, Platform::String^ Image);
NewsItem(NewsItem^ obj);
property int Id;
property Platform::String^ Category;
property Platform::String^ Headline;
property Platform::String^ Subhead;
property Platform::String^ DateLine;
property Platform::String^ Image;
};
public ref class NewsItemCollection sealed
{
public:
Windows::Foundation::Collections::IVector<NewsItem^>^ getNewsItems();
};
}
Source:
#include "pch.h"
#include "NewsItem.h"
using namespace Platform;
using namespace Platform::Collections;
using namespace Windows::Foundation::Collections;
namespace AdeptlyAdaptiveLayout
{
NewsItem::NewsItem(int init_Id,
String^ init_Category,
String^ init_Headline,
String^ init_Subhead,
String^ init_DateLine,
String^ init_Image)
{
Id = init_Id;
Category = init_Category;
Headline = init_Headline;
Subhead = init_Subhead;
DateLine = init_DateLine;
Image = init_Image;
}
NewsItem::NewsItem(NewsItem^ obj)
{
this->Category = obj->Category;
this->DateLine = obj->DateLine;
this->Headline = obj->Headline;
this->Id = obj->Id;
this->Image = obj->Image;
this->Subhead = obj->Subhead;
}
IVector<NewsItem^>^ NewsItemCollection::getNewsItems()
{
IVector<NewsItem^>^ temp = ref new Vector<NewsItem^> ();
temp->Append(ref new NewsItem(1, "Financial", "Lorem Ipsum", "doro sit amet", "Nunc tristique nec", "Assets/Financial1.png"));
temp->Append(ref new NewsItem(2, "Financial", "Etiam ac felis viverra", "vulputate nisl ac, aliquet nisi", "tortor porttitor, eu fermentum ante congue", "Assets/Financial2.png"));
temp->Append(ref new NewsItem(3, "Financial", "Integer sed turpis erat", "Sed quis hendrerit lorem, quis interdum dolor", "in viverra metus facilisis sed", "Assets/Financial3.png"));
temp->Append(ref new NewsItem(4, "Financial", "Proin sem neque", "aliquet quis ipsum tincidunt", "Integer eleifend", "Assets/Financial4.png" ));
temp->Append(ref new NewsItem(5, "Financial", "Mauris bibendum non leo vitae tempor", "In nisl tortor, eleifend sed ipsum eget", "Curabitur dictum augue vitae elementum ultrices", "Assets/Financial5.png" ));
temp->Append(ref new NewsItem( 6, "Food", "Lorem ipsum", "dolor sit amet", "Nunc tristique nec", "Assets/Food1.png" ));
temp->Append(ref new NewsItem(7, "Food", "Etiam ac felis viverra", "vulputate nisl ac, aliquet nisi", "tortor porttitor, eu fermentum ante congue", "Assets/Food2.png" ));
temp->Append(ref new NewsItem(8,"Food", "Integer sed turpis erat", "Sed quis hendrerit lorem, quis interdum dolor", "in viverra metus facilisis sed","Assets/Food3.png" ));
temp->Append(ref new NewsItem(9, "Food","Proin sem neque", "aliquet quis ipsum tincidunt", "Integer eleifend", "Assets/Food4.png" ));
temp->Append(ref new NewsItem(10, "Food", "Mauris bibendum non leo vitae tempor", "In nisl tortor, eleifend sed ipsum eget", "Curabitur dictum augue vitae elementum ultrices", "Assets/Food5.png" ));
return temp;
}
}
However, I still do not understand why it works. I think I'm going to do an in-depth research on this.
When you provided the constructor with this constructor signature:
NewsItem(int init_Id, Platform::String ....
... the compiler will no longer synthesize the default ctors for you. You now need to specify them yourself in this case.
https://msdn.microsoft.com/en-us/library/s16xw1a8.aspx
If any non-default constructors are declared, the compiler does not
provide a default constructor

Error with SwitchableFieldDefinition with nesting of MultiValueFieldDefinition and CompositeFieldDefinition

I have a problem when I deploy a dialog of my component, it belongs to class SwitchableFieldDefinition which has an option of containing a MultiValueFieldDefinition and this has a nested CompositeFieldDefinition:
This is the log error when I deploy this dialog:
ERROR info.magnolia.pages.app.editor.PageEditorPresenter 30.03.2016 11:42:31 -- An error occurred while executing action [editElement]
info.magnolia.ui.api.action.ActionExecutionException: Action execution failed for action: editElement
at info.magnolia.ui.api.action.AbstractActionExecutor.execute(AbstractActionExecutor.java:64)
at info.magnolia.pages.app.editor.PageEditorPresenter.onAction(PageEditorPresenter.java:118)
at info.magnolia.ui.vaadin.editor.PageEditor$1.editArea(PageEditor.java:100)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.vaadin.server.ServerRpcManager.applyInvocation(ServerRpcManager.java:168)
at com.vaadin.server.ServerRpcManager.applyInvocation(ServerRpcManager.java:118)
at com.vaadin.server.communication.ServerRpcHandler.handleBurst(ServerRpcHandler.java:214)
at com.vaadin.server.communication.ServerRpcHandler.handleRpc(ServerRpcHandler.java:111)
at com.vaadin.server.communication.UidlRequestHandler.synchronizedHandleRequest(UidlRequestHandler.java:91)
at com.vaadin.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:37)
at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1371)
at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:238)
at info.magnolia.ui.admincentral.AdmincentralVaadinServlet.service(AdmincentralVaadinServlet.java:136)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at info.magnolia.cms.filters.ServletDispatchingFilter.doFilter(ServletDispatchingFilter.java:148)
at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:85)
at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:80)
at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:82)
at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:82)
at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:82)
at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:82)
at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:82)
at info.magnolia.cms.filters.CompositeFilter.doFilter(CompositeFilter.java:65)
at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:85)
at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:80)
at info.magnolia.cms.filters.VirtualUriFilter.doFilter(VirtualUriFilter.java:68)
at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:85)
at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:80)
at info.magnolia.module.cache.executor.Bypass.processCacheRequest(Bypass.java:58)
at info.magnolia.module.cache.executor.CompositeExecutor.processCacheRequest(CompositeExecutor.java:66)
at info.magnolia.module.cache.filter.CacheFilter.doFilter(CacheFilter.java:152)
at info.magnolia.cms.filters.OncePerRequestAbstractMgnlFilter.doFilter(OncePerRequestAbstractMgnlFilter.java:58)
at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:80)
at info.magnolia.cms.i18n.I18nContentSupportFilter.doFilter(I18nContentSupportFilter.java:73)
at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:85)
at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:80)
at info.magnolia.cms.filters.RangeSupportFilter.doFilter(RangeSupportFilter.java:84)
at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:85)
at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:80)
at info.magnolia.cms.security.BaseSecurityFilter.doFilter(BaseSecurityFilter.java:57)
at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:85)
at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:80)
at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:82)
at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:82)
at info.magnolia.cms.security.SecurityCallbackFilter.doFilter(SecurityCallbackFilter.java:83)
at info.magnolia.cms.filters.OncePerRequestAbstractMgnlFilter.doFilter(OncePerRequestAbstractMgnlFilter.java:58)
at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:80)
at info.magnolia.cms.security.LogoutFilter.doFilter(LogoutFilter.java:94)
at info.magnolia.cms.filters.OncePerRequestAbstractMgnlFilter.doFilter(OncePerRequestAbstractMgnlFilter.java:58)
at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:80)
at info.magnolia.module.templatingkit.filters.SiteMergeFilter.doFilter(SiteMergeFilter.java:112)
at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:85)
at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:80)
at info.magnolia.multisite.filters.MultiSiteFilter.doFilter(MultiSiteFilter.java:104)
at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:85)
at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:80)
at info.magnolia.cms.filters.MultiChannelFilter.doFilter(MultiChannelFilter.java:83)
at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:85)
at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:80)
at info.magnolia.module.cache.filter.GZipFilter.doFilter(GZipFilter.java:73)
at info.magnolia.cms.filters.OncePerRequestAbstractMgnlFilter.doFilter(OncePerRequestAbstractMgnlFilter.java:58)
at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:80)
at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:82)
at info.magnolia.cms.security.auth.login.LoginFilter.doFilter(LoginFilter.java:127)
at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:85)
at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:80)
at info.magnolia.enterprise.registration.RegistrationFilter.doFilter(RegistrationFilter.java:56)
at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:85)
at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:80)
at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:82)
at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:82)
at info.magnolia.module.devicedetection.filter.DeviceDetectionFilter.doFilter(DeviceDetectionFilter.java:71)
at info.magnolia.cms.filters.OncePerRequestAbstractMgnlFilter.doFilter(OncePerRequestAbstractMgnlFilter.java:58)
at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:80)
at info.magnolia.personalization.preview.filter.PreviewFilter.doFilter(PreviewFilter.java:92)
at info.magnolia.cms.filters.OncePerRequestAbstractMgnlFilter.doFilter(OncePerRequestAbstractMgnlFilter.java:58)
at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:80)
at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:82)
at info.magnolia.personalization.trait.AbstractTraitDetectorFilter.doFilter(AbstractTraitDetectorFilter.java:61)
at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:85)
at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:80)
at info.magnolia.personalization.trait.AbstractTraitDetectorFilter.doFilter(AbstractTraitDetectorFilter.java:61)
at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:85)
at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:80)
at info.magnolia.cms.filters.ContentTypeFilter.doFilter(ContentTypeFilter.java:112)
at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:85)
at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:80)
at info.magnolia.cms.filters.ContextFilter.doFilter(ContextFilter.java:129)
at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:85)
at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:80)
at info.magnolia.cms.filters.CompositeFilter.doFilter(CompositeFilter.java:65)
at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:85)
at info.magnolia.cms.filters.SafeDestroyMgnlFilterWrapper.doFilter(SafeDestroyMgnlFilterWrapper.java:106)
at info.magnolia.cms.filters.MgnlFilterDispatcher.doDispatch(MgnlFilterDispatcher.java:66)
at info.magnolia.cms.filters.MgnlMainFilter.doFilter(MgnlMainFilter.java:107)
at info.magnolia.cms.filters.MgnlMainFilter.doFilter(MgnlMainFilter.java:93)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:215)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:110)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
at org.eclipse.jetty.server.Server.handle(Server.java:499)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)
at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassCastException: info.magnolia.ui.vaadin.integration.NullItem cannot be cast to info.magnolia.ui.vaadin.integration.jcr.JcrNodeAdapter
at info.magnolia.ui.form.field.transformer.multi.DelegatingMultiValueFieldTransformer.getRootItem(DelegatingMultiValueFieldTransformer.java:194)
at info.magnolia.ui.form.field.transformer.multi.DelegatingMultiValueFieldTransformer.readFromItem(DelegatingMultiValueFieldTransformer.java:112)
at info.magnolia.ui.form.field.transformer.multi.DelegatingMultiValueFieldTransformer.readFromItem(DelegatingMultiValueFieldTransformer.java:76)
at info.magnolia.ui.form.field.transformer.TransformedProperty.<init>(TransformedProperty.java:59)
at info.magnolia.ui.form.field.factory.AbstractFieldFactory.initializeProperty(AbstractFieldFactory.java:238)
at info.magnolia.ui.form.field.factory.AbstractFieldFactory.createField(AbstractFieldFactory.java:114)
at info.magnolia.ui.form.field.AbstractCustomMultiField.createLocalField(AbstractCustomMultiField.java:175)
at info.magnolia.ui.form.field.SwitchableField.initFields(SwitchableField.java:104)
at info.magnolia.ui.form.field.SwitchableField.initFields(SwitchableField.java:62)
at info.magnolia.ui.form.field.AbstractCustomMultiField.initFields(AbstractCustomMultiField.java:140)
at info.magnolia.ui.form.field.SwitchableField.initContent(SwitchableField.java:93)
at com.vaadin.ui.CustomField.getContent(CustomField.java:92)
at com.vaadin.ui.CustomField.attach(CustomField.java:82)
at com.vaadin.server.AbstractClientConnector.attach(AbstractClientConnector.java:583)
at com.vaadin.ui.AbstractComponent.attach(AbstractComponent.java:571)
at com.vaadin.ui.AbstractComponent.setParent(AbstractComponent.java:478)
at com.vaadin.ui.CustomField.getContent(CustomField.java:93)
at com.vaadin.ui.CustomField.attach(CustomField.java:82)
at com.vaadin.server.AbstractClientConnector.attach(AbstractClientConnector.java:583)
at com.vaadin.ui.AbstractComponent.attach(AbstractComponent.java:571)
at com.vaadin.server.AbstractClientConnector.attach(AbstractClientConnector.java:583)
at com.vaadin.ui.AbstractComponent.attach(AbstractComponent.java:571)
at com.vaadin.ui.AbstractComponent.setParent(AbstractComponent.java:478)
at com.vaadin.ui.CustomField.getContent(CustomField.java:93)
at com.vaadin.ui.CustomField.attach(CustomField.java:82)
at com.vaadin.server.AbstractClientConnector.attach(AbstractClientConnector.java:583)
at com.vaadin.ui.AbstractComponent.attach(AbstractComponent.java:571)
at com.vaadin.server.AbstractClientConnector.attach(AbstractClientConnector.java:583)
at com.vaadin.ui.AbstractComponent.attach(AbstractComponent.java:571)
at com.vaadin.server.AbstractClientConnector.attach(AbstractClientConnector.java:583)
at com.vaadin.ui.AbstractComponent.attach(AbstractComponent.java:571)
at com.vaadin.server.AbstractClientConnector.attach(AbstractClientConnector.java:583)
at com.vaadin.ui.AbstractComponent.attach(AbstractComponent.java:571)
at com.vaadin.server.AbstractClientConnector.attach(AbstractClientConnector.java:583)
at com.vaadin.ui.AbstractComponent.attach(AbstractComponent.java:571)
at com.vaadin.server.AbstractClientConnector.attach(AbstractClientConnector.java:583)
at com.vaadin.ui.AbstractComponent.attach(AbstractComponent.java:571)
at info.magnolia.ui.dialog.BaseDialogViewImpl.attach(BaseDialogViewImpl.java:180)
at com.vaadin.server.AbstractClientConnector.attach(AbstractClientConnector.java:583)
at com.vaadin.ui.AbstractComponent.attach(AbstractComponent.java:571)
at com.vaadin.ui.AbstractComponent.setParent(AbstractComponent.java:478)
at info.magnolia.ui.vaadin.magnoliashell.MagnoliaShell.addOverlay(MagnoliaShell.java:233)
at info.magnolia.ui.vaadin.magnoliashell.MagnoliaShell.openOverlay(MagnoliaShell.java:203)
at info.magnolia.ui.framework.shell.ShellImpl.openOverlayOnView(ShellImpl.java:221)
at info.magnolia.ui.framework.app.SubAppContextImpl$1.openOverlay(SubAppContextImpl.java:150)
at info.magnolia.ui.framework.context.AbstractUIContext.openOverlay(AbstractUIContext.java:66)
at info.magnolia.ui.dialog.formdialog.FormDialogPresenterImpl.start(FormDialogPresenterImpl.java:144)
at info.magnolia.ui.dialog.formdialog.FormDialogPresenterImpl.start(FormDialogPresenterImpl.java:119)
at info.magnolia.pages.app.action.EditElementAction.execute(EditElementAction.java:88)
at info.magnolia.ui.api.action.AbstractActionExecutor.execute(AbstractActionExecutor.java:62)
... 118 more
I´ve tried with other TransformerClass like:
DelegatingMultiValueFieldTransformer
DelegatingCompositeFieldTransformer
but I couldn´t get anything.
Please, any help?
you need add to this "transformerClass" to SwitchableFieldDefinition height.
TransformerClass
I hope resolving your question.

How to display a string with a delay in between words in Swift?

So I've tried using Matt's delay code but it does not seem to fit my purpose. I'm writing a Swift app and would like to be able to display a string (say a word at a time) with a delay in between. Anyone have any suggestions?
This will give you a delay of four seconds between two words. You dont say how many words you need to do this with and without any context or you posting any code its not easy to understand your requirements. However this will provide a delay between two strings
self.mystring.text = "some word"
let seconds = 4.0
let delay = seconds * Double(NSEC_PER_SEC) // nanoseconds per seconds
var dispatchTime = dispatch_time(DISPATCH_TIME_NOW, Int64(delay))
dispatch_after(dispatchTime, dispatch_get_main_queue(), {
// Performed with delay
self.mystring.text = "a different word"
})
class ViewController: UIViewController {
#IBOutlet weak var myTypeWriter: UITextView!
let words = "Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda. Hello World !!!".componentsSeparatedByString(" ")
var counter = 0
var timer:NSTimer?
// create a method to add one word at a time to your text view
func addWord(){
// make sure you only update your text field if you have a corresponding item in your array
if counter < words.count {
myTypeWriter.text = "\(myTypeWriter.text) \(words[counter])"
// invalidate your timer when it is finished
} else {
timer?.invalidate()
}
counter++
}
override func viewDidLoad() {
super.viewDidLoad()
timer = NSTimer.scheduledTimerWithTimeInterval(0.25, target: self, selector: "addWord", userInfo: nil, repeats: true)
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
}
}

Resources