cancel
Showing results for 
Search instead for 
Did you mean: 

Null pointer exception in promotion trail 6.3

former_member674349
Participant
0 Kudos

Hi Experts, I am exploring promotion trails on hybris 6.3 version, I followed all the mention steps. When i wast testing the promotion on last step its giving me null pointer exception. Its because of getCxPromotionActionResults() giving null values.

How to handle this situation.

StackTrace :

SEVERE: Servlet.service() for servlet [DispatcherServlet] in context with path [/yacceleratorstorefront] threw exception [Request processing failed; nested exception is java.lang.NullPointerException] with root cause java.lang.NullPointerException at java.util.AbstractCollection.addAll(AbstractCollection.java:343) at de.hybris.platform.personalizationpromotions.extractor.CxPromotionCartRAOFactExtractor.expandFact(CxPromotionCartRAOFactExtractor.java:37) at de.hybris.platform.ruleengineservices.rao.providers.impl.AbstractExpandedRAOProvider.lambda$3(AbstractExpandedRAOProvider.java:105) at de.hybris.platform.ruleengineservices.rao.providers.impl.AbstractExpandedRAOProvider.lambda$4(AbstractExpandedRAOProvider.java:123) at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184) at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175) at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) at java.util.HashMap$KeySpliterator.forEachRemaining(HashMap.java:1540) at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481) at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471) at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151) at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174) at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418) at de.hybris.platform.ruleengineservices.rao.providers.impl.AbstractExpandedRAOProvider.expandRAO(AbstractExpandedRAOProvider.java:123) at de.hybris.platform.ruleengineservices.rao.providers.impl.DefaultCartRAOProvider.expandRAO(DefaultCartRAOProvider.java:76) at de.hybris.platform.ruleengineservices.rao.providers.impl.DefaultCartRAOProvider.expandRAO(DefaultCartRAOProvider.java:1) at de.hybris.platform.ruleengineservices.rao.providers.impl.AbstractExpandedRAOProvider.expandFactModel(AbstractExpandedRAOProvider.java:66) at de.hybris.platform.ruleengineservices.rao.providers.impl.AbstractExpandedRAOProvider.expandFactModel(AbstractExpandedRAOProvider.java:58) at de.hybris.platform.promotionengineservices.promotionengine.impl.DefaultPromotionEngineService.provideRAOs(DefaultPromotionEngineService.java:200) at de.hybris.platform.promotionengineservices.promotionengine.impl.DefaultPromotionEngineService.prepareContext(DefaultPromotionEngineService.java:168) at de.hybris.platform.promotionengineservices.promotionengine.impl.DefaultPromotionEngineService.evaluate(DefaultPromotionEngineService.java:145) at de.hybris.platform.promotionengineservices.promotionengine.impl.DefaultPromotionEngineService.updatePromotionsNotThreadSafe(DefaultPromotionEngineService.java:315) at de.hybris.platform.promotionengineservices.promotionengine.impl.DefaultPromotionEngineService.updatePromotions(DefaultPromotionEngineService.java:304) at de.hybris.platform.promotionengineservices.promotionengine.impl.DefaultPromotionEngineService.updatePromotions(DefaultPromotionEngineService.java:338) at de.hybris.platform.commerceservices.order.impl.DefaultCommerceCartCalculationStrategy.calculateCart(DefaultCommerceCartCalculationStrategy.java:77) at de.hybris.platform.commerceservices.order.impl.DefaultCommerceCartCalculationStrategy.calculateCart(DefaultCommerceCartCalculationStrategy.java:58) at de.hybris.platform.commerceservices.order.impl.DefaultCommerceDeliveryAddressStrategy.storeDeliveryAddress(DefaultCommerceDeliveryAddressStrategy.java:63) at de.hybris.platform.commerceservices.order.impl.DefaultCommerceCheckoutService.setDeliveryAddress(DefaultCommerceCheckoutService.java:101) at de.hybris.platform.commercefacades.order.impl.DefaultCheckoutFacade.setDeliveryAddressIfAvailable(DefaultCheckoutFacade.java:253) at de.hybris.platform.yacceleratorstorefront.controllers.pages.checkout.steps.DeliveryAddressCheckoutStepController.enterStep(DeliveryAddressCheckoutStepController.java:63) at de.hybris.platform.yacceleratorstorefront.controllers.pages.checkout.steps.DeliveryAddressCheckoutStepController$$FastClassBySpringCGLIB$$f5286c8f.invoke() at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:720) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:85) at de.hybris.platform.acceleratorstorefrontcommons.checkout.steps.validation.QuoteCheckoutStepValidationAspect.validateQuoteCheckoutStep(QuoteCheckoutStepValidationAspect.java:44) 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:629) at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:618) at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:168) at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:85) at de.hybris.platform.acceleratorstorefrontcommons.checkout.steps.validation.CheckoutStepValidationAspect.validateCheckoutStep(CheckoutStepValidationAspect.java:46) 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:629) at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:618) at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:168) 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:655) at de.hybris.platform.yacceleratorstorefront.controllers.pages.checkout.steps.DeliveryAddressCheckoutStepController$$EnhancerBySpringCGLIB$$f1637d7.enterStep() 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.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221) at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136) at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:114) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738) at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:963) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861) at javax.servlet.http.HttpServlet.service(HttpServlet.java:620) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846) at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain.doFilter(AbstractPlatformFilterChain.java:255) at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$StatisticsGatewayFilter.doFilter(AbstractPlatformFilterChain.java:344) at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain.doFilter(AbstractPlatformFilterChain.java:225) at de.hybris.platform.servicelayer.web.SecureMediaFilter.doFilter(SecureMediaFilter.java:111) at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain.doFilter(AbstractPlatformFilterChain.java:225) at de.hybris.platform.assistedservicestorefront.filter.AssistedServiceFilter.doFilterInternal(AssistedServiceFilter.java:86) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain.doFilter(AbstractPlatformFilterChain.java:225) at de.hybris.platform.yacceleratorstorefront.filters.CustomerLocationRestorationFilter.doFilterInternal(CustomerLocationRestorationFilter.java:52) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain.doFilter(AbstractPlatformFilterChain.java:225) at de.hybris.platform.yacceleratorstorefront.filters.CartRestorationFilter.doFilterInternal(CartRestorationFilter.java:64) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain.doFilter(AbstractPlatformFilterChain.java:225) at de.hybris.platform.yacceleratorstorefront.filters.AnonymousCheckoutFilter.doFilterInternal(AnonymousCheckoutFilter.java:36) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain.doFilter(AbstractPlatformFilterChain.java:225) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:317) at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:127) at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:91) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:115) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:137) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:169) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilt

