AEM as Cloud Service :: Custom oak index | Community
Skip to main content
Level 2
November 9, 2021
Solved

AEM as Cloud Service :: Custom oak index

  • November 9, 2021
  • 2 replies
  • 5580 views

We tried creating a custom oak:index

I have placed Index under apps/_oak_index.

 

I am using below filter

<filter root="/oak:index" mode="update"/>

 

I have set allowIndexDefinitions as true.

Jackrabbit FileVault Package Plugin used as below in the all POM

 

 

<groupId>org.apache.jackrabbit</groupId>
<artifactId>filevault-package-maven-plugin</artifactId>
<extensions>true</extensions>
<version>1.1.6</version>

 

Error :-

[ERROR] ValidationViolation: "jackrabbit-packagetype: Package of type 'APPLICATION' is not supposed to contain Oak index definitions but has 'allowIndexDefinitions' set to true.", filePath=META-INF\vault\properties.xml
[ERROR] ValidationViolation: "jackrabbit-packagetype: Package of type 'APPLICATION' is not supposed to contain content outside '/libs' and '/apps'!", filePath=jcr_root\_oak_index, nodePath=/oak:index
[ERROR] ValidationViolation: "jackrabbit-packagetype: Package of type 'APPLICATION' is not supposed to contain content outside '/libs' and '/apps'!", filePath=jcr_root\_oak_index\.content.xml, nodePath=/oak:index/cqPageLucene-custom-1/aggregates/cq:PageContent/include2, line=33
[ERROR] ValidationViolation: "jackrabbit-packagetype: Package of type 'APPLICATION' is not supposed to contain content outside '/libs' and '/apps'!", filePath=jcr_root\_oak_index\.content.xml, nodePath=/oak:index/cqPageLucene-custom-1/aggregates/cq:PageContent/include1, line=30
[ERROR] ValidationViolation: "jackrabbit-packagetype: Package of type 'APPLICATION' is not supposed to contain content outside '/libs' and '/apps'!", filePath=jcr_root\_oak_index\.content.xml, nodePath=/oak:index/cqPageLucene-custom-1/aggregates/cq:PageContent, line=24

 

We don't want to downgrade the filevault version to 1.0.4, as we start encountering the below mentioned known issue with version 1.0.4 :-

https://www.mail-archive.com/search?l=dev@jackrabbit.apache.org&q=subject:%22%5C%5Bjira%5C%5D+%5C%5BCommented%5C%5D+%5C%28JCRVLT%5C-355%5C%29+False+error+in+case+embedded+file%5C%2Fsubpackage+is+overwritten+by+jcrRootSourceDirectory%22&o=newest&f=1

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by evancooperman-rp

I figured out how to handle this without downgrading.  Hopefully this helps you out too!

You can actually resolve this issue without having to downgrade to version 1.0.4 of the filevault plugin.  The latest versions of the validator do take this situation into account (3.5.x) and you can override the filevault plugin to use a newer version of the validator.  Unfortunately filevault-package-maven-plugin version 1.1.6 does not include the latest validator, so you'll have to override that one dependency.  To do this, in the root pom.xml, you need to update the validator dependency within the filevault plugin:

<dependency>
<groupId>org.apache.jackrabbit.vault</groupId>
<artifactId>vault-validation</artifactId>
<version>3.5.6</version>
</dependency>

 and then you also need to include the custom config that allows the oak:index node:

<validatorsSettings>
<jackrabbit-packagetype>
<options>
<immutableRootNodeNames>apps,libs,oak:index</immutableRootNodeNames>
</options>
</jackrabbit-packagetype>
</validatorSettings>

By doing both of these things, you should be able to continue using version 1.1.6 of the filevault plugin, and still deploy your oak indexes without downgrading.

If I had to guess, I'd say in the coming months, they will probably release an updated version of the filevault plugin that does utilize the latest from the validator plugin, but until then this works great.

Full plugin configuration:

<plugin>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>filevault-package-maven-plugin</artifactId>
<extensions>true</extensions>
<version>1.1.6</version>
<configuration>
<filterSource>src/main/content/META-INF/vault/filter.xml</filterSource>
<validatorsSettings>
<jackrabbit-packagetype>
<options>
<immutableRootNodeNames>apps,libs,oak:index</immutableRootNodeNames>
</options>
</jackrabbit-packagetype>
<jackrabbit-nodetypes>
<options>
<!-- use the nodetypes and namespaces from the aem-nodetypes.jar provided in the plugin dependencies -->
<cnds>tccl:aem.cnd</cnds>
</options>
</jackrabbit-nodetypes>
</validatorsSettings>
</configuration>
<dependencies>
<dependency>
<groupId>org.apache.jackrabbit.vault</groupId>
<artifactId>vault-validation</artifactId>
<version>3.5.6</version>
</dependency>
<dependency>
<groupId>biz.netcentric.aem</groupId>
<artifactId>aem-nodetypes</artifactId>
<version>6.5.7.0</version>
</dependency>
</dependencies>
</plugin>

 Hope this helps!  It took me a moment to sort all of this out, but I'm very glad I didn't have to go back to version 1.0.4 of the filevault plugin, as that would have come with another set of errors with our filters that were resolved in more current versions.

