1
votes

I have included a component in another component jsp using

<cq:include path="navMenu" resourceType="/apps/project/components/common/testMenu" />

getting the following error :

http://localhost:4502/content/testsite/en/about/jcr:content/headernav/navMenu.infinity.json? 404 (Not Found)

I am having the same issues with all the components when used <cq:include> tag inside another component jsp.

scenario:

  • component1 with sling:resourceSuperType to parentcomponent
  • cq:include subcomponent inside component1
  • page -> drag and drop the component1 or include it.

I appreciate any help on this.

Thank you, Sri

Error: enter image description here

Success - drag and drop individual component enter image description here

1
resourceType is without /apps/, so try to simply use resourceType="project/components/common/testMenu" Then the next question would by, does your component call this JSON? Or when exactly do you get this error? - Thomas
@Thomas I tried without /apps/ but no success. I put an image in my question to give the clarity. This issue happening in a scenario, where multiple components formed inheritance through sling:resourceSuperType and a child component including a common component using cq:include tag. This issue does not happen, if I drag and drop common component onto the page, please see success image. - Sri
this seems like something is missing in the inheritance, e.g. some intermediary nodes are not present. Maybe your inheriting component needs a cq:template where missing nodes are created. - Thomas

1 Answers

1
votes

Try removing the initial "/" like <cq:include path="navMenu" resourceType="apps/project/components/common/testMenu" />

Also give relative path as<cq:include path="navMenu" resourceType="project/components/common/testMenu" />