You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by Ian Boston <ie...@tfd.co.uk> on 2010/07/02 19:45:05 UTC

sling:Resource mixin

Hi,
I have just updated my dependencies to match trunk head (sorry been fighting fires so needed to be behind trunk), and a lots of the files that used to load via the content loader wont any more. (property def not found)

Has some thing changed recently that now requires the sling:Resource mixin on all nodes ?

Ian

Re: sling:Resource mixin

Posted by Ian Boston <ie...@tfd.co.uk>.
On 2 Jul 2010, at 20:25, Justin Edelson wrote:

> On 7/2/10 2:28 PM, Ian Boston wrote:
>> 
>> On 2 Jul 2010, at 18:56, Justin Edelson wrote:
>> 
>>> On 7/2/10 1:45 PM, Ian Boston wrote:
>>>> Hi,
>>>> I have just updated my dependencies to match trunk head (sorry been fighting fires so needed to be behind trunk), and a lots of the files that used to load via the content loader wont any more. (property def not found)
>>>> 
>>>> Has some thing changed recently that now requires the sling:Resource mixin on all nodes ?
>>>> 
>>>> Ian
>>> There were a number of changes made to the contentloader as part of
>>> SLING-1172, but that shouldn't have done what you are describing. Then
>>> again, I don't entirely understand what you are describing :)
>>> 
>>> Justin
>> 
>> 
>> getting these when loading a json file with sling:resourceType in it 
>> 
>> 02.07.2010 18:23:46.650 *INFO* [SCR Component Actor] org.apache.sling.jcr.contentloader.internal.DefaultContentCreator createFile: Cannot find content type for 404.jsp, using application/octet-stream
>> 02.07.2010 18:23:53.622 *ERROR* [SCR Component Actor] org.apache.sling.jcr.contentloader.internal.Loader Cannot load initial content for bundle org.sakaiproject.nakamura.uxloader : no matching property definition found for {http://sling.apache.org/jcr/sling/1.0}resourceType javax.jcr.nodetype.ConstraintViolationException: no matching property definition found for {http://sling.apache.org/jcr/sling/1.0}resourceType
>> 	at org.apache.jackrabbit.core.nodetype.EffectiveNodeType.getApplicablePropertyDef(EffectiveNodeType.java:782)
>> 	at org.apache.jackrabbit.core.NodeImpl.getApplicablePropertyDefinition(NodeImpl.java:767)
>> 	at org.apache.jackrabbit.core.NodeImpl.getOrCreateProperty(NodeImpl.java:413)
>> 	at org.apache.jackrabbit.core.NodeImpl.setProperty(NodeImpl.java:2354)
>> 	at org.apache.jackrabbit.core.NodeImpl.setProperty(NodeImpl.java:1601)
>> 	at org.apache.jackrabbit.core.NodeImpl.setProperty(NodeImpl.java:2221)
>> 	at org.apache.jackrabbit.core.NodeImpl.setProperty(NodeImpl.java:2187)
>> 	at org.apache.sling.jcr.contentloader.internal.DefaultContentCreator.createProperty(DefaultContentCreator.java:354)
>> 	at org.apache.sling.jcr.contentloader.internal.readers.JsonReader.createProperty(JsonReader.java:227)
>> 	at org.apache.sling.jcr.contentloader.internal.readers.JsonReader.createNode(JsonReader.java:200)
>> 
>> 
> What is the nodetype of the node? I just added a brief test with and
> without the mixins to the test-services module and it *seems* to work
> (I'll commit this later with a test case to verify the results -
> http://codereview.appspot.com/1729048)


its 
nt:unstructured

I think it might be because there is a it has a mixin already ?


{
        "jcr:mixinTypes": ["sakai:propertiesmix"],
        "sling:resourceType": "sakai/pagenavigationcontent",
        "sakai:pagenavigationcontent": "<p><img id=\"widget_navigation_id759008084\" class=\"widget_inline\" style=\"display:block; padding: 10px; margin: 4px\" src=\"/devwidgets/navigation/images/icon.png\" border=\"1\" alt=\"\" /></p><p><img id=\"widget_siterecentactivity_id669827676\" class=\"widget_inline\" style=\"display:block; padding: 10px; margin: 4px\" src=\"/devwidgets/siterecentactivity/images/icon.png\" border=\"1\" alt=\"\" /></p>"
}

adding a sling:Resource to the mixins fixes it.

btw logging could be better perhaps a log warn to identify the file that causes the error
see 
http://codereview.appspot.com/1698048

Not too clean because of the indent.

Ian

> 
> Justin


Re: sling:Resource mixin

Posted by Ian Boston <ie...@tfd.co.uk>.
On 2 Jul 2010, at 20:25, Justin Edelson wrote:
>> 
>> 
> What is the nodetype of the node? I just added a brief test with and
> without the mixins to the test-services module and it *seems* to work
> (I'll commit this later with a test case to verify the results -
> http://codereview.appspot.com/1729048)
> 
> Justin


I think I have found the problem,

http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/contentloader/src/main/java/org/apache/sling/jcr/contentloader/internal/readers/JsonReader.java?r1=958411&r2=927532

we use "name" in our json files to mean the name of the object, not the name of the node.

previously "name" was only used to indicate the name of a principal, however I suspect that it was filtered.

There is another thread running on this so I will comment there. SLING-1172

Thanks
Ian

Re: sling:Resource mixin

Posted by Justin Edelson <ju...@gmail.com>.
On 7/2/10 2:28 PM, Ian Boston wrote:
> 
> On 2 Jul 2010, at 18:56, Justin Edelson wrote:
> 
>> On 7/2/10 1:45 PM, Ian Boston wrote:
>>> Hi,
>>> I have just updated my dependencies to match trunk head (sorry been fighting fires so needed to be behind trunk), and a lots of the files that used to load via the content loader wont any more. (property def not found)
>>>
>>> Has some thing changed recently that now requires the sling:Resource mixin on all nodes ?
>>>
>>> Ian
>> There were a number of changes made to the contentloader as part of
>> SLING-1172, but that shouldn't have done what you are describing. Then
>> again, I don't entirely understand what you are describing :)
>>
>> Justin
> 
> 
> getting these when loading a json file with sling:resourceType in it 
> 
> 02.07.2010 18:23:46.650 *INFO* [SCR Component Actor] org.apache.sling.jcr.contentloader.internal.DefaultContentCreator createFile: Cannot find content type for 404.jsp, using application/octet-stream
> 02.07.2010 18:23:53.622 *ERROR* [SCR Component Actor] org.apache.sling.jcr.contentloader.internal.Loader Cannot load initial content for bundle org.sakaiproject.nakamura.uxloader : no matching property definition found for {http://sling.apache.org/jcr/sling/1.0}resourceType javax.jcr.nodetype.ConstraintViolationException: no matching property definition found for {http://sling.apache.org/jcr/sling/1.0}resourceType
> 	at org.apache.jackrabbit.core.nodetype.EffectiveNodeType.getApplicablePropertyDef(EffectiveNodeType.java:782)
> 	at org.apache.jackrabbit.core.NodeImpl.getApplicablePropertyDefinition(NodeImpl.java:767)
> 	at org.apache.jackrabbit.core.NodeImpl.getOrCreateProperty(NodeImpl.java:413)
> 	at org.apache.jackrabbit.core.NodeImpl.setProperty(NodeImpl.java:2354)
> 	at org.apache.jackrabbit.core.NodeImpl.setProperty(NodeImpl.java:1601)
> 	at org.apache.jackrabbit.core.NodeImpl.setProperty(NodeImpl.java:2221)
> 	at org.apache.jackrabbit.core.NodeImpl.setProperty(NodeImpl.java:2187)
> 	at org.apache.sling.jcr.contentloader.internal.DefaultContentCreator.createProperty(DefaultContentCreator.java:354)
> 	at org.apache.sling.jcr.contentloader.internal.readers.JsonReader.createProperty(JsonReader.java:227)
> 	at org.apache.sling.jcr.contentloader.internal.readers.JsonReader.createNode(JsonReader.java:200)
> 
> 
What is the nodetype of the node? I just added a brief test with and
without the mixins to the test-services module and it *seems* to work
(I'll commit this later with a test case to verify the results -
http://codereview.appspot.com/1729048)

Justin

Re: sling:Resource mixin

Posted by Ian Boston <ie...@tfd.co.uk>.
On 2 Jul 2010, at 18:56, Justin Edelson wrote:

> On 7/2/10 1:45 PM, Ian Boston wrote:
>> Hi,
>> I have just updated my dependencies to match trunk head (sorry been fighting fires so needed to be behind trunk), and a lots of the files that used to load via the content loader wont any more. (property def not found)
>> 
>> Has some thing changed recently that now requires the sling:Resource mixin on all nodes ?
>> 
>> Ian
> There were a number of changes made to the contentloader as part of
> SLING-1172, but that shouldn't have done what you are describing. Then
> again, I don't entirely understand what you are describing :)
> 
> Justin


getting these when loading a json file with sling:resourceType in it 

02.07.2010 18:23:46.650 *INFO* [SCR Component Actor] org.apache.sling.jcr.contentloader.internal.DefaultContentCreator createFile: Cannot find content type for 404.jsp, using application/octet-stream
02.07.2010 18:23:53.622 *ERROR* [SCR Component Actor] org.apache.sling.jcr.contentloader.internal.Loader Cannot load initial content for bundle org.sakaiproject.nakamura.uxloader : no matching property definition found for {http://sling.apache.org/jcr/sling/1.0}resourceType javax.jcr.nodetype.ConstraintViolationException: no matching property definition found for {http://sling.apache.org/jcr/sling/1.0}resourceType
	at org.apache.jackrabbit.core.nodetype.EffectiveNodeType.getApplicablePropertyDef(EffectiveNodeType.java:782)
	at org.apache.jackrabbit.core.NodeImpl.getApplicablePropertyDefinition(NodeImpl.java:767)
	at org.apache.jackrabbit.core.NodeImpl.getOrCreateProperty(NodeImpl.java:413)
	at org.apache.jackrabbit.core.NodeImpl.setProperty(NodeImpl.java:2354)
	at org.apache.jackrabbit.core.NodeImpl.setProperty(NodeImpl.java:1601)
	at org.apache.jackrabbit.core.NodeImpl.setProperty(NodeImpl.java:2221)
	at org.apache.jackrabbit.core.NodeImpl.setProperty(NodeImpl.java:2187)
	at org.apache.sling.jcr.contentloader.internal.DefaultContentCreator.createProperty(DefaultContentCreator.java:354)
	at org.apache.sling.jcr.contentloader.internal.readers.JsonReader.createProperty(JsonReader.java:227)
	at org.apache.sling.jcr.contentloader.internal.readers.JsonReader.createNode(JsonReader.java:200)



Re: sling:Resource mixin

Posted by Justin Edelson <ju...@gmail.com>.
On 7/2/10 1:45 PM, Ian Boston wrote:
> Hi,
> I have just updated my dependencies to match trunk head (sorry been fighting fires so needed to be behind trunk), and a lots of the files that used to load via the content loader wont any more. (property def not found)
> 
> Has some thing changed recently that now requires the sling:Resource mixin on all nodes ?
> 
> Ian
There were a number of changes made to the contentloader as part of
SLING-1172, but that shouldn't have done what you are describing. Then
again, I don't entirely understand what you are describing :)

Justin