You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by Gert Vanthienen <ge...@anova.be> on 2008/07/21 16:19:46 UTC

ConstraintViolationException in initial content loading

L.S.,

After a few months of radio silence, we are picking up the Sling-based 
console for ServiceMix again.  With the 2.0.2-SNAPSHOT release of Sling, 
we managed to create a bundle to install the initial content for our 
application, which looks like this:
/apps
  /servicemix
    /dashboard/html.esp
    /exchanges/html.esp
    /navigation/html.esp
/content/servicemix.json

The JSON file contains something like
{
   "jcr:primaryType":"nt:unstructured",
   "sling:resourceType":"servicemix/dashboard",
  
   "exchanges":{
      "jcr:primaryType":"nt:unstructured",
      "sling:resourceType":"servicemix/exchanges"
   },
  
   "navigation":{
      "jcr:primaryType":"nt:unstructured",
      "sling:resourceType":"servicemix/navigation"
   }
}

If we deploy the bundle on Sling now (built from trunk this morning), we 
get this exception:
org.apache.servicemix.smx-sling.servicemix-sling-console (42)] 
org.apache.sling.jcr.contentloader.internal.Loader Cannot load i
nitial content for bundle 
org.apache.servicemix.smx-sling.servicemix-sling-console : no definition 
found in parent node's node type for new node: no matching child node 
definiti
on found for {}servicemix 
javax.jcr.nodetype.ConstraintViolationException: no definition found in 
parent node's node type for new node: no matching child node definition 
found f
or {}servicemix: no matching child node definition found for {}servicemix

I guess something has changed in between versions.  What has changed and 
what do we need to change to get this initial content loaded again?


Thanks,

Gert Vanthienen

Re: ConstraintViolationException in initial content loading

Posted by Carsten Ziegeler <cz...@apache.org>.
Alexander Klimetschek wrote:
> On Mon, Jul 21, 2008 at 5:36 PM, Carsten Ziegeler <cz...@apache.org> wrote:
>> I'm wondering if we should create "sling:Folder" instead of an nt:folder by
>> default?
> 
> +1
> 
> as probably everyone using Sling with the WebDAV development style
> will run into the nt:folder vs. nt:unstructured issue
> 
Done.

Carsten


-- 
Carsten Ziegeler
cziegeler@apache.org

Re: ConstraintViolationException in initial content loading

Posted by Alexander Klimetschek <ak...@day.com>.
On Mon, Jul 21, 2008 at 5:36 PM, Carsten Ziegeler <cz...@apache.org> wrote:
> I'm wondering if we should create "sling:Folder" instead of an nt:folder by
> default?

+1

as probably everyone using Sling with the WebDAV development style
will run into the nt:folder vs. nt:unstructured issue

Regards,
Alex

-- 
Alexander Klimetschek
alexander.klimetschek@day.com

Re: ConstraintViolationException in initial content loading

Posted by Carsten Ziegeler <cz...@apache.org>.
Alexander Klimetschek wrote:
> On Mon, Jul 21, 2008 at 4:19 PM, Gert Vanthienen <ge...@anova.be> wrote:
>> /apps
>>  /servicemix
>>   /dashboard/html.esp
>>   /exchanges/html.esp
>>   /navigation/html.esp
>> /content/servicemix.json
> 
>> ...
> 
>> javax.jcr.nodetype.ConstraintViolationException:
>> no definition found in parent node's node type for new node: no matching
>> child node definition found f
>> or {}servicemix: no matching child node definition found for {}servicemix
> 
> Looks like the /content folder is just an nt:folder - and thus does
> not allow an nt:unstructured child node such as servicemix. You could
> add nt:unstructured as a mixin for the /content folder.
> 
I'm wondering if we should create "sling:Folder" instead of an nt:folder 
by default?

Carsten

-- 
Carsten Ziegeler
cziegeler@apache.org

Re: ConstraintViolationException in initial content loading

Posted by Gert Vanthienen <ge...@skynet.be>.
Alex,

Thanks for your help!  We managed to get this working again by adding a 
.json file to specify the correct node types for the /content and /apps 
folder.

Regards,

Gert

Alexander Klimetschek wrote:
> On Mon, Jul 21, 2008 at 4:19 PM, Gert Vanthienen <ge...@anova.be> wrote:
>   
>> /apps
>>  /servicemix
>>   /dashboard/html.esp
>>   /exchanges/html.esp
>>   /navigation/html.esp
>> /content/servicemix.json
>>     
>
>   
>> ...
>>     
>
>   
>> javax.jcr.nodetype.ConstraintViolationException:
>> no definition found in parent node's node type for new node: no matching
>> child node definition found f
>> or {}servicemix: no matching child node definition found for {}servicemix
>>     
>
> Looks like the /content folder is just an nt:folder - and thus does
> not allow an nt:unstructured child node such as servicemix. You could
> add nt:unstructured as a mixin for the /content folder.
>
>
> Regards,
> Alex
>
>
>   


Re: ConstraintViolationException in initial content loading

Posted by Alexander Klimetschek <ak...@day.com>.
On Mon, Jul 21, 2008 at 4:19 PM, Gert Vanthienen <ge...@anova.be> wrote:
> /apps
>  /servicemix
>   /dashboard/html.esp
>   /exchanges/html.esp
>   /navigation/html.esp
> /content/servicemix.json

> ...

> javax.jcr.nodetype.ConstraintViolationException:
> no definition found in parent node's node type for new node: no matching
> child node definition found f
> or {}servicemix: no matching child node definition found for {}servicemix

Looks like the /content folder is just an nt:folder - and thus does
not allow an nt:unstructured child node such as servicemix. You could
add nt:unstructured as a mixin for the /content folder.


Regards,
Alex


-- 
Alexander Klimetschek
alexander.klimetschek@day.com