jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Lustig <tho...@futuredesign.at>
Subject ClientNodeTypeManager cannot be cast to JackrabbitNodeTypeManager
Date Mon, 16 Aug 2010 09:42:55 GMT
Hi all,

I am using Jackrabbit 2.1 connecting to server via RMI:

........ snippet ....
repository = new RMIRemoteRepository("//localhost/jackrabbit.repository");
........

I used this example directly from Jackrabbit site:
http://jackrabbit.apache.org/node-types.html#NodeTypes-RegisteringNodeTypes

........ snippet ....
JackrabbitNodeTypeManager manager = (JackrabbitNodeTypeManager)
                session.getWorkspace().getNodeTypeManager();
         // Register the custom node types defined in the CND file
         manager.registerNodeTypes(new FileInputStream(cndFileName),
                JackrabbitNodeTypeManager.TEXT_X_JCR_CND);
........

when i run this, i get the following Error:
java.lang.ClassCastException: 
org.apache.jackrabbit.rmi.client.ClientNodeTypeManager cannot be cast to 
org.apache.jackrabbit.api.JackrabbitNodeTypeManager

I read that it is important to use ServerAdapterFactory and 
ClientAdapterFactory classes, but i do not know how.
Can anyone tell me how to get the ebove code working?

Please help me, its very important for me to register new node types

best regards
thomas



Mime
View raw message