Hi Oleg,

My application is reading many other URLs before this one. So maybe
it's a combination of multiple loads.

I will try to dump more when I will get the issue again.

In the meantime, here is how I'm initializing the HttpClient:

// Creation of the HTTP Client
SchemeRegistry schemeRegistry = new SchemeRegistry();
schemeRegistry.register(new Scheme("http", 80,
PlainSocketFactory.getSocketFactory()));
schemeRegistry.register(new Scheme("https", 443,
SSLSocketFactory.getSocketFactory()));
PoolingClientConnectionManager cm = new
PoolingClientConnectionManager(schemeRegistry);
cm.setMaxTotal(200);
cm.setDefaultMaxPerRoute(20);

HttpParams params = new BasicHttpParams();
if (useProxy)
        params.setParameter(ConnRoutePNames.DEFAULT_PROXY, new 
HttpHost("proxy", 80));
client = new DefaultHttpClient(cm, params);
client.getParams().setParameter(CoreConnectionPNames.SO_TIMEOUT, new
Integer(30000));
client.getParams().setParameter(CoreConnectionPNames.CONNECTION_TIMEOUT,
new Integer(30000));
client.getParams().setParameter(CoreConnectionPNames.TCP_NODELAY, false);

It's not the first time I'm getting this exception, so I might be able
to reproduce that in a near futur.

JM

2012/8/1, Oleg Kalnichevski <[email protected]>:
> On Tue, 2012-07-31 at 17:37 -0400, Jean-Marc Spaggiari wrote:
>> Hi,
>>
>> I'm getting the exception below when I'm trying to load
>> http://www.expedia.ca/Sunset-District-Hotels.d163838.Travel-Guide-Hotels
>> ... It's not critical since I'm catching everything, but I'm wondering
>> if this is normal or if this is something which need to be fixed...
>>
>> java.lang.NullPointerException
>>      at
>> org.apache.http.impl.cookie.BestMatchSpec.formatCookies(BestMatchSpec.java:193)
>>      at
>> org.apache.http.client.protocol.RequestAddCookies.process(RequestAddCookies.java:196)
>>      at
>> org.apache.http.protocol.ImmutableHttpProcessor.process(ImmutableHttpProcessor.java:109)
>>      at
>> org.apache.http.protocol.HttpRequestExecutor.preProcess(HttpRequestExecutor.java:176)
>>      at
>> org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:515)
>>      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 org.spaggiari.distparser.CrawlerThread$1.run(CrawlerThread.java:267)
>>
>>
>> --
>> JM
>>
>
> Jean-Marc
>
> I am not able to reproduce the problem just by executing HTTP GET to the
> URL in question. All looks perfectly normal.
>
> [DEBUG] BasicClientConnectionManager - Get connection for route
> {}->http://www.expedia.ca
> [DEBUG] DefaultClientConnectionOperator - Connecting to
> www.expedia.ca:80
> [DEBUG] RequestAddCookies - CookieSpec selected: best-match
> [DEBUG] RequestAuthCache - Auth cache not set in the context
> [DEBUG] RequestTargetAuthentication - Target auth state: UNCHALLENGED
> [DEBUG] RequestProxyAuthentication - Proxy auth state: UNCHALLENGED
> [DEBUG] DefaultHttpClient - Attempt 1 to execute request
> [DEBUG] DefaultClientConnection - Sending request:
> GET /Sunset-District-Hotels.d163838.Travel-Guide-Hotels HTTP/1.1
> [DEBUG] headers - >>
> GET /Sunset-District-Hotels.d163838.Travel-Guide-Hotels HTTP/1.1
> [DEBUG] headers - >> Host: www.expedia.ca
> [DEBUG] headers - >> Connection: Keep-Alive
> [DEBUG] headers - >> User-Agent: Apache-HttpClient/4.2.1 (java 1.5)
> [DEBUG] DefaultClientConnection - Receiving response: HTTP/1.1 200 OK
> [DEBUG] headers - << HTTP/1.1 200 OK
> [DEBUG] headers - << Content-Type: text/html;charset=UTF-8
> [DEBUG] headers - << Content-Language: en-CA
> [DEBUG] headers - << P3P: policyref="/w3c/p3p.xml", CP="CAO DSP IND COR
> ADM CONo CUR CUSi DEV PSA PSD DELi OUR COM NAV PHY ONL PUR UNI"
> [DEBUG] headers - << RTSS: 1
> [DEBUG] headers - << Date: Wed, 01 Aug 2012 10:49:28 GMT
> [DEBUG] headers - << Transfer-Encoding:  chunked
> [DEBUG] headers - << Connection: keep-alive
> [DEBUG] headers - << Connection: Transfer-Encoding
> [DEBUG] headers - << Set-Cookie: SSLB=1; path=/; domain=.expedia.ca
> [DEBUG] headers - << Set-Cookie:
> MC1=GUID=c55cfa1393ce4bfca1ac5b6532085717; Domain=.expedia.ca;
> Expires=Fri, 04-Aug-2017 03:44:09 GMT; Path=/
> [DEBUG] headers - << Set-Cookie: iEAPID=000000,; Domain=.expedia.ca;
> Path=/
> [DEBUG] headers - << Set-Cookie:
> JSESSION=13201604-6f17-4f6e-8b03-570fd433ad4e; Domain=.expedia.ca;
> Path=/
> [DEBUG] headers - << Set-Cookie: s1=`0; Domain=.expedia.ca; Path=/
> [DEBUG] headers - << Set-Cookie: p1=`tpid=v.1,4`linfo=v.4,|0|0|255|1|
> 0||||||||4105|0|0||0|0|0|-1|-1`63; Domain=.expedia.ca; Expires=Tue,
> 01-Aug-2017 15:54:40 GMT; Path=/
> [DEBUG] ResponseProcessCookies - Cookie accepted: "[version: 0][name:
> SSLB][value: 1][domain: .expedia.ca][path: /][expiry: null]".
> [DEBUG] ResponseProcessCookies - Cookie accepted: "[version: 0][name:
> MC1][value:
> GUID=c55cfa1393ce4bfca1ac5b6532085717][domain: .expedia.ca][path: /][expiry:
> Fri Aug 04 04:44:09 GMT+01:00 2017]".
> [DEBUG] ResponseProcessCookies - Cookie accepted: "[version: 0][name:
> iEAPID][value: 000000,][domain: .expedia.ca][path: /][expiry: null]".
> [DEBUG] ResponseProcessCookies - Cookie accepted: "[version: 0][name:
> JSESSION][value:
> 13201604-6f17-4f6e-8b03-570fd433ad4e][domain: .expedia.ca][path: /][expiry:
> null]".
> [DEBUG] ResponseProcessCookies - Cookie accepted: "[version: 0][name:
> s1][value: `0][domain: .expedia.ca][path: /][expiry: null]".
> [DEBUG] ResponseProcessCookies - Cookie accepted: "[version: 0][name:
> p1][value: `tpid=v.1,4`linfo=v.4,|0|0|255|1|0||||||||4105|0|0||0|0|
> 0|-1|-1`63][domain: .expedia.ca][path: /][expiry: Tue Aug 01 16:54:40
> GMT+01:00 2017]".
> [DEBUG] DefaultHttpClient - Connection can be kept alive indefinitely
>
> Can you put together a small test app that could be used to reproduce
> the NPE?
>
> Oleg
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to