"_cq_editConfig.xml" is throwing a SAX parse exception in CQ 6.1 | Adobe Higher Education
Skip to main content
Level 2
October 16, 2015
Resuelto

"_cq_editConfig.xml" is throwing a SAX parse exception in CQ 6.1

  • October 16, 2015
  • 17 respuestas
  • 3881 visualizaciones

Hi,

While trying to install component which was created for 5.6  is throwing an error an exception in CQ 6.1. Please find the trace below.

    18.09.2015 09:07:19.868 *ERROR* [qtp383669503-68] org.apache.jackrabbit.vault.fs.impl.io.GenericArtifactHandler Error while parsing jcr_root/apps/my-foundation/components/content/events/myCalendar/_cq_editConfig.xml: {}
org.xml.sax.SAXException: null
    at org.apache.jackrabbit.vault.fs.impl.io.DocViewSAXImporter.startElement(DocViewSAXImporter.java:653)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDriver.scanRootElementHook(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)

 

And our "_cq_editConfig.xml" looks like :

<?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"
          cq:actions="[text:myCalendar/_cq_editConfig:,edit,delete]"
          cq:dialogMode="floating"
          cq:disableTargeting="true"
          cq:layout="editbar">
    <cq:listeners
        jcr:primaryType="cq:EditListenersConfig"
        afteredit="REFRESH_PAGE"/>
    </jcr:root>

Any pointers to solve this would be a great help.

 

Thanks and Regards,

Kallada

Este tema ha sido cerrado para respuestas.
Mejor respuesta de Kunal_Gaba_

You are missing primaryType property definition on the root node. Try the below XML and it should work- 

<?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" cq:actions="[text:myCalendar/_cq_editConfig:,edit,delete]" cq:dialogMode="floating" cq:disableTargeting="true" cq:layout="editbar"jcr:primaryType="cq:EditConfig"> <cq:listeners jcr:primaryType="cq:EditListenersConfig" afteredit="REFRESH_PAGE"/> </jcr:root>

17 respuestas

Lokesh_Shivalingaiah
Level 10
October 16, 2015

my-foundation/components/page/detail -  is each one of these nodes are 'nt:folder' ?

Level 2
October 16, 2015

kunal23 wrote...

From the exception stack trace it seems that you are trying to create a "cq:Dialog" type node(tab_data_source) under path "/apps/my-foundation/components/page/detail" which is of type "nt:folder". As per "nt:folder" node type definition in CRX you can not create direct child nodes of type "cq:Dialog". You need to change the node type of "detail" node to "nt:unstructured" to fix this. 

 

 

Hi Kuanl,

Just gave a try to change the type of "detail" under "page".

