Expand my Community achievements bar.

Submissions are now open for the 2026 Adobe Experience Maker Awards.

While adding the metadata node to the Image component I am facing the following issue during the build of Image component's content.xml

Avatar

Level 1

[Fatal Error] :32:114: The prefix "granite" for attribute "granite:class" associated with an element type "dynamicmediaGroup" is not bound. [ERROR] ValidationViolation: "jackrabbit-docviewparser: Invalid XML found: The prefix "granite" for attribute "granite:class" associated with an element type "dynamicmediaGroup" is not bound.", filePath=jcr_root/apps/zb-corporate/components/content/image/.content.xml, nodePath=/apps/zb-corporate/components/content/image

 

Can anyone please suggest on how to resolve it ?

7 Replies

Avatar

Community Advisor

Hi @DeepikaRoy ,

 

Can you share the content.xml file here ?

Avatar

Community Advisor

Hi,

Please check

The prefix "granite" for attribute "granite:class" associated with an element type "dynamicmediaGroup" is not bound.

 

Example of correct XML namespaces
https://github.com/adobe/aem-core-wcm-components/blob/8fbb5674a7170c7caaac1604ac9849eff1ea83a7/conte... 

better to share your dialog xml.

Arun Patidar

AEM LinksLinkedIn

Avatar

Level 1

Hi,

Thank you all for your supporting comments. But, I can't share my dialog xml due to company privacy policies.

Avatar

Community Advisor

@DeepikaRoy  Their is some error in your xml. So if you can share the content.xml file it would be easy

Avatar

Administrator

@DeepikaRoy Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.



Kautuk Sahni

Avatar

Level 1

May be a late reply,

But this could be the issue,

Please check if u have 

xmlns:granite="http://www.adobe.com/jcr/granite/1.0"

in the jcr:root tag of content.xml.

This defines the namespaces for the XML file.

 

for eg: jcr:root tag should be 

<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0"
xmlns:granite="http://www.adobe.com/jcr/granite/1.0"

Avatar

Level 6

The reason why you get The prefix "granite" for attribute "granite:class"  is, when you use XML you need to follow xmls standards. Here you are adding a attribute named "granite:class" and in order to identify this attribute in xml you need to provide a namespace who provides the prefix granite that is nothing but xmlns:granite="http://www.adobe.com/jcr/granite/1.0" . When you add this xml will identify the granite:class attribute and you will not get any error.

 

Solution is, add xmlns:granite="http://www.adobe.com/jcr/granite/1.0attribute in your jcr:root xml.

 

XML should like below and should contain xmlns:granite entry.

<jcr:root xmlns:granite="http://www.adobe.com/jcr/granite/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" jcr:primaryType="cq:Page">

 

@kautuk_sahni  This is the correct answer.

 

Thanks,

Ramesh.