Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.
SOLVED

package installation error dealing with sling:resourceSuperType

Avatar

Level 7

Hi all,

 

I got a lot of errors related to the sling:resourceSuperType while installing the package.

 

I copied /apps/mysite/wcm/foundation/components/basicpage/v1/basicpage to /apps/mysite/wcm/foundation/components/basicpage/v2/basicpage for further implementation without touching v1. the content of basicpage/v2/basicpage/.content.xml:

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
    jcr:primaryType="cq:Component"
    jcr:title="Basic Page"
    sling:resourceSuperType="wcm/foundation/components/basicpage/v1/basicpage"
    componentGroup=".hidden"/>

Then when I run `mvn clean install`, I get a lot of errors as:

org.apache.jackrabbit.vault.fs.io.Importer E /apps/mysite/wcm/foundation/components/basicpage/v2/basicpage (org.xml.sax.SAXParseException; systemId: file:///apps/aem65/jcr_root/apps/mysite/wcm/foundation/components/basicpage/v2/basicpage/.content.xml; lineNumber: 6; columnNumber: 31; The prefix "sling" for attribute "sling:resourceSuperType" associated with an element type "jcr:root" is not bound.)

 

When I got rid of the "sling:resourceSuperType...", the errors are gone. Changing the sling:resourceSuperType location to "/apps/mysite/wcm/foundation/components/basicpage/v1/basicpage" won't work, either. I wonder why <jcr:root...> is unable to have an attribute of "sling:resourceSuperType".

 

Thanks!

 

-kt

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @kevingtan,

Sling namespace is missing in your .content.xml file. You have to add below definition, to solve the problem:

 

xmlns:sling="http://sling.apache.org/jcr/sling/1.0"

 

so your file will look like that:

 

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
    jcr:primaryType="cq:Component"
    jcr:title="Basic Page"
    sling:resourceSuperType="wcm/foundation/components/basicpage/v1/basicpage"
    componentGroup=".hidden"/>

 

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

Hi @kevingtan,

Sling namespace is missing in your .content.xml file. You have to add below definition, to solve the problem:

 

xmlns:sling="http://sling.apache.org/jcr/sling/1.0"

 

so your file will look like that:

 

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
    jcr:primaryType="cq:Component"
    jcr:title="Basic Page"
    sling:resourceSuperType="wcm/foundation/components/basicpage/v1/basicpage"
    componentGroup=".hidden"/>

 

Avatar

Level 7

Thank you!

No wonder some of the xml files don't have such an issue, and they really have the correct namespace.