Expand my Community achievements bar.

AEM-6.5.8 - SAX parser exception when installing an index via package manager/build

Avatar

Level 10

Hello Everyone,

 

While trying to install a package with an index , i get the following error .. but exporting it via package manager and importing it works.

Via build process i get the following error 
/oak:index (org.xml.sax.SAXParseException; systemId: file:///C:/Users/......./jcr_root/_oak_index/.content.xml; lineNumber: 964; columnNumber: 68; The prefix "sling" for element "sling:OrderedFolder" is not bound.)




<custom
jcr:primaryType="oak:QueryIndexDefinition"
async="[async]"
compatVersion="{Long}2"
evaluatePathRestrictions="{Boolean}true"
includedPaths="[/conf/global/settings/dam/adminui-extension/metadataprofile]"
reindex="{Boolean}false"
reindexCount="{Long}6"
type="lucene">
<indexRules jcr:primaryType="nt:unstructured">
<sling:OrderedFolder jcr:primaryType="nt:unstructured">
<properties jcr:primaryType="nt:unstructured">
<jcrTitle
jcr:primaryType="nt:unstructured"
boost="{Long}2"
name="jcr:content/jcr:title"
nodeScopeIndex="{Boolean}true"
propertyIndex="{Boolean}true"
type="String"
useInSpellcheck="{Boolean}true"
useInSuggest="{Boolean}true"/>
</properties>
</sling:OrderedFolder>
</indexRules>
</custom>

9 Replies

Avatar

Employee Advisor

I have followed your oak index structure but I didn't face any issue while installation via package manager -

 

.content.xml associated with jcr_root -

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:rep="internal"
jcr:mixinTypes="[rep:AccessControllable,rep:RepoAccessControllable]"
jcr:primaryType="rep:root"
sling:resourceType="sling:redirect"
sling:target="/index.html"/>

 

.content.xml associated with _oak_index -

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:oak="http://jackrabbit.apache.org/oak/ns/1.0" 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:rep="internal"
jcr:mixinTypes="[rep:AccessControllable]"
jcr:primaryType="nt:unstructured">
<socialLucene/>
<workflowDataLucene/>
<slingeventJob/>
<jcrLanguage/>
<versionStoreIndex/>
<repMembers/>
<cqReportsLucene/>
<commerceLucene/>
<counter/>
<authorizables/>
<enablementResourceName/>
<externalPrincipalNames/>
<cmLucene/>
<cqProjectLucene/>
<ntFolderDamLucene/>
<acPrincipalName/>
<uuid/>
<damAssetLucene/>
<rep:policy/>
<cqPayloadPath/>
<nodetypeLucene/>
<nodetype/>
<ntBaseLucene/>
<reference/>
<customLucene/>
<debalcustom
jcr:primaryType="oak:QueryIndexDefinition"
async="[async]"
compatVersion="{Long}2"
evaluatePathRestrictions="{Boolean}true"
includedPaths="[/conf/global/settings/dam/adminui-extension/metadataprofile]"
reindex="{Boolean}false"
reindexCount="{Long}0"
seed="{Long}-694108638461017097"
type="lucene">
<indexRules jcr:primaryType="nt:unstructured">
<sling:OrderedFolder jcr:primaryType="nt:unstructured">
<properties jcr:primaryType="nt:unstructured">
<jcrTitle
jcr:primaryType="nt:unstructured"
boost="{Long}2"
name="jcr:content/jcr:title"
nodeScopeIndex="{Boolean}true"
propertyIndex="{Boolean}true"
type="String"
useInSpellcheck="{Boolean}true"
useInSuggest="{Boolean}true"/>
</properties>
</sling:OrderedFolder>
</indexRules>
</debalcustom>
<principalName/>
<cqTagLucene/>
<lucene/>
<repTokenIndex/>
<externalId/>
<authorizableId/>
<cqPageLucene/>
</jcr:root>

 

DEBAL_DAS_0-1646889683050.png

 

Tested on AEM 6.5.9

Avatar

Level 10

Thanks a lot @DEBAL_DAS  and i see the exact same behavior .. via mvn build process of the package is when i see issue with sling:Folder.Also changing to nt:folder helped but i want it to be a sling:OrderedFolder

Avatar

Level 10

I think i may have stumped on a solution . It cries for prefix so giving it one
<jcr:root xmlns:oak="http://jackrabbit.apache.org/oak/ns/1.0" xmlns:dam="http://www.day.com/dam/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:rep="internal"
jcr:mixinTypes="[rep:AccessControllable]"
jcr:primaryType="nt:unstructured">

Avatar

Employee Advisor

I didn't face the above said issue with mvn build.

I have placed sample custom index here

DEBAL_DAS_0-1647106827432.png

 

Updated ui.apps filter.xml with <filter root="/oak:index/debalcustom"/> as shown below -

DEBAL_DAS_1-1647106885522.png

 

maven build was successful - 

DEBAL_DAS_2-1647107005280.png

 

Are you planning to include your custom oak index within  /oak:index into your deployment package? If yes , then please follow @Jörg_Hoh suggestion here https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/getting-maven-build-error-...

 

 

 

Avatar

Level 10

Hi , as stated the index html checked in for two indices that weren’t sling folder had no namespace. Adding this new index with sling folder created troubles, since the namespace was missing 

this is the cause that is fixed 

thanks all and you @DEBAL_DAS  ,.. you’ve been pretty helpful most of the time 

Avatar

Level 10

@DEBAL_DAS  have you tried the approach of not including custom index into oak index? I somehow missed this and I think it’s a good idea to keep it away from oak index

Avatar

Employee Advisor

Are you expecting to have following entry <filter root="/oak:index"/> in filter.xml as shown below -

 

DEBAL_DAS_0-1647265347815.png

 

My build was successful. In my project we aren't committing oak:index.

Avatar

Level 10

I have below in my filter file. The oak:index/content.xml file has entries for damassetlucene index as well with custom properties.

NitroHazeDev_3-1647268033318.png

 



NitroHazeDev_2-1647267983790.png

 

NitroHazeDev_1-1647267868506.png

 

NitroHazeDev_0-1647267824513.png