title: Create a new mixin in sling
body: <p>I am having trouble create a new custom type to the jackrabbit in apache sling using the below code. This worked fine straight on Jackrabbit but not on Apache Sling. Am I doing this correctly for sling? Thanks</p>
  
  <p>The following code gives me a "javax.jcr.InvalidItemStateException: Conflict". I am using a standalone sling and am the only user so there is definitely no conflict.</p>
  
  <pre><code>Repository repository = JcrUtils.getRepository("http://localhost:8080/server");
  
  Session session = repository.login(new SimpleCredentials("admin", "admin".toCharArray()));
  
  NamespaceRegistry registry = session.getWorkspace().getNamespaceRegistry();
  registry.registerNamespace("my", "http://my.com/v1.0");
  
  CndImporter.registerNodeTypes(new FileReader("C:\\test.cnd"), session);
  </code></pre>