You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by Eknath Kadam <ek...@yahoo.com> on 2006/09/21 16:08:27 UTC

Registering a custom node

Hi,
I am connecting to a remote repository using jnp and trying to register my own 
node type. But following code throws ClassCastException at line 8.


1 public void registerNodeType(NodeTypeDef nodeTypeDef, Session session) 
throws RepositoryException
2    {
3        //NodeTypeRegistry object
4        Workspace wsp = session.getWorkspace();
5        NodeTypeManager ntMgr = wsp.getNodeTypeManager();
6        
7        //non-JSR 170 - jackrabbit specific
8        NodeTypeRegistry ntReg = 
                ((NodeTypeManagerImpl) ntMgr).getNodeTypeRegistry();
9        ntReg.registerNodeType(nodeTypeDef);
10    }


Thanks in advance
Eknath




Re: Registering a custom node

Posted by Eknath Kadam <ek...@yahoo.com>.
Jukka Zitting <jukka.zitting <at> gmail.com> writes:

> JCR-RMI only supports the standard JCR interfaces, so you can't cast
> the adapters to Jackrabbit-specific classes.
> 


Then is there any other way I can 
register custom nodetypes on a remote repository ?

Thanks,
Eknath


Re: Registering a custom node

Posted by Jukka Zitting <ju...@gmail.com>.
Hi,

On 9/21/06, Eknath Kadam <ek...@yahoo.com> wrote:
> I am connecting to a remote repository using jnp and trying to register my own
> node type. But following code throws ClassCastException at line 8.

JCR-RMI only supports the standard JCR interfaces, so you can't cast
the adapters to Jackrabbit-specific classes.

BR,

Jukka Zitting

-- 
Yukatan - http://yukatan.fi/ - info@yukatan.fi
Software craftsmanship, JCR consulting, and Java development