You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by Julian Reschke <ju...@gmx.de> on 2006/10/31 17:45:35 UTC

SPI: ClassCastException in jcr2spi's NodeState

Hi,

I did mention that I'm working on an SPI implementation for an existing 
store, and trying to get it up with jcr2spi, right?

Anyway, in the meantime I can login to my store, and get the root node; 
so far, so good.

If I now try hasNodes(), I'm getting the ClassCastException below...:

java.lang.ClassCastException
	at 
org.apache.jackrabbit.jcr2spi.state.NodeState$ChildNodeEntries.get(NodeState.java:1509)
	at 
org.apache.jackrabbit.jcr2spi.state.NodeState$ChildNodeEntries.access$1(NodeState.java:1507)
	at 
org.apache.jackrabbit.jcr2spi.state.NodeState.assertAvailability(NodeState.java:196)
	at org.apache.jackrabbit.jcr2spi.state.NodeState.<init>(NodeState.java:131)
	at 
org.apache.jackrabbit.jcr2spi.state.WorkspaceItemStateFactory.createNodeState(WorkspaceItemStateFactory.java:155)
	at 
org.apache.jackrabbit.jcr2spi.state.WorkspaceItemStateFactory.createNodeState(WorkspaceItemStateFactory.java:121)
	at 
org.apache.jackrabbit.jcr2spi.state.entry.UUIDReference.doResolve(UUIDReference.java:83)
	at 
org.apache.jackrabbit.jcr2spi.state.entry.ChildItemReference.resolve(ChildItemReference.java:110)
	at 
org.apache.jackrabbit.jcr2spi.state.entry.ChildNodeReference.getNodeState(ChildNodeReference.java:120)
	at 
org.apache.jackrabbit.jcr2spi.state.WorkspaceItemStateFactory.createNodeState(WorkspaceItemStateFactory.java:99)
	at 
org.apache.jackrabbit.jcr2spi.state.CachingItemStateManager.resolve(CachingItemStateManager.java:168)
	at 
org.apache.jackrabbit.jcr2spi.state.CachingItemStateManager.getItemState(CachingItemStateManager.java:94)
	at 
org.apache.jackrabbit.jcr2spi.WorkspaceManager.getItemState(WorkspaceManager.java:328)
	at 
org.apache.jackrabbit.jcr2spi.state.TransientISFactory.createNodeState(TransientISFactory.java:145)
	at 
org.apache.jackrabbit.jcr2spi.state.entry.UUIDReference.doResolve(UUIDReference.java:83)
	at 
org.apache.jackrabbit.jcr2spi.state.entry.ChildItemReference.resolve(ChildItemReference.java:110)
	at 
org.apache.jackrabbit.jcr2spi.state.entry.ChildNodeReference.getNodeState(ChildNodeReference.java:120)
	at 
org.apache.jackrabbit.jcr2spi.ItemManagerImpl.hasChildNodes(ItemManagerImpl.java:205)
	at org.apache.jackrabbit.jcr2spi.NodeImpl.hasNodes(NodeImpl.java:634)


This is because the code casts to "LinkedEntries.LinkNode", but what the 
iterator returns is a UUIDReference. It seems to me that this can't be 
caused by my SPI doing something wrong; just probably different from 
what the other existing implementations do.

Any idea what could be going on here?

Best regards, Julian



Re: SPI: ClassCastException in jcr2spi's NodeState

Posted by Julian Reschke <ju...@gmx.de>.
Angela Schreiber schrieb:
> yes. the idea:
> 
> i quickly hacked the assertAvailability in to have
> a reminder. it doesn't work anyway and i didn't commit
> the latest changes.
> 
> and yes, it was obvious, that you are trying to use
> the spi. but you have to live with completely instable
> code at the moment. it's not finished yet and
> as long as i'm are still committing with 'work in progress'
> comments you can't even rely on the project to compile.

Angela,

it seems that the recent changes in SPI have solved that problem for me.

Thanks.

Re: SPI: ClassCastException in jcr2spi's NodeState

Posted by Julian Reschke <ju...@gmx.de>.
Angela Schreiber schrieb:
> yes. the idea:
> 
> i quickly hacked the assertAvailability in to have
> a reminder. it doesn't work anyway and i didn't commit
> the latest changes.
> 
> and yes, it was obvious, that you are trying to use
> the spi. but you have to live with completely instable
> code at the moment. it's not finished yet and
> as long as i'm are still committing with 'work in progress'
> comments you can't even rely on the project to compile.

Angela,

thanks for the feedback.

I do know that this is work-in-progress, and I didn't intend to 
criticize anybody.

My understanding was that it's A good Thing for SPI if both the 
interfaces and the JCR2SPI layer are tested against other SPI 
implementations -- so that's what I'm doing.

I fully intend to actually help with JCR2SPI once I start understanding 
things, and I think the best way to get there is to actually use it.

So can I proceed by just commenting out that call; or are things more 
complicated than that?

Best regards, Julian





Re: SPI: ClassCastException in jcr2spi's NodeState

Posted by Angela Schreiber <an...@day.com>.
yes. the idea:

i quickly hacked the assertAvailability in to have
a reminder. it doesn't work anyway and i didn't commit
the latest changes.

and yes, it was obvious, that you are trying to use
the spi. but you have to live with completely instable
code at the moment. it's not finished yet and
as long as i'm are still committing with 'work in progress'
comments you can't even rely on the project to compile.

regards
angela