title: CuratorTransaction KeeperErrorCode = NoNode
body: <p>I'm trying to write data to ZooKeeper using transaction in the Apache Curator library in Java.</p>
  
  <p>Here's my code:</p>
  
  <pre><code>private CuratorFramework client;
  ...
  private void writeToZK() {
      String nodePath = "/path/to/node";
      client.inTransaction().create().forPath(nodePath).and().commit(); // problem
  }
  </code></pre>
  
  <p>(I'm using curator v2.9.0)</p>
  
  <p>This throws:</p>
  
  <pre><code>org.apache.zookeeper.KeeperException$NoNodeException: KeeperErrorCode = NoNode
      at org.apache.zookeeper.KeeperException.create(KeeperException.java:111)
      at org.apache.zookeeper.ZooKeeper.multiInternal(ZooKeeper.java:949)
      at org.apache.zookeeper.ZooKeeper.multi(ZooKeeper.java:915)
  </code></pre>
  
  <p>I dug into ZooKeeper.multiInternal(), it got zookeeper response containing</p>
  
  <pre><code>OpResult: err = -101, type = -1.
  </code></pre>
  
  <p>If I replace the "// problem" line with this, it works:</p>
  
  <pre><code>client.create().creatingParentsIfNeeded().forPath(nodePath); // runs with no problem
  </code></pre>
  
  <p>Any idea?</p>