RiakIORuntimeException

Maria Neise maria.neise1 at googlemail.com
Wed Jul 13 12:42:56 EDT 2011


Hey,
I am writing an application with the Java-Api. In my application I try
to get a connection to Riak using the RiakClient in order to insert
some data. Before, I downloaded Riak with wget
http://downloads.basho.com/riak/riak-0.14/riak_0.14.2-1_amd64.deb.
When I start Riak with
sudo riak start I always get attempting to restart script through sudo
-u riak. When I start my application I get an RiakIORuntimeException,
when trying to store a RiakObject. Here is my code:

public class RiakClient extends DB{
	
	com.basho.riak.client.http.RiakClient riakClient;
	
	public void init() throws DBException {
		
		try{
			
			riakClient = new
com.basho.riak.client.http.RiakClient("http://localhost:8090/riak");
			
			
		} catch(Throwable t) {
			t.printStackTrace();
		}
	}

public int insert(String table, String key, HashMap<String, String> values) {
		
		try{
			
			com.basho.riak.client.http.RiakObject myObject = new
com.basho.riak.client.http.RiakObject(table, key);
			
			Iterator it = values.entrySet().iterator();
			while(it.hasNext()){
				
				Map.Entry<String,String> pair = (Map.Entry<String,String>)it.next();
				String entryKey = pair.getKey();
				String entryValue = pair.getValue();
				myObject.addUsermetaItem(entryKey, entryValue);
				
			}
			
			com.basho.riak.client.http.response.StoreResponse storeResponse =
riakClient.store(myObject);
		
			if(!storeResponse.isSuccess()){
				return 1;
			}		
		} catch(Throwable t) {
			t.printStackTrace();
		}
		
		return 0;
		
	}

I also attached a screenshot from the Exception.

I would be grateful for any advice.
Cheers,
Maria
-------------- next part --------------
A non-text attachment was scrubbed...
Name: connection_refused.jpg
Type: image/jpeg
Size: 210256 bytes
Desc: not available
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20110713/a25f628c/attachment.jpg>


More information about the riak-users mailing list