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;
}
We are using Spring Integration + JMS + ActiveMQ to exchange messages between microservices using Virtual Topics.
Here is our configuration for the inbound messages:
#Autowired
lateinit var connectionFactory: ConnectionFactory
#Autowired
lateinit var messageConverter: MessageConverter
#Bean("file-uploaded.inbound")
fun inboundChannel() = MessageChannels.queue().get()
#Bean("file-uploaded.inbound.flow")
fun inboundFlow(): IntegrationFlow {
return IntegrationFlows.from(
Jms.messageDrivenChannelAdapter(
Jms.container(connectionFactory,
"Consumer.appId.VirtualTopic.file-uploaded")
.pubSubDomain(false).get()
).jmsMessageConverter(messageConverter)
).channel(inboundChannel()).get()
}
and here is our retry advice (fairly default, except for the retry state generator):
#Bean
fun requestHandlerRetryAdvice(): RequestHandlerRetryAdvice {
return RequestHandlerRetryAdvice().apply {
setRetryStateGenerator(SpelExpressionRetryStateGenerator("headers[\"jms_messageId\"]"))
setRecoveryCallback(ErrorMessageSendingRecoverer())
}
}
and message handler:
#MessageEndpoint
class FileUploadedEventListener() {
#ServiceActivator(inputChannel = "file-uploaded.inbound", adviceChain = ["requestHandlerRetryAdvice"])
fun handleFileUploadedEvent(fileUploadedEvent: FileUploadedEvent) {
LoggerFactory.getLogger(this.javaClass.name).info("Received event: $fileUploadedEvent")
throw RuntimeException()
}
}
Basically the reply advice is not putting the message back on the queue as it is supposed to (as per documentation) and it is sending an error message on the 'errorChannel' after the first try.
Has anyone experienced the same problem using Virtual Topics?
Or are we just missing something in the configuration?
Thanks!
Update here below the debug logging:
2018-09-19 15:40:07.877 DEBUG .i.j.ChannelPublishingJmsMessageListener : converted JMS Message [ActiveMQBytesMessage {commandId = 5, responseRequired = true, messageId = ID:Marcos-MBP.intranet-57777-1537280015474-1:71:1:1:1, originalDestination = topic://VirtualTopic.file-uploaded, originalTransactionId = null, producerId = ID:Marcos-MBP.intranet-57777-1537280015474-1:71:1:1, destination = queue://Consumer.dev-platform-asset-previews.VirtualTopic.file-uploaded, transactionId = null, expiration = 0, timestamp = 1537368007815, arrival = 0, brokerInTime = 1537368007821, brokerOutTime = 1537368007822, correlationId = null, replyTo = null, persistent = true, type = null, priority = 4, groupID = null, groupSequence = 0, targetConsumerId = null, compressed = false, userID = null, content = org.apache.activemq.util.ByteSequence#732fdf26, marshalledProperties = org.apache.activemq.util.ByteSequence#6ca08492, dataStructure = null, redeliveryCounter = 0, size = 0, properties = {spanTraceId=4770babc94e7d760, spanId=0c31247dd4ed71eb, spanParentSpanId=4770babc94e7d760, _type=FileUploadedEvent, spanSampled=0}, readOnlyProperties = true, readOnlyBody = true, droppable = false, jmsXGroupFirstForConsumer = false} ActiveMQBytesMessage{ bytesOut = null, dataOut = null, dataIn = java.io.DataInputStream#33c0baa3 }] to integration Message payload [FileUploadedEvent(assetId=c9c73263-e05c-4cb0-bf7b-ea2d3b934c13, objectKey=account-id/c9c73263-e05c-4cb0-bf7b-ea2d3b934c13, bucketName=platform-asset-storage-dev, accountId=account-id, fileName=unknown, userId=1)]
2018-09-19 15:40:07.879 DEBUG o.s.integration.channel.DirectChannel : preSend on channel 'file-uploaded.inbound.flow.channel#0', message: GenericMessage [payload=FileUploadedEvent(assetId=c9c73263-e05c-4cb0-bf7b-ea2d3b934c13, objectKey=account-id/c9c73263-e05c-4cb0-bf7b-ea2d3b934c13, bucketName=platform-asset-storage-dev, accountId=account-id, fileName=unknown, userId=1), headers={spanTraceId=4770babc94e7d760, spanId=0c31247dd4ed71eb, spanParentSpanId=4770babc94e7d760, jms_redelivered=false, jms_destination=queue://Consumer.dev-platform-asset-previews.VirtualTopic.file-uploaded, _type=FileUploadedEvent, id=266d356e-dc90-cb33-8818-40a3cf718125, priority=4, spanSampled=0, jms_timestamp=1537368007815, jms_messageId=ID:Marcos-MBP.intranet-57777-1537280015474-1:71:1:1:1, timestamp=1537368007879}]
2018-09-19 15:40:07.882 DEBUG o.s.integration.handler.BridgeHandler : file-uploaded.inbound.flow.org.springframework.integration.handler.BridgeHandler#0 received message: GenericMessage [payload=FileUploadedEvent(assetId=c9c73263-e05c-4cb0-bf7b-ea2d3b934c13, objectKey=account-id/c9c73263-e05c-4cb0-bf7b-ea2d3b934c13, bucketName=platform-asset-storage-dev, accountId=account-id, fileName=unknown, userId=1), headers={jms_destination=queue://Consumer.dev-platform-asset-previews.VirtualTopic.file-uploaded, _type=FileUploadedEvent, X-B3-ParentSpanId=0c31247dd4ed71eb, priority=4, jms_timestamp=1537368007815, spanTraceId=4770babc94e7d760, spanId=04c0bd5a812ee159, spanParentSpanId=0c31247dd4ed71eb, nativeHeaders={spanTraceId=[4770babc94e7d760], spanId=[04c0bd5a812ee159], spanParentSpanId=[0c31247dd4ed71eb], spanSampled=[0]}, jms_redelivered=false, X-B3-SpanId=04c0bd5a812ee159, X-B3-Sampled=0, X-B3-TraceId=4770babc94e7d760, id=33d89f7b-dbf8-b381-add7-549d875dd914, spanSampled=0, jms_messageId=ID:Marcos-MBP.intranet-57777-1537280015474-1:71:1:1:1, timestamp=1537368007881}]
2018-09-19 15:40:07.883 DEBUG o.s.integration.channel.QueueChannel : preSend on channel 'file-uploaded.inbound', message: GenericMessage [payload=FileUploadedEvent(assetId=c9c73263-e05c-4cb0-bf7b-ea2d3b934c13, objectKey=account-id/c9c73263-e05c-4cb0-bf7b-ea2d3b934c13, bucketName=platform-asset-storage-dev, accountId=account-id, fileName=unknown, userId=1), headers={jms_destination=queue://Consumer.dev-platform-asset-previews.VirtualTopic.file-uploaded, _type=FileUploadedEvent, X-B3-ParentSpanId=0c31247dd4ed71eb, priority=4, jms_timestamp=1537368007815, spanTraceId=4770babc94e7d760, spanId=04c0bd5a812ee159, spanParentSpanId=0c31247dd4ed71eb, nativeHeaders={spanTraceId=[4770babc94e7d760], spanId=[04c0bd5a812ee159], spanParentSpanId=[0c31247dd4ed71eb], spanSampled=[0]}, jms_redelivered=false, X-B3-SpanId=04c0bd5a812ee159, X-B3-Sampled=0, X-B3-TraceId=4770babc94e7d760, id=33d89f7b-dbf8-b381-add7-549d875dd914, spanSampled=0, jms_messageId=ID:Marcos-MBP.intranet-57777-1537280015474-1:71:1:1:1, timestamp=1537368007881}]
2018-09-19 15:40:07.884 DEBUG o.s.integration.channel.QueueChannel : postSend (sent=true) on channel 'file-uploaded.inbound', message: GenericMessage [payload=FileUploadedEvent(assetId=c9c73263-e05c-4cb0-bf7b-ea2d3b934c13, objectKey=account-id/c9c73263-e05c-4cb0-bf7b-ea2d3b934c13, bucketName=platform-asset-storage-dev, accountId=account-id, fileName=unknown, userId=1), headers={jms_destination=queue://Consumer.dev-platform-asset-previews.VirtualTopic.file-uploaded, _type=FileUploadedEvent, X-B3-ParentSpanId=04c0bd5a812ee159, priority=4, jms_timestamp=1537368007815, spanTraceId=4770babc94e7d760, spanId=49b4d98b393a623e, spanParentSpanId=04c0bd5a812ee159, nativeHeaders={spanTraceId=[4770babc94e7d760], spanId=[49b4d98b393a623e], spanParentSpanId=[04c0bd5a812ee159], spanSampled=[0], X-B3-TraceId=[4770babc94e7d760], X-B3-SpanId=[49b4d98b393a623e], X-B3-ParentSpanId=[04c0bd5a812ee159], X-B3-Sampled=[0]}, jms_redelivered=false, X-B3-SpanId=49b4d98b393a623e, X-B3-Sampled=0, X-B3-TraceId=4770babc94e7d760, id=70e86708-b383-ce4a-61f5-36a69ecadfeb, spanSampled=0, jms_messageId=ID:Marcos-MBP.intranet-57777-1537280015474-1:71:1:1:1, timestamp=1537368007883}]
2018-09-19 15:40:07.884 DEBUG o.s.integration.channel.QueueChannel : postReceive on channel 'file-uploaded.inbound', message: GenericMessage [payload=FileUploadedEvent(assetId=c9c73263-e05c-4cb0-bf7b-ea2d3b934c13, objectKey=account-id/c9c73263-e05c-4cb0-bf7b-ea2d3b934c13, bucketName=platform-asset-storage-dev, accountId=account-id, fileName=unknown, userId=1), headers={jms_destination=queue://Consumer.dev-platform-asset-previews.VirtualTopic.file-uploaded, _type=FileUploadedEvent, X-B3-ParentSpanId=04c0bd5a812ee159, priority=4, jms_timestamp=1537368007815, spanTraceId=4770babc94e7d760, spanId=49b4d98b393a623e, spanParentSpanId=04c0bd5a812ee159, nativeHeaders={spanTraceId=[4770babc94e7d760], spanId=[49b4d98b393a623e], spanParentSpanId=[04c0bd5a812ee159], spanSampled=[0], X-B3-TraceId=[4770babc94e7d760], X-B3-SpanId=[49b4d98b393a623e], X-B3-ParentSpanId=[04c0bd5a812ee159], X-B3-Sampled=[0]}, jms_redelivered=false, X-B3-SpanId=49b4d98b393a623e, X-B3-Sampled=0, X-B3-TraceId=4770babc94e7d760, id=70e86708-b383-ce4a-61f5-36a69ecadfeb, spanSampled=0, jms_messageId=ID:Marcos-MBP.intranet-57777-1537280015474-1:71:1:1:1, timestamp=1537368007883}]
2018-09-19 15:40:07.884 DEBUG o.s.i.handler.ServiceActivatingHandler : ServiceActivator for [org.springframework.integration.handler.MethodInvokingMessageProcessor#62a15309] (fileUploadedEventListener.handleFileUploadedEvent.serviceActivator.handler) received message: GenericMessage [payload=FileUploadedEvent(assetId=c9c73263-e05c-4cb0-bf7b-ea2d3b934c13, objectKey=account-id/c9c73263-e05c-4cb0-bf7b-ea2d3b934c13, bucketName=platform-asset-storage-dev, accountId=account-id, fileName=unknown, userId=1), headers={jms_destination=queue://Consumer.dev-platform-asset-previews.VirtualTopic.file-uploaded, _type=FileUploadedEvent, priority=4, jms_timestamp=1537368007815, spanTraceId=4770babc94e7d760, spanId=7f9b16d7f7d5b347, spanParentSpanId=49b4d98b393a623e, nativeHeaders={spanTraceId=[4770babc94e7d760], spanId=[7f9b16d7f7d5b347], spanParentSpanId=[49b4d98b393a623e], spanSampled=[0]}, jms_redelivered=false, id=4c6d131e-448e-9863-f84b-7a4a8e563b09, spanSampled=0, jms_messageId=ID:Marcos-MBP.intranet-57777-1537280015474-1:71:1:1:1}]
2018-09-19 15:40:07.884 DEBUG o.s.integration.channel.DirectChannel : postSend (sent=true) on channel 'file-uploaded.inbound.flow.channel#0', message: GenericMessage [payload=FileUploadedEvent(assetId=c9c73263-e05c-4cb0-bf7b-ea2d3b934c13, objectKey=account-id/c9c73263-e05c-4cb0-bf7b-ea2d3b934c13, bucketName=platform-asset-storage-dev, accountId=account-id, fileName=unknown, userId=1), headers={jms_destination=queue://Consumer.dev-platform-asset-previews.VirtualTopic.file-uploaded, _type=FileUploadedEvent, X-B3-ParentSpanId=0c31247dd4ed71eb, priority=4, jms_timestamp=1537368007815, spanTraceId=4770babc94e7d760, spanId=04c0bd5a812ee159, spanParentSpanId=0c31247dd4ed71eb, nativeHeaders={spanTraceId=[4770babc94e7d760], spanId=[7f9b16d7f7d5b347], spanParentSpanId=[49b4d98b393a623e], spanSampled=[0]}, jms_redelivered=false, X-B3-SpanId=04c0bd5a812ee159, X-B3-Sampled=0, X-B3-TraceId=4770babc94e7d760, id=33d89f7b-dbf8-b381-add7-549d875dd914, spanSampled=0, jms_messageId=ID:Marcos-MBP.intranet-57777-1537280015474-1:71:1:1:1, timestamp=1537368007881}]
2018-09-19 15:40:07.888 DEBUG o.s.retry.support.RetryTemplate : Retry: count=0
2018-09-19 15:40:07.901 INFO c.b.p.a.a.e.FileUploadedEventListener : Received file uploaded event GenericMessage [payload=FileUploadedEvent(assetId=c9c73263-e05c-4cb0-bf7b-ea2d3b934c13, objectKey=account-id/c9c73263-e05c-4cb0-bf7b-ea2d3b934c13, bucketName=platform-asset-storage-dev, accountId=account-id, fileName=unknown, userId=1), headers={jms_destination=queue://Consumer.dev-platform-asset-previews.VirtualTopic.file-uploaded, _type=FileUploadedEvent, priority=4, jms_timestamp=1537368007815, spanTraceId=4770babc94e7d760, spanId=7f9b16d7f7d5b347, spanParentSpanId=49b4d98b393a623e, nativeHeaders={spanTraceId=[4770babc94e7d760], spanId=[7f9b16d7f7d5b347], spanParentSpanId=[49b4d98b393a623e], spanSampled=[0]}, jms_redelivered=false, id=4c6d131e-448e-9863-f84b-7a4a8e563b09, spanSampled=0, jms_messageId=ID:Marcos-MBP.intranet-57777-1537280015474-1:71:1:1:1}]
2018-09-19 15:40:07.902 DEBUG o.s.retry.support.RetryTemplate : Checking for rethrow: count=1
2018-09-19 15:40:07.902 DEBUG o.s.retry.support.RetryTemplate : Rethrow in retry for policy: count=1
2018-09-19 15:40:07.904 DEBUG o.s.i.channel.PublishSubscribeChannel : preSend on channel 'errorChannel', message: ErrorMessage [payload=org.springframework.messaging.MessageHandlingException: nested exception is java.lang.RuntimeException, failedMessage=GenericMessage [payload=FileUploadedEvent(assetId=c9c73263-e05c-4cb0-bf7b-ea2d3b934c13, objectKey=account-id/c9c73263-e05c-4cb0-bf7b-ea2d3b934c13, bucketName=platform-asset-storage-dev, accountId=account-id, fileName=unknown, userId=1), headers={jms_destination=queue://Consumer.dev-platform-asset-previews.VirtualTopic.file-uploaded, _type=FileUploadedEvent, priority=4, jms_timestamp=1537368007815, spanTraceId=4770babc94e7d760, spanId=7f9b16d7f7d5b347, spanParentSpanId=49b4d98b393a623e, nativeHeaders={spanTraceId=[4770babc94e7d760], spanId=[7f9b16d7f7d5b347], spanParentSpanId=[49b4d98b393a623e], spanSampled=[0]}, jms_redelivered=false, id=4c6d131e-448e-9863-f84b-7a4a8e563b09, spanSampled=0, jms_messageId=ID:Marcos-MBP.intranet-57777-1537280015474-1:71:1:1:1}], headers={id=631dd6f9-0e84-15c7-c953-48d732c25270, timestamp=1537368007904}] for original GenericMessage [payload=FileUploadedEvent(assetId=c9c73263-e05c-4cb0-bf7b-ea2d3b934c13, objectKey=account-id/c9c73263-e05c-4cb0-bf7b-ea2d3b934c13, bucketName=platform-asset-storage-dev, accountId=account-id, fileName=unknown, userId=1), headers={jms_destination=queue://Consumer.dev-platform-asset-previews.VirtualTopic.file-uploaded, _type=FileUploadedEvent, X-B3-ParentSpanId=49b4d98b393a623e, priority=4, jms_timestamp=1537368007815, spanTraceId=4770babc94e7d760, spanId=7f9b16d7f7d5b347, spanParentSpanId=49b4d98b393a623e, nativeHeaders={spanTraceId=[4770babc94e7d760], spanId=[7f9b16d7f7d5b347], spanParentSpanId=[49b4d98b393a623e], spanSampled=[0]}, jms_redelivered=false, X-B3-SpanId=7f9b16d7f7d5b347, X-B3-Sampled=0, X-B3-TraceId=4770babc94e7d760, id=88313bfb-a45d-c9ff-268f-5c2f50e03156, spanSampled=0, jms_messageId=ID:Marcos-MBP.intranet-57777-1537280015474-1:71:1:1:1}]
2018-09-19 15:40:07.904 DEBUG o.s.i.handler.ServiceActivatingHandler : ServiceActivator for [org.springframework.integration.handler.MethodInvokingMessageProcessor#484a98b8] (fileUploadedEventListener.handleError.serviceActivator.handler) received message: ErrorMessage [payload=org.springframework.messaging.MessageHandlingException: nested exception is java.lang.RuntimeException, failedMessage=GenericMessage [payload=FileUploadedEvent(assetId=c9c73263-e05c-4cb0-bf7b-ea2d3b934c13, objectKey=account-id/c9c73263-e05c-4cb0-bf7b-ea2d3b934c13, bucketName=platform-asset-storage-dev, accountId=account-id, fileName=unknown, userId=1), headers={jms_destination=queue://Consumer.dev-platform-asset-previews.VirtualTopic.file-uploaded, _type=FileUploadedEvent, priority=4, jms_timestamp=1537368007815, spanTraceId=4770babc94e7d760, spanId=7f9b16d7f7d5b347, spanParentSpanId=49b4d98b393a623e, nativeHeaders={spanTraceId=[4770babc94e7d760], spanId=[b72c67f61de7c366], spanParentSpanId=[7f9b16d7f7d5b347], spanSampled=[0], X-B3-TraceId=[4770babc94e7d760], X-B3-SpanId=[b72c67f61de7c366], X-B3-ParentSpanId=[7f9b16d7f7d5b347], X-B3-Sampled=[0]}, jms_redelivered=false, id=4c6d131e-448e-9863-f84b-7a4a8e563b09, spanSampled=0, jms_messageId=ID:Marcos-MBP.intranet-57777-1537280015474-1:71:1:1:1}], headers={X-B3-ParentSpanId=7f9b16d7f7d5b347, X-B3-Sampled=0, X-B3-TraceId=4770babc94e7d760, id=69a058ce-deed-f3e2-eb20-d4e874171ba6, X-B3-SpanId=b72c67f61de7c366, timestamp=1537368007904}]
2018-09-19 15:40:07.905 DEBUG o.s.i.handler.ServiceActivatingHandler : handler 'ServiceActivator for [org.springframework.integration.handler.MethodInvokingMessageProcessor#484a98b8] (fileUploadedEventListener.handleError.serviceActivator.handler)' produced no reply for request Message: ErrorMessage [payload=org.springframework.messaging.MessageHandlingException: nested exception is java.lang.RuntimeException, failedMessage=GenericMessage [payload=FileUploadedEvent(assetId=c9c73263-e05c-4cb0-bf7b-ea2d3b934c13, objectKey=account-id/c9c73263-e05c-4cb0-bf7b-ea2d3b934c13, bucketName=platform-asset-storage-dev, accountId=account-id, fileName=unknown, userId=1), headers={jms_destination=queue://Consumer.dev-platform-asset-previews.VirtualTopic.file-uploaded, _type=FileUploadedEvent, priority=4, jms_timestamp=1537368007815, spanTraceId=4770babc94e7d760, spanId=7f9b16d7f7d5b347, spanParentSpanId=49b4d98b393a623e, nativeHeaders={spanTraceId=[4770babc94e7d760], spanId=[b72c67f61de7c366], spanParentSpanId=[7f9b16d7f7d5b347], spanSampled=[0], X-B3-TraceId=[4770babc94e7d760], X-B3-SpanId=[b72c67f61de7c366], X-B3-ParentSpanId=[7f9b16d7f7d5b347], X-B3-Sampled=[0]}, jms_redelivered=false, id=4c6d131e-448e-9863-f84b-7a4a8e563b09, spanSampled=0, jms_messageId=ID:Marcos-MBP.intranet-57777-1537280015474-1:71:1:1:1}], headers={X-B3-ParentSpanId=7f9b16d7f7d5b347, X-B3-Sampled=0, X-B3-TraceId=4770babc94e7d760, id=69a058ce-deed-f3e2-eb20-d4e874171ba6, X-B3-SpanId=b72c67f61de7c366, timestamp=1537368007904}]
2018-09-19 15:40:07.905 DEBUG o.s.integration.handler.LoggingHandler : _org.springframework.integration.errorLogger.handler received message: ErrorMessage [payload=org.springframework.messaging.MessageHandlingException: nested exception is java.lang.RuntimeException, failedMessage=GenericMessage [payload=FileUploadedEvent(assetId=c9c73263-e05c-4cb0-bf7b-ea2d3b934c13, objectKey=account-id/c9c73263-e05c-4cb0-bf7b-ea2d3b934c13, bucketName=platform-asset-storage-dev, accountId=account-id, fileName=unknown, userId=1), headers={jms_destination=queue://Consumer.dev-platform-asset-previews.VirtualTopic.file-uploaded, _type=FileUploadedEvent, priority=4, jms_timestamp=1537368007815, spanTraceId=4770babc94e7d760, spanId=7f9b16d7f7d5b347, spanParentSpanId=49b4d98b393a623e, nativeHeaders={spanTraceId=[4770babc94e7d760], spanId=[b72c67f61de7c366], spanParentSpanId=[7f9b16d7f7d5b347], spanSampled=[0], X-B3-TraceId=[4770babc94e7d760], X-B3-SpanId=[b72c67f61de7c366], X-B3-ParentSpanId=[7f9b16d7f7d5b347], X-B3-Sampled=[0]}, jms_redelivered=false, id=4c6d131e-448e-9863-f84b-7a4a8e563b09, spanSampled=0, jms_messageId=ID:Marcos-MBP.intranet-57777-1537280015474-1:71:1:1:1}], headers={X-B3-ParentSpanId=7f9b16d7f7d5b347, X-B3-Sampled=0, X-B3-TraceId=4770babc94e7d760, id=69a058ce-deed-f3e2-eb20-d4e874171ba6, X-B3-SpanId=b72c67f61de7c366, timestamp=1537368007904}]
2018-09-19 15:40:07.906 ERROR o.s.integration.handler.LoggingHandler : org.springframework.messaging.MessageHandlingException: nested exception is java.lang.RuntimeException, failedMessage=GenericMessage [payload=FileUploadedEvent(assetId=c9c73263-e05c-4cb0-bf7b-ea2d3b934c13, objectKey=account-id/c9c73263-e05c-4cb0-bf7b-ea2d3b934c13, bucketName=platform-asset-storage-dev, accountId=account-id, fileName=unknown, userId=1), headers={jms_destination=queue://Consumer.dev-platform-asset-previews.VirtualTopic.file-uploaded, _type=FileUploadedEvent, priority=4, jms_timestamp=1537368007815, spanTraceId=4770babc94e7d760, spanId=7f9b16d7f7d5b347, spanParentSpanId=49b4d98b393a623e, nativeHeaders={spanTraceId=[4770babc94e7d760], spanId=[b72c67f61de7c366], spanParentSpanId=[7f9b16d7f7d5b347], spanSampled=[0], X-B3-TraceId=[4770babc94e7d760], X-B3-SpanId=[b72c67f61de7c366], X-B3-ParentSpanId=[7f9b16d7f7d5b347], X-B3-Sampled=[0]}, jms_redelivered=false, id=4c6d131e-448e-9863-f84b-7a4a8e563b09, spanSampled=0, jms_messageId=ID:Marcos-MBP.intranet-57777-1537280015474-1:71:1:1:1}]
at org.springframework.integration.handler.MethodInvokingMessageProcessor.processMessage(MethodInvokingMessageProcessor.java:107)
at org.springframework.integration.handler.ServiceActivatingHandler.handleRequestMessage(ServiceActivatingHandler.java:93)
at org.springframework.integration.handler.AbstractReplyProducingMessageHandler$AdvisedRequestHandler.handleRequestMessage(AbstractReplyProducingMessageHandler.java:182)
[...]
Caused by: java.lang.RuntimeException
at FileUploadedEventListener.handleFileUploadedEvent(FileUploadedEventListener.kt:35)
at FileUploadedEventListener$$FastClassBySpringCGLIB$$eb75a593.invoke(<generated>)
[...]
at org.springframework.messaging.handler.invocation.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:181)
at org.springframework.messaging.handler.invocation.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:114)
at org.springframework.integration.util.MessagingMethodInvokerHelper$HandlerMethod.invoke(MessagingMethodInvokerHelper.java:1056)
at org.springframework.integration.util.MessagingMethodInvokerHelper.invokeHandlerMethod(MessagingMethodInvokerHelper.java:574)
at org.springframework.integration.util.MessagingMethodInvokerHelper.processInternal(MessagingMethodInvokerHelper.java:468)
at org.springframework.integration.util.MessagingMethodInvokerHelper.process(MessagingMethodInvokerHelper.java:312)
at org.springframework.integration.handler.MethodInvokingMessageProcessor.processMessage(MethodInvokingMessageProcessor.java:104)
... 29 more
2018-09-19 15:40:07.907 DEBUG o.s.i.channel.PublishSubscribeChannel : postSend (sent=true) on channel 'errorChannel', message: ErrorMessage [payload=org.springframework.messaging.MessageHandlingException: nested exception is java.lang.RuntimeException, failedMessage=GenericMessage [payload=FileUploadedEvent(assetId=c9c73263-e05c-4cb0-bf7b-ea2d3b934c13, objectKey=account-id/c9c73263-e05c-4cb0-bf7b-ea2d3b934c13, bucketName=platform-asset-storage-dev, accountId=account-id, fileName=unknown, userId=1), headers={jms_destination=queue://Consumer.dev-platform-asset-previews.VirtualTopic.file-uploaded, _type=FileUploadedEvent, priority=4, jms_timestamp=1537368007815, spanTraceId=4770babc94e7d760, spanId=7f9b16d7f7d5b347, spanParentSpanId=49b4d98b393a623e, nativeHeaders={spanTraceId=[4770babc94e7d760], spanId=[b72c67f61de7c366], spanParentSpanId=[7f9b16d7f7d5b347], spanSampled=[0], X-B3-TraceId=[4770babc94e7d760], X-B3-SpanId=[b72c67f61de7c366], X-B3-ParentSpanId=[7f9b16d7f7d5b347], X-B3-Sampled=[0]}, jms_redelivered=false, id=4c6d131e-448e-9863-f84b-7a4a8e563b09, spanSampled=0, jms_messageId=ID:Marcos-MBP.intranet-57777-1537280015474-1:71:1:1:1}], headers={X-B3-ParentSpanId=7f9b16d7f7d5b347, X-B3-Sampled=0, X-B3-TraceId=4770babc94e7d760, id=69a058ce-deed-f3e2-eb20-d4e874171ba6, X-B3-SpanId=b72c67f61de7c366, timestamp=1537368007904}]
fun inboundChannel() = MessageChannels.queue().get()
It's because you are using a QueueChannel - you need DirectChannel if you want the exception to be thrown back to inbound channel adapter so the message will be requeued.
With a queue channel, the poller will simply send the exception to the error channel.
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