This may have changed in the last couple of months, however my understanding
is there is no way to register new node types using the jackrabbit RMI
client. I resorted to writing a nasty little servlet that reads a local
file to load the node definitions.
Daniel
-----Original Message-----
From: Nicolas Dufour [mailto:nrdufour@gmail.com]
Sent: Thursday, 8 February 2007 7:06 AM
To: users@jackrabbit.apache.org
Subject: New nodeTypes and RMI
Hi
I'm trying to register node types i have written in cnd to a JCR repository
on RMI.
I have trouble to find any documentation about the jackrabbit-jcr-rmi jar.
Do I have to use the class ClientJackrabbitNodeTypeManager and give it a
filename knowing that this piece of code give me an exception :
// Read in the CND file
FileInputStream fis = new FileInputStream(cndFileName);
ClientJackrabbitNodeTypeManager ntmgr
=(ClientJackrabbitNodeTypeManager) ws.getNodeTypeManager();
ntmgr.registerNodeTypes(fis, "toto");
The exception :
java.lang.ClassCastException:
org.apache.jackrabbit.rmi.client.ClientNodeTypeManager cannot be cast to
org.apache.jackrabbit.rmi.jackrabbit.ClientJackrabbitNodeTypeManager
at tips.jcr.NodeTypeRegister.registerCustomNodeTypes(
NodeTypeRegister.java:55)
at tips.jcr.NodeTypeRegister.registerCustomNodeTypesInDefault(
NodeTypeRegister.java:47)
at tips.jcr.NodeTypeRegister.main(NodeTypeRegister.java:105)
Thank you
Nicolas Dufour
|