sling-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Edgar Poce" <>
Subject Re: how does the default content mapping work?
Date Fri, 21 Sep 2007 15:17:19 GMT
Hi Felix,

 thanks for your help, It seems that jcr-mapping tries to get a new
ClassDescriptor by calling
classDescriptor.getDescendantClassDescriptor(nodeType) instead of
using the descriptor which maps to the given class.

It seems this problem is related to the inheritance strategy. I tried
to dive into the ocm but I couldn't understand how it works.

Apparently, given that DefaultContent declares an interface
( it uses
NODETYPE_PER_CONCRETECLASS[1], and for mappings with this strategy if
the node's nodetype is not the same than the  from classdescriptor's
nodetype (null for DefaultContent) jcr-mapping tries to get the
descendant descriptor (which is null for DefaultContent)[2] and
jcr-mapping fails with NPE.

[1] see ClassDescriptor.lookupInheritanceSettings()
[2] see ObjectConverterImpl.getObject(Session session, Class clazz,
String path) line 349


On 9/21/07, Felix Meschberger <> wrote:
> Hi Edgar,
> It seems that this issue is probably related to your issue JCR-1142 you
> reported to Jackrabbit. It seems actually, that OCM tries to resolve the
> actual node against another class descriptor (again) without checking
> whether such a descriptor really exists.
> IMHO this is not really correct, because when calling the
> getObject(Session, Class, String) method I expect the object returned to
> be at least assignement compatible to the class I have submitted.
> I will try to find a solution to that problem together with Christophe.
> Regards
> Felix
> Am Freitag, den 21.09.2007, 11:00 -0300 schrieb Edgar Poce:
> > Hi,
> >
> >   I'm running Sling and I'm trying to access the repository's root
> > node from the browser with the following url: http://localhost:8080.
> > According to
> > the default component must resolve the request if there's no custom
> > mapping, however I'm getting "404 not found".
> >
> > the wiki says "If no mapping exists for the given node, an exception
> > is thrown and the request fails." and bellow it says "In such a case
> > of missing content mapping, a default Content mapping is defined in
> > the form of the class".
> > I'm not sure whether the expected behavior is to fail with a 404 error
> > or to process the request with the default component. Any idea?
> >
> > thanks in advance,
> > Edgar

View raw message