ConstraintViolationException in initial content loading

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

ConstraintViolationException in initial content loading

Gert Vanthienen-2
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

Reply | Threaded
Open this post in threaded view
|

Re: ConstraintViolationException in initial content loading

Alexander Klimetschek
On Mon, Jul 21, 2008 at 4:19 PM, Gert Vanthienen <[hidden email]> 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
[hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: ConstraintViolationException in initial content loading

Carsten Ziegeler
Alexander Klimetschek wrote:

> On Mon, Jul 21, 2008 at 4:19 PM, Gert Vanthienen <[hidden email]> 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
[hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: ConstraintViolationException in initial content loading

Alexander Klimetschek
On Mon, Jul 21, 2008 at 5:36 PM, Carsten Ziegeler <[hidden email]> 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
[hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: ConstraintViolationException in initial content loading

gertv
In reply to this post by Alexander Klimetschek
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 <[hidden email]> 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
>
>
>  


Reply | Threaded
Open this post in threaded view
|

Re: ConstraintViolationException in initial content loading

Carsten Ziegeler
In reply to this post by Alexander Klimetschek
Alexander Klimetschek wrote:
> On Mon, Jul 21, 2008 at 5:36 PM, Carsten Ziegeler <[hidden email]> 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
[hidden email]