Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

NPE with CatalogPageNotFoundFilter.doFilter exception in CIF Custom Product SlingModel

Avatar

Level 3

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

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

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.

View solution in original post

1 Reply

Avatar

Correct answer by
Employee Advisor

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.