Since this "detail" was not deployable in 6.1,  I had to remove the "detail" folder form the source code level first. This time it seems our legacy code deployed in 6.1 (I didn't done any detailed checks though). After this I tried to create a new "detail" of type "nt:unstructured". But the system is not allowing to create "detail" . In the process we are are getting the following error.

Could not save changes. Received 409 (Conflict) for saving changes in workspace crx.default. OakConstraint0001: /apps/my-foundation/components/page[[nt:folder]]: No matching definition found for child node detail with effective type [nt:unstructured]

Thanks,

Level 2
October 16, 2015

Hi Loki,

Sorry I'm not sure if this is a duplicate post, something had hapend to my browser.

Yes I'm working with the same component, the xml looks like (based on the previous suggestion)

<?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" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
          jcr:primaryType="cq:Dialog"
          title="Data Source"
          xtype="panel">
    <items jcr:primaryType="cq:WidgetCollection">
        <datasource
                jcr:primaryType="cq:Widget"
                collapsed="{Boolean}false"
                collapsible="{Boolean}false"
                title="Data Source"
                xtype="dialogfieldset">
            <items jcr:primaryType="cq:WidgetCollection">
                <canonical
                        jcr:primaryType="cq:Widget"
                        fieldLabel="Client Libaries"
                        name="./my-client-libs"
                        xtype="textfield"/>
                <rootclass
                        jcr:primaryType="cq:Widget"
                        fieldLabel="Root Class"
                        name="./my-root-class"
                        xtype="textfield"/>
            </items>
        </datasource>
    </items>
</jcr:root>

And the Exceptions looks like :

javax.jcr.nodetype.ConstraintViolationException: OakConstraint0001: /apps/my-foundation/components/page/detail[[nt:folder]]: No matching definition found for child node tab_data_source with effective type [cq:Dialog]
    at org.apache.jackrabbit.oak.api.CommitFailedException.asRepositoryException(CommitFailedException.java:225)
    at org.apache.jackrabbit.oak.api.CommitFailedException.asRepositoryException(CommitFailedException.java:212)
    at org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate.newRepositoryException(SessionDelegate.java:594)
    at org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate.save(SessionDelegate.java:461)
    at org.apache.jackrabbit.oak.jcr.session.SessionImpl$8.perform(SessionImpl.java:435)
    at org.apache.jackrabbit.oak.jcr.session.SessionImpl$8.perform(SessionImpl.java:432)

.....................................................

Caused by: org.apache.jackrabbit.oak.api.CommitFailedException: OakConstraint0001: /apps/cet-foundation/components/page/detail[[nt:folder]]: No matching definition found for child node tab_data_source with effective type [cq:Dialog]
    at org.apache.jackrabbit.oak.plugins.nodetype.TypeEditor.constraintViolation(TypeEditor.java:150)
    at org.apache.jackrabbit.oak.plugins.nodetype.TypeEditor.childNodeChanged(TypeEditor.java:259)
    at org.apache.jackrabbit.oak.plugins.nodetype.TypeEditor.childNodeAdded(TypeEditor.java:210)
    at org.apache.jackrabbit.oak.spi.commit.VisibleEditor.childNodeAdded(VisibleEditor.java:93)
    at org.apache.jackrabbit.oak.spi.commit.CompositeEditor.childNodeAdded(CompositeEditor.java:108)
    at org.apache.jackrabbit.oak.spi.commit.EditorDiff.childNodeAdded(EditorDiff.java:116)

Thanks

Level 2
October 16, 2015

Hi Loki,

I is the same component, I have just tried the changes suggested. 

 

<?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" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
          jcr:primaryType="cq:Dialog"
          title="Data Source"
          xtype="panel">
    <items jcr:primaryType="cq:WidgetCollection">
        <datasource
                jcr:primaryType="cq:Widget"
                collapsed="{Boolean}false"
                collapsible="{Boolean}false"
                title="Data Source"
                xtype="dialogfieldset">
            <items jcr:primaryType="cq:WidgetCollection">
                <canonical
                        jcr:primaryType="cq:Widget"
                        fieldLabel="Client Libaries"
                        name="./my-client-libs"
                        xtype="textfield"/>
                <rootclass
                        jcr:primaryType="cq:Widget"
                        fieldLabel="Root Class"
                        name="./my-root-class"
                        xtype="textfield"/>
            </items>
        </datasource>
    </items>
</jcr:root>

 

 

But, again this is not showing any issues in 5.6.1. 

Thanks, san

Kunal_Gaba_
October 16, 2015

I think you need to register/install the custom node type named "tab_data_source" you might have created in 5.6 instance. 

Level 2
October 16, 2015

bsloki wrote...

my-foundation/components/page/detail -  is each one of these nodes are 'nt:folder' ?

 

Yes loki, the primary type of each of these nodes are, nt:folder.

I have verified it from my CQ 5.6 instance.

Thanks

Lokesh_Shivalingaiah
Level 10
October 16, 2015

Make sure the nodeType of the parent Node where the tab is created is compatible with the nodeType of your tab_data_source

Can you post the XML of your component so that we can trace out

Kunal_Gaba_
October 16, 2015

From the exception stack trace it seems that you are trying to create a "cq:Dialog" type node(tab_data_source) under path "/apps/my-foundation/components/page/detail" which is of type "nt:folder". As per "nt:folder" node type definition in CRX you can not create direct child nodes of type "cq:Dialog". You need to change the node type of "detail" node to "nt:unstructured" to fix this. 

Lokesh_Shivalingaiah
Level 10
October 16, 2015

Is it for the same component or different ? can you post your updated XML with which you are trying

Kunal_Gaba_
Kunal_Gaba_Respuesta
October 16, 2015

You are missing primaryType property definition on the root node. Try the below XML and it should work- 

<?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" cq:actions="[text:myCalendar/_cq_editConfig:,edit,delete]" cq:dialogMode="floating" cq:disableTargeting="true" cq:layout="editbar"jcr:primaryType="cq:EditConfig"> <cq:listeners jcr:primaryType="cq:EditListenersConfig" afteredit="REFRESH_PAGE"/> </jcr:root>