Exception in thread "main" java.lang.IllegalStateException: Target host must not be null, or set in parameters.
at org.apache.http.impl.client.DefaultRequestDirector.determineRoute(DefaultRequestDirector.java:784)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:414)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:805)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:784)
at com.myapp.client.EhCacheClientHelper.getEhCacheJsonResponseString(EhCacheClientHelper.java:22)
at com.myapp.client.EhCachePostClient.main(EhCachePostClient.java:19)

What am I doing wrong?

All I want to do is create a sample cache in ehCache, post some type of JSON object to it, and then retrieve it using curl command.

Is this a hard thing to do? What I am missing (in terms of implementation, configuration, etc.)?

Because I just want to use the ehCache to do it... I got ehCache working with REST. I don't care about scalability.

I really don't understand why no one was able to answer this question (how can I post JSON from a Restful Web Service to ehCache)? If posting JSON to ehCache from a RESTful Web Service is too difficult to answer, than I might have to drop ehCache from the requirements list and look at other solutions (memcache and / or Google's solution).

Please answer the question at hand and stop suggesting other alternatives like the Terracotta Server.