Riak Java Client Error

Kelly McLaughlin kelly at basho.com
Wed Mar 30 15:59:02 EDT 2011


Muhammad,

I think the problem you're running into is that the value must be specified
as a byte array.

Try this:

    RiakObject o = new RiakObject("mybucket", "mykey", (new
String("myvalue")).getBytes());

I think that should do it.

Kelly



On Wed, Mar 30, 2011 at 1:09 PM, Muhammad Yousaf
<muhammad.yousaf at live.com>wrote:

>
> Hi Russel ,
>
> Thanks a lot for your help that was soo helpful. But unfortunately i got
> another error on creating object of riak object on following code
>
> import com.basho.riak.client.RiakClient;
> import com.basho.riak.client.RiakObject;
> import com.basho.riak.client.response.FetchResponse;
>
> public class RiakTest {
>
>     public static void main(String[] args) {
>
>         // connect
>         RiakClient riak = new RiakClient("http://localhost:8098/riak");
>
>         // create object
>         RiakObject o = new RiakObject("mybucket", "mykey", "myvalue");
>
>         // store
>         riak.store(o);
>     }
> }
>
>
> *Exception in thread "main" java.lang.Error: Unresolved compilation
> problem: *
> * The constructor RiakObject(String, String, String) is undefined*
>
> any idea how can i solve this ?
>
>
> thanks
> Regards,
>
> Muhammad Yousaf
>
>
> _______________________________________________
> riak-users mailing list
> riak-users at lists.basho.com
> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20110330/ad239187/attachment.html>


More information about the riak-users mailing list