You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by Christian Schneider <ch...@die-schneider.net> on 2022/01/24 16:14:06 UTC

Problem with vault validation

We are trying to use the vault validation to validate content packages via
the sling feature analyzer.
https://github.com/apache/sling-org-apache-sling-feature-analyser

When validating the wknd package we get the below error:

[ERROR] Failed to execute goal
com.adobe.aem:aemanalyser-maven-plugin:1.3.1-SNAPSHOT:analyse
(default-analyse) on project aemanalyser-maven-plugin-it-wknd-test: A
fatal error occurred whil e analysing the features, see error cause:
Exception in validator 'jackrabbit-nodetypes' while validating file
'apps/wknd/components/accordion/_cq_editConfig.xml' (line 3, column
37): Coul d not create node type information for path
'/apps/wknd/components/accordion/cq:editConfig': Invalid node name
'cq:editConfig': cq: is not a registered namespace prefix.


It seems I have to somehow add the aem-sdk-api jar to be able to resolve
the node types.
How can I provide the node types to the vault validation?

Regards,

Christian


-- 
-- 
Christian Schneider
http://www.liquid-reality.de

Computer Scientist
http://www.adobe.com

Re: Problem with vault validation

Posted by Carsten Ziegeler <cz...@apache.org>.
JCR requires the namespaces to be registered/known if you use them as 
part of a node name. A node name like cq:xyz uses the namespace prefix 
cq, therefore it needs to be known to JCR when creating the node.

If you add a namespace definition to the XML file then you implicitely 
make this namespace known to JCR - but it seems the validator should 
somehow know these "standard" namespaces.

Regards
Carsten

Am 25.01.2022 um 09:22 schrieb Roy Teeuwen:
> Hey Christian,
> 
> I have the same annoying issue, it seems that when you format the xml file in for example Intellij IDEA, it will delete the cq namespace because there is no property in the xml that starts with cq:, but on the other hand it also seems the validator expects the namespace cq to be defined because the actual filename starts with cq: and so it is part of a namespace...
> 
> Didn't find a nice solution yet where I can format the file without losing the cq namespace if there are no properties, what I do as a workaround is just define cq:Title="Edit Config" as dummy property to keep the namespace on formatting
> 
> Greets,
> Roy
> 
>> On 24 Jan 2022, at 17:14, Christian Schneider <ch...@die-schneider.net> wrote:
>>
>> We are trying to use the vault validation to validate content packages via
>> the sling feature analyzer.
>> https://github.com/apache/sling-org-apache-sling-feature-analyser
>>
>> When validating the wknd package we get the below error:
>>
>> [ERROR] Failed to execute goal
>> com.adobe.aem:aemanalyser-maven-plugin:1.3.1-SNAPSHOT:analyse
>> (default-analyse) on project aemanalyser-maven-plugin-it-wknd-test: A
>> fatal error occurred whil e analysing the features, see error cause:
>> Exception in validator 'jackrabbit-nodetypes' while validating file
>> 'apps/wknd/components/accordion/_cq_editConfig.xml' (line 3, column
>> 37): Coul d not create node type information for path
>> '/apps/wknd/components/accordion/cq:editConfig': Invalid node name
>> 'cq:editConfig': cq: is not a registered namespace prefix.
>>
>>
>> It seems I have to somehow add the aem-sdk-api jar to be able to resolve
>> the node types.
>> How can I provide the node types to the vault validation?
>>
>> Regards,
>>
>> Christian
>>
>>
>> -- 
>> -- 
>> Christian Schneider
>> http://www.liquid-reality.de
>>
>> Computer Scientist
>> http://www.adobe.com
> 

-- 
Carsten Ziegeler
Adobe
cziegeler@apache.org

Re: Problem with vault validation

Posted by Roy Teeuwen <ro...@teeuwen.be>.
Hey Christian,

I have the same annoying issue, it seems that when you format the xml file in for example Intellij IDEA, it will delete the cq namespace because there is no property in the xml that starts with cq:, but on the other hand it also seems the validator expects the namespace cq to be defined because the actual filename starts with cq: and so it is part of a namespace...

Didn't find a nice solution yet where I can format the file without losing the cq namespace if there are no properties, what I do as a workaround is just define cq:Title="Edit Config" as dummy property to keep the namespace on formatting

Greets,
Roy

> On 24 Jan 2022, at 17:14, Christian Schneider <ch...@die-schneider.net> wrote:
> 
> We are trying to use the vault validation to validate content packages via
> the sling feature analyzer.
> https://github.com/apache/sling-org-apache-sling-feature-analyser
> 
> When validating the wknd package we get the below error:
> 
> [ERROR] Failed to execute goal
> com.adobe.aem:aemanalyser-maven-plugin:1.3.1-SNAPSHOT:analyse
> (default-analyse) on project aemanalyser-maven-plugin-it-wknd-test: A
> fatal error occurred whil e analysing the features, see error cause:
> Exception in validator 'jackrabbit-nodetypes' while validating file
> 'apps/wknd/components/accordion/_cq_editConfig.xml' (line 3, column
> 37): Coul d not create node type information for path
> '/apps/wknd/components/accordion/cq:editConfig': Invalid node name
> 'cq:editConfig': cq: is not a registered namespace prefix.
> 
> 
> It seems I have to somehow add the aem-sdk-api jar to be able to resolve
> the node types.
> How can I provide the node types to the vault validation?
> 
> Regards,
> 
> Christian
> 
> 
> -- 
> -- 
> Christian Schneider
> http://www.liquid-reality.de
> 
> Computer Scientist
> http://www.adobe.com