Best,

Evan

2 replies

Asutosh_Jena_
Community Advisor
Community Advisor
November 12, 2021

Hi @parakh 

 

Please use the below link to convert the custom index definition into AEM as Cloud Service compatible OAK index definition and it will be deployed after that.

 

https://github.com/adobe/aem-cloud-service-source-migration/blob/master/packages/index-converter/README.md

 

Thanks!

parakhAuthor
Level 2
November 12, 2021

We have created the index specially for Cloud, its not being migrated from on-prem.

The issue is with the filevault version we are using (1.1.6).

Which throws error :-

 

ValidationViolation: "jackrabbit-packagetype: Package of type 'APPLICATION' is not supposed to contain Oak index definitions but has 'allowIndexDefinitions' set to true.", filePath=META-INF\vault\properties.xml
[ERROR] ValidationViolation: "jackrabbit-packagetype: Package of type 'APPLICATION' is not supposed to contain content outside '/libs' and '/apps'!"

 

[ERROR] ValidationViolation: "jackrabbit-packagetype: Package of type 'APPLICATION' is not supposed to contain content outside '/libs' and '/apps'!", filePath=jcr_root\_oak_index, nodePath=/oak:index

 

The issue resolves when we downgrade to 1.0.4, but we cannot do that because of known issue :-

https://www.mail-archive.com/search?l=dev@jackrabbit.apache.org&q=subject:%22%5C%5Bjira%5C%5D+%5C%5BCommented%5C%5D+%5C%28JCRVLT%5C-355%5C%29+False+error+in+case+embedded+file%5C%2Fsubpackage+is+overwritten+by+jcrRootSourceDirectory%22&o=newest&f=1

evancooperman-rpAccepted solution
Level 3
December 1, 2021

I figured out how to handle this without downgrading.  Hopefully this helps you out too!

You can actually resolve this issue without having to downgrade to version 1.0.4 of the filevault plugin.  The latest versions of the validator do take this situation into account (3.5.x) and you can override the filevault plugin to use a newer version of the validator.  Unfortunately filevault-package-maven-plugin version 1.1.6 does not include the latest validator, so you'll have to override that one dependency.  To do this, in the root pom.xml, you need to update the validator dependency within the filevault plugin:

<dependency>
<groupId>org.apache.jackrabbit.vault</groupId>
<artifactId>vault-validation</artifactId>
<version>3.5.6</version>
</dependency>

 and then you also need to include the custom config that allows the oak:index node:

<validatorsSettings>
<jackrabbit-packagetype>
<options>
<immutableRootNodeNames>apps,libs,oak:index</immutableRootNodeNames>
</options>
</jackrabbit-packagetype>
</validatorSettings>

By doing both of these things, you should be able to continue using version 1.1.6 of the filevault plugin, and still deploy your oak indexes without downgrading.

If I had to guess, I'd say in the coming months, they will probably release an updated version of the filevault plugin that does utilize the latest from the validator plugin, but until then this works great.

Full plugin configuration:

<plugin>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>filevault-package-maven-plugin</artifactId>
<extensions>true</extensions>
<version>1.1.6</version>
<configuration>
<filterSource>src/main/content/META-INF/vault/filter.xml</filterSource>
<validatorsSettings>
<jackrabbit-packagetype>
<options>
<immutableRootNodeNames>apps,libs,oak:index</immutableRootNodeNames>
</options>
</jackrabbit-packagetype>
<jackrabbit-nodetypes>
<options>
<!-- use the nodetypes and namespaces from the aem-nodetypes.jar provided in the plugin dependencies -->
<cnds>tccl:aem.cnd</cnds>
</options>
</jackrabbit-nodetypes>
</validatorsSettings>
</configuration>
<dependencies>
<dependency>
<groupId>org.apache.jackrabbit.vault</groupId>
<artifactId>vault-validation</artifactId>
<version>3.5.6</version>
</dependency>
<dependency>
<groupId>biz.netcentric.aem</groupId>
<artifactId>aem-nodetypes</artifactId>
<version>6.5.7.0</version>
</dependency>
</dependencies>
</plugin>

 Hope this helps!  It took me a moment to sort all of this out, but I'm very glad I didn't have to go back to version 1.0.4 of the filevault plugin, as that would have come with another set of errors with our filters that were resolved in more current versions.

Best,

Evan

Level 3
December 1, 2021

1 small note, it looks like you do still need to add 

<allowIndexDefinitions>true</allowIndexDefinitions>

in your ui.apps pom.xml.  You don't need to do that to get it to pass the package type validation, but you do need it to pass the jackrabbit-oakindex validator!