Search code examples
javajcrjackrabbit

jackrabbit: UnsupportedRepositoryOperationException when working with NodeTypeManager


I'm working with Apache Jackrabbit using JCR. I want to create and register new Node Type according to Example Page. My problem is that i got UnsupportedRepositoryOperationException exception when calling createNodeTypeTemplate method.. Here is my JCR sample

Repository repository = new URLRemoteRepository("http://localhost:8080/rmi");
Session session = repository.login(new SimpleCredentials("admin","admin".toCharArray()));
NodeTypeManager nodeTypeManager = session.getWorkspace().getNodeTypeManager();
NodeTypeTemplate nodeType = nodeTypeManager.createNodeTypeTemplate();

Based on documentation the exception will throw if implementation does not support node type registration. But Jackrabbit example page shows that it support the registering new node types.So where is the problem?


Solution

  • This is likely because this operation is not implemented in the RMI remoting.