You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Juerg Meier <jm...@ctp.com> on 2007/06/06 22:51:05 UTC

Mixin type problem?

Hi,

I've been working with Jackrabbit for some time now (with storage on the file system), but I don't know what's wrong in the following case.

I have the following situation (CND):

[td:place] > nt:base,mix:versionable,td:sourceable
-td:refId (string)
....

[td:sourceable] > mix:versionable
  mixin
-td:source (reference)

[td:source] > nt:base,mix:versionable
-td:refId (string) 
....

Here's the code fragment that adds nodes of type td:source to td:place (n):

	    	...
                                    for (Source source : dto.getSources())
	    	{
	    		Node sourceNode = getSession().getNodeByUUID(source.getId());
	    		n.setProperty("td:source", sourceNode);
	    	}
                  ...

The place-node gets added without exception. However, if I want to retrieve it, it does not appear. It also does not show up in tools such as JcrConverter. And if I try to delete node n, the following exception appears:

    class javax.jcr.nodetype.ConstraintViolationException
    no matching property definition found for {http://mydomain.com/ns/td}source

That's all. As mentioned, I have no clue what goes wrong here, perhaps, and would highly appreciate any hint.

Thanks,
Juerg
Cambridge Technology Partners, Zurich




Re: Mixin type problem?

Posted by Juerg Meier <jm...@ctp.com>.
Yes, td:place is located at the very end of the CND file. And frankly, I cannot imagine that this is a problem, as CND gets compiled into the repository.xml.  And this file gets then parsed by Jackrabbit on startup. Thus, Jackrabbit has anyway all nodetype definitions loaded once it is started. Absolutely, no error messages on creation and save.

-- Juerg

>
> Hi,
>
> I've been working with Jackrabbit for some time now (with storage on the
> file system), but I don't know what's wrong in the following case.
>
> I have the following situation (CND):
>
> [td:place] > nt:base,mix:versionable,td:sourceable
> - td:refId (string)
> ....
>
> [td:sourceable] > mix:versionable
> mixin
> - td:source (reference)
>
> [td:source] > nt:base,mix:versionable
> - td:refId (string)
> ....


Is this the exact sequence of node definitions?.... there are no errors?
Because you should first define td:sourceable before using it in td:place


Jacco



--  
-------------------------------------
Jacco van Weert --  1111software@gmail.com
JCR Controller --  http://www.xs4all.nl/~weertj/jcr



Re: Mixin type problem?

Posted by Jacco van Weert <11...@gmail.com>.
On 6/6/07, Juerg Meier <jm...@ctp.com> wrote:
>
> Hi,
>
> I've been working with Jackrabbit for some time now (with storage on the
> file system), but I don't know what's wrong in the following case.
>
> I have the following situation (CND):
>
> [td:place] > nt:base,mix:versionable,td:sourceable
> -td:refId (string)
> ....
>
> [td:sourceable] > mix:versionable
> mixin
> -td:source (reference)
>
> [td:source] > nt:base,mix:versionable
> -td:refId (string)
> ....


Is this the exact sequence of node definitions?.... there are no errors?
Because you should first define td:sourceable before using it in td:place


Jacco



-- 
-------------------------------------
Jacco van Weert -- 1111software@gmail.com
JCR Controller -- http://www.xs4all.nl/~weertj/jcr

Re: Mixin type problem?

Posted by Stefan Guggisberg <st...@gmail.com>.
hi juerg,

On 6/6/07, Juerg Meier <jm...@ctp.com> wrote:
> Hi,
>
> I've been working with Jackrabbit for some time now (with storage on the file system), but I don't know what's wrong in the following case.
>
> I have the following situation (CND):
>
> [td:place] > nt:base,mix:versionable,td:sourceable
> -td:refId (string)
> ....
>
> [td:sourceable] > mix:versionable
>   mixin
> -td:source (reference)
>
> [td:source] > nt:base,mix:versionable
> -td:refId (string)
> ....
>
> Here's the code fragment that adds nodes of type td:source to td:place (n):
>
>                 ...
>                                     for (Source source : dto.getSources())
>                 {
>                         Node sourceNode = getSession().getNodeByUUID(source.getId());
>                         n.setProperty("td:source", sourceNode);
>                 }
>                   ...
>
> The place-node gets added without exception. However, if I want to retrieve it, it does not appear. It also does not show up in tools such as JcrConverter. And if I try to delete node n, the following exception appears:
>
>     class javax.jcr.nodetype.ConstraintViolationException
>     no matching property definition found for {http://mydomain.com/ns/td}source
>
> That's all. As mentioned, I have no clue what goes wrong here, perhaps, and would highly appreciate any hint.

there's not enough information, sorry. could you please provide a
small test case
(incl. your cnd file) that demonstrates your problem?

cheers
stefan

>
> Thanks,
> Juerg
> Cambridge Technology Partners, Zurich
>
>
>
>