NPE with CatalogPageNotFoundFilter.doFilter exception in CIF Custom Product SlingModel | Community
Skip to main content
ruchim71073425
Level 2
June 10, 2023
Solved

NPE with CatalogPageNotFoundFilter.doFilter exception in CIF Custom Product SlingModel

  • June 10, 2023
  • 1 reply
  • 562 views

Hi,

 

I have created my custom CIF Product Model like this

@Model(adaptables = SlingHttpServletRequest.class, adapters = {Product.class,
CustomCifProduct.class }, resourceType = CustomCifProductImpl.RESOURCE_TYPE)
public class CustomCifProductImpl implements CustomCifProduct {

 

Whenever I include the resourceType in the Model annotation, I get the following exception and nothing shows on the product page

 

11.06.2023 01:05:18.276 *ERROR* [[0:0:0:0:0:0:0:1] [1686409518264] GET /content/brand/au/en/our-products/product.html/url-key.html HTTP/1.1] org.apache.sling.engine.impl.SlingRequestProcessorImpl service: Uncaught Throwable
java.lang.NullPointerException: null
at com.adobe.cq.commerce.core.components.internal.servlets.CatalogPageNotFoundFilter.doFilter(CatalogPageNotFoundFilter.java:114) [com.adobe.commerce.cif.core-cif-components-core:2.12.0]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78) [org.apache.sling.engine:2.7.8]
at com.adobe.cq.commerce.core.components.internal.servlets.SpecificPageFilterFactory.doFilter(SpecificPageFilterFactory.java:87) [com.adobe.commerce.cif.core-cif-components-core:2.12.0]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78) [org.apache.sling.engine:2.7.8]
at com.day.cq.wcm.core.impl.AuthoringUIModeServiceImpl.doFilter(AuthoringUIModeServiceImpl.java:322) [com.day.cq.wcm.cq-wcm-core:5.12.198]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78) [org.apache.sling.engine:2.7.8]
at com.day.cq.wcm.mobile.core.impl.redirect.RedirectFilter.doFilter(RedirectFilter.java:248) [com.day.cq.wcm.cq-wcm-mobile-core:5.11.10]

 

The error goes away when I remove the resource type and everything works fine.

 

The property works fine for all other custom sling models and hence trying to understand what could be the cause and what are the issues if the property is not included?

 

Thanks

Ruchi

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by ManviSharma

Hi,

 

The error you're encountering seems to be related to the CatalogPageNotFoundFilter. Make sure that you have properly configured and set up your CIF product model, including all the necessary dependencies and annotations. Additionally, check if there are any conflicts or issues with other filters or components in your AEM instance that might be causing this error.

1 reply

ManviSharma
Adobe Employee
ManviSharmaAdobe EmployeeAccepted solution
Adobe Employee
June 12, 2023

Hi,

 

The error you're encountering seems to be related to the CatalogPageNotFoundFilter. Make sure that you have properly configured and set up your CIF product model, including all the necessary dependencies and annotations. Additionally, check if there are any conflicts or issues with other filters or components in your AEM instance that might be causing this error.