problem with RiakClient streamBucket method

santhosh venkat santhoshvenkat1988 at gmail.com
Fri Mar 4 06:10:43 EST 2011


Hi Russell ,
                    I am using RiakClient  of version 0.14 .You are
absolutely right,I had a older version of JSON package in my classpath.
Thanks a ton.

--
Santhosh

On Fri, Mar 4, 2011 at 2:46 PM, Russell Brown <russell.brown at mac.com> wrote:

> Hi Santosh,
> On Fri, 2011-03-04 at 12:46 +0530, santhosh venkat wrote:
> > Hi ,
> >       streamBucket  method of RiakClient throws this exception when i
> > tried using it .
> >
> > Exception in thread "main" java.lang.NoSuchMethodError:
> > org.json.JSONTokener.end()
>
> > I used it  exactly in the same way as said in github wiki .
> >
> > Later reading the source Code of riak , Later reading the source Code
> > of riak , I found that the problem lies in StreamedKeysCollection
> > Class of package com.basho.riak.client.response.
>
> >  while (!tokens.end()) {   // -> Method end() is not defined in
> > JSONTokener Class
> >
> >   There is a method named more() defined in JSONTokener Class , I was
> > able to successfully retrieve all the keys when i replaced end()
> > method with more()  .
> >
> > Please throw some light  if i am using the api's wrongly .
> >
>
> This looks like a classpath thing.
>
> Do you have another version of JSON-java on your classpath?
>
> There is an older version of JSON-java available from maven central (eg
> json-20090211.jar) in which JSONTokener has the more() method.
>
> The riak-java-client actually bundles a more recent set of JSON-java
> classes (from Douglas Crockford's githb repo) with the riak client jar,
> this version of JSONTokener has the end() method.
>
> Just to be sure, please can you let me know which version of the
> RiakClient you are using? (And just for good measure, Java version?)
>
> Going forward, I'm debating whether to use maven to manage this
> dependency, or to stay the way things are. Including the JSON classes in
> the jar makes it more standalone, but of course it can lead to exactly
> this sort of issue. Opinions appreciated.
>
>
> >
> > --
> > Santhosh
> >
> >
> >
> >
> >
> >
> > _______________________________________________
> > 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/20110304/3e677b7a/attachment.html>


More information about the riak-users mailing list