Java Client and Data types

Chris Meiklejohn cmeiklejohn at basho.com
Wed Jan 21 05:34:11 EST 2015


On Tue, Jan 20, 2015 at 7:59 PM, Annette Bieniusa <bieniusa at cs.uni-kl.de> wrote:
> Hello,
>
> I am trying to build a small demo app involving the Java Client and the Data types by following the official documentation.
> However, map operations are not working. A fetch with the Java client always returns an empty map, writes create new maps, but they remain empty.
> In the source file that I attached, this yields a null pointer exception when doing the getRegister() in getLastName, for example.

Hi Annette,

I've loaded this code, and when I execute it, I'm getting exceptions
when getVisits() is being called, however, when it's being called,
it's before that field is created -- the constructor of User only sets
the first and last name attributes.  Removing that call prevents the
NullPointerException.

java.lang.NullPointerException
 at com.basho.riak.client.core.query.crdt.types.RiakMap.getCounter(RiakMap.java:133)
 at com.basho.riak.client.core.query.crdt.types.RiakMap.getCounter(RiakMap.java:150)
 at com.basho.riak.playground.User.getVisits(User.java:106)
 at com.basho.riak.playground.Main.main(Main.java:27)

Removing the getVisits call, yields the following execution:

Builder,Bob

- Chris




More information about the riak-users mailing list