|
From: Ron S. <rs...@re...> - 2015-04-27 17:10:36
|
Ok, thanks, Jeff.
On 04/27/2015 08:16 AM, Jeff Ramin wrote:
>
> Thanks Ron, but I worked around the problem (by using Resty instead of
> resteasy), and
> I don't have time to work on troubleshooting this problem.
>
>
>
> On 04/25/2015 07:53 PM, Ron Sigal wrote:
>> Hey Jeff,
>>
>> I'm trying to duplicate your problem. I adapted your code in the
>> attached TimeoutTest, but it runs fine.
>>
>> Could you fiddle with TimeoutTest and get it to throw the NPE?
>>
>> Thanks,
>> Ron
>>
>> On 03/20/2015 03:40 PM, Jeff Ramin wrote:
>>> 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!
>>>
>>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>> One dashboard for servers and applications across Physical-Virtual-Cloud
>> Widest out-of-the-box monitoring support with 50+ applications
>> Performance metrics, stats and reports that give you Actionable Insights
>> Deep dive visibility with transaction tracing using APM Insight.
>> http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
>>
>>
>> _______________________________________________
>> Resteasy-users mailing list
>> Res...@li...
>> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>
> --
> Jeff Ramin
> Software Engineer
> Singlewire Software
> 2601 W Beltline Hwy #510
> Madison, WI 53713
>
> Phone Direct - 608.661.1172
> www.singlewire.com
|