Hi folks.
Using resteasy 3.0.5, and I need to set connection and read timeouts on
a request.
Here's the code:
org.apache.http.impl.client.DefaultHttpClient httpClient = new
org.apache.http.impl.client.DefaultHttpClient();
HttpParams params = new org.apache.http.params.BasicHttpParams();
org.apache.http.params.HttpConnectionParams.setConnectionTimeout(params,
4000);
org.apache.http.params.HttpConnectionParams.setSoTimeout(params, 2000);
httpClient.setParams(params);
executor = new
org.jboss.resteasy.client.core.executors.ApacheHttpClient4Executor(httpClient);
ClientRequest clientRequest = new ClientRequest(newPath, executor);
clientRequest = clientRequest.accept(getResponseMediaType())
.body(getRequestMediaType(), request)
.followRedirects(false);
clientRequest = clientRequest.header("headerKey", "headerVal");
T out = clientRequest.post(responseClassType).getEntity();
I'm seeing an NPE when this code is run:
[java] java.lang.NullPointerException
[java] at
org.jboss.resteasy.spi.ResteasyProviderFactory.toHeaderString(ResteasyProviderFactory.java:1263)
[java] at
org.jboss.resteasy.client.ClientRequest.toHeaderString(ClientRequest.java:204)
[java] at
org.jboss.resteasy.client.ClientRequest.getHeaders(ClientRequest.java:329)
[java] at
org.jboss.resteasy.plugins.interceptors.encoding.AcceptEncodingGZIPInterceptor.execute(AcceptEncodingGZIPInterceptor.java:27)
[java] at
org.jboss.resteasy.core.interception.ClientExecutionContextImpl.proceed(ClientExecutionContextImpl.java:47)
[java] at
org.jboss.resteasy.client.ClientRequest.execute(ClientRequest.java:441)
[java] at
org.jboss.resteasy.client.ClientRequest.httpMethod(ClientRequest.java:682)
[java] at
org.jboss.resteasy.client.ClientRequest.post(ClientRequest.java:566)
[java] at
org.jboss.resteasy.client.ClientRequest.post(ClientRequest.java:571)
Any ideas on what I'm doing wrong? I get the error whether I include the
ClientRequest.header() call or not.
Thanks!
--
Jeff Ramin
Software Engineer
Singlewire Software
2601 W Beltline Hwy #510
Madison, WI 53713
Phone Direct - 608.661.1172
www.singlewire.com
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Resteasy-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/resteasy-users