raukuma
Explorer
0 Kudos

,

have you got any workaround ,I am also facing same issue.

Thanks Raushan

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

After doing this there is no null pointer exception but promotion still not coming up, also user are not associating with the user group after they written reviews for the products.

Former Member
0 Kudos

My Bad. Now it's working. Forget to execute couple of steps. Thanks.

Former Member
0 Kudos

Hi Jayant, Hi Raushan,

the reason for the error is a bug/wrong approach in the trail (and in the personalizationpromotions extension). Both extensions declare a userRAOPopulator and instead of adding it to the userRaoConverter declared in ruleengineservices via the modifyPopulatorList bean, both extensions override the userRaoConverter. As the promotionenginetrail extension is loaded last, that userRaoConverter "wins" and becomes the standard userRaoConverter (via its alias declararion). As a result, the personalization specific populator gets "lost" which is the root cause for the nullpointer exception you experience.

Please try to replace this part of the spring.xml file where the userRaoConverter is overridden:

 <alias name="promotionenginetrailUserRaoConverter" alias="userRaoConverter" />
  <bean id="promotionenginetrailUserRaoConverter" parent="abstractPopulatingConverter">
      <property name="targetClass" value="de.hybris.platform.ruleengineservices.rao.UserRAO" />
     <property name="populators">
         <list>
             <ref bean="userRaoPopulator" />
             <ref bean="promotionenginetrailUserRaoPopulator" />
         </list>
     </property>
 </bean>

with this part instead (which just adds the new populator to the existing converter):

 <bean parent="modifyPopulatorList">
     <property name="list" ref="userRaoConverter" />
     <property name="add" ref="promotionenginetrailUserRaoPopulator" />    
 </bean>

The trail will be updated with this as well to prevent more trail users from running into this issue. Thanks for bringing it up and sorry for the inconvenience.

Please let me know if you run into any further issues.

Hope this helps,

Sebastian

former_member357259
Active Contributor
0 Kudos

Hi Jayant,

Which step exactly do you get this exception on? Can you share the link step number?

raukuma
Explorer
0 Kudos

after finishing all the steps,when we go to test the promotion so created new customer and try 2 add one product in cnd getting the above mentioned exception.

Thanks Raushan