Expand my Community achievements bar.

SOLVED

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

Avatar

Level 2

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

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

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>

View solution in original post

17 Replies

Avatar

Correct answer by
Employee Advisor

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>

Avatar

Level 10

Can you try with this

<?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>

Avatar

Employee Advisor
That's because the type of page node is "nt:folder". Try changing the nodetype of page node and it should work.

Avatar

Level 2

Thanks loki, the error thrown while installing is gone now!!!

Avatar

Level 2

Thanks kunal, it worked it seems. But these components were perfectly working with 5.6.

Avatar

Level 10

Check the XML in your 5.6 version. Ideally, primaryType is a default/mandatory property that will have when you create any node !

Avatar

Level 2

Sorry all, 

I got it wrong. I'm still getting another form of exception.

com.day.jcr.vault.packaging.PackageException: org.apache.jackrabbit.vault.packaging.PackageException: 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 com.day.jcr.vault.packaging.impl.JrVltJcrPackageAdapter.install(JrVltJcrPackageAdapter.java:109)
    at com.day.crx.packaging.impl.J2EEPackageManager.consoleInstall(J2EEPackageManager.java:329)
    at com.day.crx.packaging.impl.J2EEPackageManager.doPost(J2EEPackageManager.java:171)
    at com.day.crx.packaging.impl.PackageManagerServlet.doPost(PackageManagerServlet.java:144)

Avatar

Level 2

Hi All,

Following the SAX parse exception, we are now facing with :

                                      javax.jcr.nodetype.ConstraintViolationException: No matching node definition found for tab_data_source

in one of our legacy components, Any Idea on this?

Thanks a lot,

Avatar

Level 10

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

Avatar

Level 10

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

Avatar

Employee Advisor

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. 

Avatar

Level 10

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

Avatar

Level 2

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

Avatar

Employee Advisor

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

Avatar

Level 2

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

Avatar

Level 2

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

Avatar

Level 2

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,