<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p>If you manage your project with a dependency management tool like
      Maven or Gradle it will download the missing dependency for you,
      in your case you are missing joda-time which you can download
      from:</p>
    <p><a class="moz-txt-link-freetext" href="http://search.maven.org/#artifactdetails%7Cjoda-time%7Cjoda-time%7C2.9.4%7Cjar">http://search.maven.org/#artifactdetails%7Cjoda-time%7Cjoda-time%7C2.9.4%7Cjar</a></p>
    <p>Hope that helps,</p>
    <p>Guido.<br>
    </p>
    <div class="moz-cite-prefix">On 29/10/16 18:45, AJAX DoneBy Jack
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAPfj0ytg4vQ7Z_wqqodtdoe0ewJX4z27eySOv1+qHrb+Gbo1Pw@mail.gmail.com"
      type="cite">Hi Pratik,
      <div><br>
      </div>
      <div>From exception msg you are missing joda time jar, download
        one and put in your classpath.</div>
      <div>If you use maven it <span></span>will download the dependency
        for you automatically.</div>
      <div><br>
      </div>
      <div>Hope this help.</div>
      <div>Ajax <br>
        <br>
        On Friday, 28 October 2016, Pratik Kulkarni <<a
          moz-do-not-send="true" href="mailto:pratik1992@icloud.com">pratik1992@icloud.com</a>>
        wrote:<br>
        <blockquote class="gmail_quote" style="margin:0 0 0
          .8ex;border-left:1px #ccc solid;padding-left:1ex">
          <div style="word-wrap:break-word">Hi All, 
            <div><br>
            </div>
            <div>I am working on a distributed file storage system using
              the Java Netty framework. For this purpose i have Raik KV
              as an in memory  storage solution. </div>
            <div>Following jar dependencies are present in my build path
              : </div>
            <div><span
                style="color:rgb(51,51,51);font-family:Consolas,'Liberation
                Mono',Menlo,Courier,monospace;font-size:13.6px"><br>
              </span></div>
            <div><span
                style="color:rgb(51,51,51);font-family:Consolas,'Liberation
                Mono',Menlo,Courier,monospace;font-size:13.6px">jackson-all-1.8.5.jar</span></div>
            <div><span style="font-family:Consolas,'Liberation
                Mono',Menlo,Courier,monospace;font-size:13.6px;color:rgb(51,51,51)">netty-all-4.0.15.Final.jar</span></div>
            <div><span style="font-family:Consolas,'Liberation
                Mono',Menlo,Courier,monospace;font-size:13.6px;color:rgb(51,51,51)">slf4j-api-1.7.2.jar</span></div>
            <div><span style="font-family:Consolas,'Liberation
                Mono',Menlo,Courier,monospace;font-size:13.6px;color:rgb(51,51,51)">slf4j-simple-1.7.2.jar</span></div>
            <div><span
                style="color:rgb(51,51,51);font-family:Consolas,'Liberation
                Mono',Menlo,Courier,monospace;font-size:13.6px">protobuf-java-2.6.1.jar</span></div>
            <div><span style="font-family:Consolas,'Liberation
                Mono',Menlo,Courier,monospace;font-size:13.6px;color:rgb(51,51,51)">json-20160212.jar</span></div>
            <div><span style="font-family:Consolas,'Liberation
                Mono',Menlo,Courier,monospace;font-size:13.6px;color:rgb(51,51,51)">riak-client-2.0.5.jar</span></div>
            <div><br>
            </div>
            <div>When i try initiate connection with the riak node. The
              connection attempt is successful but when i try to store
              the object in <b>Riak KV.</b> I keep getting the
              following NoClassDefFoundError. I am not sure why these
              errors arrive though i have included all the jars. Do we
              require apart from<b> riak-client X.X jar</b> any more
              dependencies. As per the terminal output I tried to add
              the dependencies by downloading the jars. But it just
              keeps giving me new dependencies error every time.  Kindly
              help ?</div>
            <div><br>
            </div>
            <div><b>Please see the riak client code in java to store the
                file object </b></div>
            <div><br>
            </div>
            <div><br>
            </div>
            <div>
              <div>package gash.router.inmemory;</div>
              <div><br>
              </div>
              <div>import com.basho.riak.client.api.<wbr>RiakClient;</div>
              <div>import com.basho.riak.client.api.<wbr>commands.kv.DeleteValue;</div>
              <div>import com.basho.riak.client.api.<wbr>commands.kv.FetchValue;</div>
              <div>import com.basho.riak.client.api.<wbr>commands.kv.StoreValue;</div>
              <div>import com.basho.riak.client.core.<wbr>RiakCluster;</div>
              <div>import com.basho.riak.client.core.<wbr>RiakNode;</div>
              <div>import com.basho.riak.client.core.<wbr>query.Location;</div>
              <div>import com.basho.riak.client.core.<wbr>query.Namespace;</div>
              <div>import com.basho.riak.client.core.<wbr>query.RiakObject;</div>
              <div>import com.basho.riak.client.core.<wbr>util.BinaryValue;</div>
              <div><br>
              </div>
              <div>import java.net.UnknownHostException;</div>
              <div><br>
              </div>
              <div>public class RiakClientHandler {</div>
              <div><span style="white-space:pre-wrap">    </span></div>
              <div><span style="white-space:pre-wrap">    </span>private
                static RiakCluster setUpCluster() throws
                UnknownHostException{</div>
              <div><span style="white-space:pre-wrap">            </span>// This
                example will use only one node listening on
                localhost:8098--default config</div>
              <div>        </div>
              <div><span style="white-space:pre-wrap">            </span>RiakNode
                node = new RiakNode.Builder()</div>
              <div>                .withRemoteAddress("127.0.0.1"<wbr>)</div>
              <div>                .withRemotePort(8098)<span style="white-space:pre-wrap">       </span></div>
              <div>                .build();</div>
              <div>     // This cluster object takes our one node as an
                argument</div>
              <div>        RiakCluster cluster = new
                RiakCluster.Builder(node)</div>
              <div>                .build();</div>
              <div><br>
              </div>
              <div>        // The cluster must be started to work,
                otherwise you will see errors</div>
              <div>        cluster.start();</div>
              <div><br>
              </div>
              <div>        return cluster;</div>
              <div><span style="white-space:pre-wrap">    </span>}</div>
              <div><span style="white-space:pre-wrap">    </span></div>
              <div><span style="white-space:pre-wrap">    </span>private
                static class RiakFile{</div>
              <div><span style="white-space:pre-wrap">            </span></div>
              <div><span style="white-space:pre-wrap">            </span>public
                String filename;</div>
              <div><span style="white-space:pre-wrap">            </span>public
                byte[] byteData;</div>
              <div><span style="white-space:pre-wrap">    </span>}</div>
              <div><span style="white-space:pre-wrap">    </span></div>
              <div><span style="white-space:pre-wrap">    </span>public
                static void saveFile(String filename,byte[] byteData)</div>
              <div><span style="white-space:pre-wrap">    </span>{</div>
              <div><span style="white-space:pre-wrap">    </span>try{</div>
              <div><span style="white-space:pre-wrap">    </span> 
                  System.out.println("Inside Riak handler");</div>
              <div><span style="white-space:pre-wrap">    </span> 
                  RiakCluster cluster = setUpCluster();</div>
              <div>            RiakClient client = new
                RiakClient(cluster);</div>
              <div>            RiakFile newFile =
                createRiakFile(filename, byteData); </div>
              <div>            System.out.println("Riak file created");</div>
              <div>            Namespace fileBucket = new
                Namespace("files");</div>
              <div>            Location fileLocation = new
                Location(fileBucket, filename);</div>
              <div>            StoreValue storeFile = new
                StoreValue.Builder(newFile).<wbr>withLocation(fileLocation).<wbr>build();</div>
              <div>            client.execute(storeFile);  </div>
              <div>            System.out.println("File saved to riak
                ");</div>
              <div>            cluster.shutdown();</div>
              <div><span style="white-space:pre-wrap">            </span>}</div>
              <div><span style="white-space:pre-wrap">            </span>catch(Exception
                e){</div>
              <div><span style="white-space:pre-wrap">                    </span>e.printStackTrace();</div>
              <div><span style="white-space:pre-wrap">            </span>}</div>
              <div><span style="white-space:pre-wrap">    </span>}</div>
              <div><span style="white-space:pre-wrap">    </span></div>
              <div><span style="white-space:pre-wrap">    </span>private
                static RiakFile createRiakFile(String filename, byte[]
                byteData)</div>
              <div><span style="white-space:pre-wrap">    </span>{</div>
              <div><span style="white-space:pre-wrap">            </span>RiakFile
                file=new RiakFile();</div>
              <div><span style="white-space:pre-wrap">            </span>file.filename=filename;</div>
              <div><span style="white-space:pre-wrap">            </span>file.byteData=byteData;</div>
              <div><span style="white-space:pre-wrap">            </span>return
                file;</div>
              <div><span style="white-space:pre-wrap">                            </span></div>
              <div><span style="white-space:pre-wrap">    </span>}</div>
              <div><span style="white-space:pre-wrap">    </span></div>
              <div><span style="white-space:pre-wrap">    </span></div>
              <div><span style="white-space:pre-wrap">    </span></div>
              <div><br>
              </div>
              <div>}</div>
            </div>
            <div><br>
            </div>
            <div><br>
            </div>
            <div><b>The terminal Output error:</b></div>
            <div><br>
            </div>
            <div><br>
            </div>
            <div><br>
            </div>
            <div><br>
            </div>
            <div><img src="cid:part2.9896F219.45C5E612@temetra.com"
                height="348" width="751"></div>
          </div>
        </blockquote>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
riak-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:riak-users@lists.basho.com">riak-users@lists.basho.com</a>
<a class="moz-txt-link-freetext" href="http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com">http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>