Jackson (the JSON library we use and the thing throwing that error) requires your class to have a no-arg constructor so it can instantiate it via reflection.
See: http://stackoverflow.com/questions/7625783/jsonmappingexception-no-suitable-constructor-found-for-type-simple-type-class Thanks, - Roach On Tue, Nov 11, 2014 at 11:43 AM, Ebbinge <edwinpanad...@gmail.com> wrote: > Hello, I am trying to get the MapReduce to run using my cluster. I have a > 3-node cluster[192.168.0.41,192.168.0.42,192.168.0.43] up and running. > > I am trying with this example: > > try{ > IRiakClient client = RiakFactory.pbcClient("192.168.0.41", > 8087); > Bucket myBucket = client.fetchBucket("Productos").execute();//I > ALREADY HAVE DATA IN A BUCKET CALLED 'PRODUCTOS'. > BucketMapReduce m = client.mapReduce("Productos"); > m.addMapPhase(new NamedJSFunction("Riak.mapValuesJson"), true); > MapReduceResult result = m.execute(); > System.out.println(result.getResultRaw()); > Collection<Producto> tmp = result.getResult(Producto.class); > for (Producto p : tmp) { > System.out.println(p.Nombre); > } > client.shutdown(); > } > > catch(Exception Ex){ > System.out.println(Ex.getMessage()); > } > > > I am getting the following error message: > com.fasterxml.jackson.databind.JsonMappingException: No suitable constructor > found for type [simple type, class Clases.Producto]: can not instantiate > from JSON object (need to add/enable type information?) > at [Source: [B@9e493eb; line: 1, column: 2] > > I have a "Producto" class which has the following: > > public String ID; > public String Nombre; > public String Descripcion; > public String Vendedor; > public String Url; > public String Precio; > > The MAIN objective I want to get to by using MapReduce is to get the top ten > words use to describe the products in the cluster, this is then MapReducing > the String Descripcion. > > > > -- > View this message in context: > http://riak-users.197444.n3.nabble.com/MapReduce-Java-RIAK-API-tp4032050.html > Sent from the Riak Users mailing list archive at Nabble.com. > > _______________________________________________ > riak-users mailing list > riak-users@lists.basho.com > http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com _______________________________________________ riak-users mailing list riak-users@lists.basho.com http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com