You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by Pololang <fd...@gmail.com> on 2011/04/01 17:51:35 UTC

ContentEncodingHttpClient throws NoHttpResponseException

Hi all :-),

I'm using HttpClient 4.1.1 with HttpCore 4.1, for a HTTPS request with
client certificate stored inside a Java Keystore.
The application runs with JBoss 5 and Spring 3.
It works on my developpement computer (Windows), but not on my Red Hat
Server.
It looks like the connection is closed by the server after the GET is sent.

When I execute the code inside a standalone jar it works on both systems.
When I execute curl request it works on both systems.


Logs from Red Hat Server:

2011-03-18
11:06:14,739,DEBUG,[org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager],Get
connection:
HttpRoute[{tls}->http://10.34.18.7:3128->https://energydatabase.edftrading.com],
timeout = 10000
 2011-03-18
11:06:14,743,DEBUG,[org.apache.http.impl.conn.tsccm.ConnPoolByRoute],[HttpRoute[{tls}->http://10.34.18.7:3128->https://energydatabase.edftrading.com]]
total kept alive: 0, total issued: 0, total allocated: 0 out of 20
 2011-03-18
11:06:14,743,DEBUG,[org.apache.http.impl.conn.tsccm.ConnPoolByRoute],No free
connections
[HttpRoute[{tls}->http://10.34.18.7:3128->https://energydatabase.edftrading.com]][null]
 2011-03-18
11:06:14,743,DEBUG,[org.apache.http.impl.conn.tsccm.ConnPoolByRoute],Available
capacity: 2 out of 2
[HttpRoute[{tls}->http://10.34.18.7:3128->https://energydatabase.edftrading.com]][null]
 2011-03-18
11:06:14,743,DEBUG,[org.apache.http.impl.conn.tsccm.ConnPoolByRoute],Creating
new connection
[HttpRoute[{tls}->http://10.34.18.7:3128->https://energydatabase.edftrading.com]]
 2011-03-18
11:06:14,769,DEBUG,[org.apache.http.impl.conn.DefaultClientConnectionOperator],Connecting
to /10.34.18.7:3128
 2011-03-18
11:06:14,814,DEBUG,[org.apache.http.impl.conn.DefaultClientConnection],Sending
request: CONNECT energydatabase.edftrading.com:443 HTTP/1.1
 2011-03-18 11:06:14,815,DEBUG,[org.apache.http.wire],>> "CONNECT
energydatabase.edftrading.com:443 HTTP/1.1[\r][\n]"
 2011-03-18 11:06:14,818,DEBUG,[org.apache.http.wire],>> "Host:
energydatabase.edftrading.com[\r][\n]"
 2011-03-18 11:06:14,818,DEBUG,[org.apache.http.wire],>> "Proxy-Connection:
Keep-Alive[\r][\n]"
 2011-03-18 11:06:14,818,DEBUG,[org.apache.http.wire],>> "Accept-Encoding:
gzip,deflate[\r][\n]"
 2011-03-18 11:06:14,818,DEBUG,[org.apache.http.wire],>> "[\r][\n]"
 2011-03-18 11:06:14,818,DEBUG,[org.apache.http.headers],>> CONNECT
energydatabase.edftrading.com:443 HTTP/1.1
 2011-03-18 11:06:14,819,DEBUG,[org.apache.http.headers],>> Host:
energydatabase.edftrading.com
 2011-03-18 11:06:14,819,DEBUG,[org.apache.http.headers],>>
Proxy-Connection: Keep-Alive
 2011-03-18 11:06:14,819,DEBUG,[org.apache.http.headers],>> Accept-Encoding:
gzip,deflate
 2011-03-18 11:06:14,879,DEBUG,[org.apache.http.wire],<< "HTTP/1.1 200
Connection established[\r][\n]"
 2011-03-18 11:06:14,884,DEBUG,[org.apache.http.wire],<< "[\r][\n]"
 2011-03-18
11:06:14,884,DEBUG,[org.apache.http.impl.conn.DefaultClientConnection],Receiving
response: HTTP/1.1 200 Connection established
 2011-03-18 11:06:14,884,DEBUG,[org.apache.http.headers],<< HTTP/1.1 200
Connection established
 2011-03-18
11:06:14,889,DEBUG,[org.apache.http.impl.client.ContentEncodingHttpClient],Tunnel
to target created.
 2011-03-18
11:06:14,948,DEBUG,[org.apache.http.client.protocol.RequestAddCookies],CookieSpec
selected: best-match
 2011-03-18
11:06:14,976,DEBUG,[org.apache.http.impl.client.ContentEncodingHttpClient],Attempt
1 to execute request
 2011-03-18
11:06:14,976,DEBUG,[org.apache.http.impl.conn.DefaultClientConnection],Sending
request: GET
/prices/pricesQueryHourly.asp?title=Powernext+Power+Hourly+Price+in+Euros+per+MWH&units=EUR%2FMWh&chain=POWERNEXT&column=PRICE&CHANGE=N&firsthour=00&lasthour=23&fill=NO&fillvalue=&weekend=Y&groupby=&agg=&decimals=3&SORT=A&OUTPUT=WWW&fromdate=01%2F03%2F2011&todate=01%2F03%2F2011
HTTP/1.1
 2011-03-18 11:06:14,977,DEBUG,[org.apache.http.wire],>> "GET
/prices/pricesQueryHourly.asp?title=Powernext+Power+Hourly+Price+in+Euros+per+MWH&units=EUR%2FMWh&chain=POWERNEXT&column=PRICE&CHANGE=N&firsthour=00&lasthour=23&fill=NO&fillvalue=&weekend=Y&groupby=&agg=&decimals=3&SORT=A&OUTPUT=WWW&fromdate=01%2F03%2F2011&todate=01%2F03%2F2011
HTTP/1.1[\r][\n]"
 2011-03-18 11:06:14,977,DEBUG,[org.apache.http.wire],>> "Host:
energydatabase.edftrading.com[\r][\n]"
 2011-03-18 11:06:14,977,DEBUG,[org.apache.http.wire],>> "Connection:
Keep-Alive[\r][\n]"
 2011-03-18 11:06:14,977,DEBUG,[org.apache.http.wire],>> "Accept-Encoding:
gzip,deflate[\r][\n]"
 2011-03-18 11:06:14,977,DEBUG,[org.apache.http.wire],>> "[\r][\n]"
 2011-03-18 11:06:14,977,DEBUG,[org.apache.http.headers],>> GET
/prices/pricesQueryHourly.asp?title=Powernext+Power+Hourly+Price+in+Euros+per+MWH&units=EUR%2FMWh&chain=POWERNEXT&column=PRICE&CHANGE=N&firsthour=00&lasthour=23&fill=NO&fillvalue=&weekend=Y&groupby=&agg=&decimals=3&SORT=A&OUTPUT=WWW&fromdate=01%2F03%2F2011&todate=01%2F03%2F2011
HTTP/1.1
 2011-03-18 11:06:14,977,DEBUG,[org.apache.http.headers],>> Host:
energydatabase.edftrading.com
 2011-03-18 11:06:14,977,DEBUG,[org.apache.http.headers],>> Connection:
Keep-Alive
 2011-03-18 11:06:14,978,DEBUG,[org.apache.http.headers],>> Accept-Encoding:
gzip,deflate
 2011-03-18
11:06:15,023,DEBUG,[org.apache.http.impl.conn.DefaultClientConnection],Connection
closed
 2011-03-18
11:06:15,023,DEBUG,[org.apache.http.impl.client.ContentEncodingHttpClient],Closing
the connection.
 2011-03-18
11:06:15,023,DEBUG,[org.apache.http.impl.conn.DefaultClientConnection],Connection
closed
 2011-03-18
11:06:15,024,INFO,[org.apache.http.impl.client.ContentEncodingHttpClient]
caught when processing request: The target server failed to respond
 2011-03-18
11:06:15,024,DEBUG,[org.apache.http.impl.client.ContentEncodingHttpClient],The
target server failed to respond
 org.apache.http.NoHttpResponseException: The target server failed to
respond
	at
org.apache.http.impl.conn.DefaultResponseParser.parseHead(DefaultResponseParser.java:101)
	at
org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:252)
	at
org.apache.http.impl.AbstractHttpClientConnection.receiveResponseHeader(AbstractHttpClientConnection.java:281)
	at
org.apache.http.impl.conn.DefaultClientConnection.receiveResponseHeader(DefaultClientConnection.java:247)
	at
org.apache.http.impl.conn.AbstractClientConnAdapter.receiveResponseHeader(AbstractClientConnAdapter.java:219)
	at
org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:298)
	at
org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:125)
	at
org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:622)
	at
org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:454)
	at
org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:820)
	at
org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:754)
	at
org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:732)
	at
com.edf.marketlab.services.impl.WebDataRetrieverImpl.getResponseStream(WebDataRetrieverImpl.java:153)
	at
com.edf.marketlab.web.action.browser.RemoteBDBean.webQueryListener(RemoteBDBean.java:1563)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
	at
org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32)
	at
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
	at
com.edf.marketlab.web.interceptor.ExceptionInterceptor.aroundInvoke(ExceptionInterceptor.java:35)
	at
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
	at
org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)
	at
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
	at
org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:77)
	at
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
	at
org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
	at
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
	at
org.jboss.seam.core.SynchronizationInterceptor.aroundInvoke(SynchronizationInterceptor.java:32)
	at
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
	at
org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
	at
org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185)
	at
org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103)
	at
com.edf.marketlab.web.action.browser.RemoteBDBean_$$_javassist_seam_11.webQueryListener(RemoteBDBean_$$_javassist_seam_11.java)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.apache.el.parser.AstValue.invoke(AstValue.java:170)
	at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
	at
org.apache.jasper.el.JspMethodExpression.invoke(JspMethodExpression.java:68)
	at
org.apache.myfaces.trinidad.component.UIXComponentBase.broadcastToMethodExpression(UIXComponentBase.java:1303)
	at oracle.adf.view.rich.component.UIXDialog.broadcast(UIXDialog.java:97)
	at
oracle.adf.view.rich.component.fragment.UIXRegion.broadcast(UIXRegion.java:148)
	at
oracle.adf.view.rich.component.fragment.UIXRegion.broadcast(UIXRegion.java:148)
	at
oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.broadcastEvents(LifecycleImpl.java:812)
	at
oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:292)
	at
oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:177)
	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at
oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:97)
	at
org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
	at
oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
	at
org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
	at
org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:247)
	at
org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:157)
	at
org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
	at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60)
	at
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
	at
com.edf.marketlab.web.filter.SessionActivityFilter.doFilter(SessionActivityFilter.java:66)
	at
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
	at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
	at
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
	at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
	at
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
	at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
	at
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
	at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
	at
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
	at
org.jboss.seam.web.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:42)
	at
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
	at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
	at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
	at
org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:183)
	at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
	at
org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:95)
	at
org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
	at
org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
	at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
	at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
	at
org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
	at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
	at
org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:905)
	at
org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:592)
	at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:2036)
	at java.lang.Thread.run(Thread.java:662)

Logs from my computer :

2011-03-18
12:10:38,271,DEBUG,[org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager],Get
connection:
HttpRoute[{tls}->http://10.34.18.7:3128->https://energydatabase.edftrading.com],
timeout = 10000
 2011-03-18
12:10:38,287,DEBUG,[org.apache.http.impl.conn.tsccm.ConnPoolByRoute],[HttpRoute[{tls}->http://10.34.18.7:3128->https://energydatabase.edftrading.com]]
total kept alive: 0, total issued: 0, total allocated: 0 out of 20
 2011-03-18
12:10:38,287,DEBUG,[org.apache.http.impl.conn.tsccm.ConnPoolByRoute],No free
connections
[HttpRoute[{tls}->http://10.34.18.7:3128->https://energydatabase.edftrading.com]][null]
 2011-03-18
12:10:38,287,DEBUG,[org.apache.http.impl.conn.tsccm.ConnPoolByRoute],Available
capacity: 2 out of 2
[HttpRoute[{tls}->http://10.34.18.7:3128->https://energydatabase.edftrading.com]][null]
 2011-03-18
12:10:38,287,DEBUG,[org.apache.http.impl.conn.tsccm.ConnPoolByRoute],Creating
new connection
[HttpRoute[{tls}->http://10.34.18.7:3128->https://energydatabase.edftrading.com]]
 2011-03-18
12:10:41,911,DEBUG,[org.apache.http.impl.conn.DefaultClientConnectionOperator],Connecting
to /10.34.18.7:3128
 2011-03-18
12:10:41,989,DEBUG,[org.apache.http.impl.conn.DefaultClientConnection],Sending
request: CONNECT energydatabase.edftrading.com:443 HTTP/1.1
 2011-03-18 12:10:41,989,DEBUG,[org.apache.http.wire],>> "CONNECT
energydatabase.edftrading.com:443 HTTP/1.1[\r][\n]"
 2011-03-18 12:10:42,005,DEBUG,[org.apache.http.wire],>> "Host:
energydatabase.edftrading.com[\r][\n]"
 2011-03-18 12:10:42,005,DEBUG,[org.apache.http.wire],>> "Proxy-Connection:
Keep-Alive[\r][\n]"
 2011-03-18 12:10:42,005,DEBUG,[org.apache.http.wire],>> "Accept-Encoding:
gzip,deflate[\r][\n]"
 2011-03-18 12:10:42,005,DEBUG,[org.apache.http.wire],>> "[\r][\n]"
 2011-03-18 12:10:42,005,DEBUG,[org.apache.http.headers],>> CONNECT
energydatabase.edftrading.com:443 HTTP/1.1
 2011-03-18 12:10:42,005,DEBUG,[org.apache.http.headers],>> Host:
energydatabase.edftrading.com
 2011-03-18 12:10:42,005,DEBUG,[org.apache.http.headers],>>
Proxy-Connection: Keep-Alive
 2011-03-18 12:10:42,005,DEBUG,[org.apache.http.headers],>> Accept-Encoding:
gzip,deflate
 2011-03-18 12:10:53,830,DEBUG,[org.apache.http.wire],<< "HTTP/1.1 200
Connection established[\r][\n]"
 2011-03-18 12:10:53,830,DEBUG,[org.apache.http.wire],<< "[\r][\n]"
 2011-03-18
12:10:53,846,DEBUG,[org.apache.http.impl.conn.DefaultClientConnection],Receiving
response: HTTP/1.1 200 Connection established
 2011-03-18 12:10:53,846,DEBUG,[org.apache.http.headers],<< HTTP/1.1 200
Connection established
 2011-03-18
12:10:53,846,DEBUG,[org.apache.http.impl.client.ContentEncodingHttpClient],Tunnel
to target created.
 2011-03-18
12:10:53,908,DEBUG,[org.apache.http.client.protocol.RequestAddCookies],CookieSpec
selected: best-match
 2011-03-18
12:10:59,439,DEBUG,[org.apache.http.impl.client.ContentEncodingHttpClient],Attempt
1 to execute request
 2011-03-18
12:11:02,985,DEBUG,[org.apache.http.impl.conn.DefaultClientConnection],Sending
request: GET
/prices/pricesQueryHourly.asp?title=Powernext+Power+Hourly+Price+in+Euros+per+MWH&units=EUR%2FMWh&chain=POWERNEXT&column=PRICE&CHANGE=N&firsthour=00&lasthour=23&fill=NO&fillvalue=&weekend=Y&groupby=&agg=&decimals=3&SORT=A&OUTPUT=WWW&fromdate=01%2F03%2F2011&todate=01%2F03%2F2011
HTTP/1.1
 2011-03-18 12:11:02,985,DEBUG,[org.apache.http.wire],>> "GET
/prices/pricesQueryHourly.asp?title=Powernext+Power+Hourly+Price+in+Euros+per+MWH&units=EUR%2FMWh&chain=POWERNEXT&column=PRICE&CHANGE=N&firsthour=00&lasthour=23&fill=NO&fillvalue=&weekend=Y&groupby=&agg=&decimals=3&SORT=A&OUTPUT=WWW&fromdate=01%2F03%2F2011&todate=01%2F03%2F2011
HTTP/1.1[\r][\n]"
 2011-03-18 12:11:02,985,DEBUG,[org.apache.http.wire],>> "Host:
energydatabase.edftrading.com[\r][\n]"
 2011-03-18 12:11:02,985,DEBUG,[org.apache.http.wire],>> "Connection:
Keep-Alive[\r][\n]"
 2011-03-18 12:11:02,985,DEBUG,[org.apache.http.wire],>> "Accept-Encoding:
gzip,deflate[\r][\n]"
 2011-03-18 12:11:02,985,DEBUG,[org.apache.http.wire],>> "[\r][\n]"
 2011-03-18 12:11:02,985,DEBUG,[org.apache.http.headers],>> GET
/prices/pricesQueryHourly.asp?title=Powernext+Power+Hourly+Price+in+Euros+per+MWH&units=EUR%2FMWh&chain=POWERNEXT&column=PRICE&CHANGE=N&firsthour=00&lasthour=23&fill=NO&fillvalue=&weekend=Y&groupby=&agg=&decimals=3&SORT=A&OUTPUT=WWW&fromdate=01%2F03%2F2011&todate=01%2F03%2F2011
HTTP/1.1
 2011-03-18 12:11:02,985,DEBUG,[org.apache.http.headers],>> Host:
energydatabase.edftrading.com
 2011-03-18 12:11:02,985,DEBUG,[org.apache.http.headers],>> Connection:
Keep-Alive
 2011-03-18 12:11:02,985,DEBUG,[org.apache.http.headers],>> Accept-Encoding:
gzip,deflate
 2011-03-18 12:11:04,562,DEBUG,[org.apache.http.wire],<< "HTTP/1.1 200
OK[\r][\n]"
 2011-03-18 12:11:04,562,DEBUG,[org.apache.http.wire],<< "Cache-Control:
private[\r][\n]"
 2011-03-18 12:11:04,562,DEBUG,[org.apache.http.wire],<< "Content-Length:
4366[\r][\n]"
 2011-03-18 12:11:04,562,DEBUG,[org.apache.http.wire],<< "Content-Type:
text/html[\r][\n]"
 2011-03-18 12:11:04,562,DEBUG,[org.apache.http.wire],<< "Server:
Microsoft-IIS/7.0[\r][\n]"
 2011-03-18 12:11:04,562,DEBUG,[org.apache.http.wire],<< "Set-Cookie:
ASPSESSIONIDAGRCQSBS=HNPDMMJBDCHIOCKNDAGKDABL; secure; path=/[\r][\n]"
 2011-03-18 12:11:04,562,DEBUG,[org.apache.http.wire],<< "X-Powered-By:
ASP.NET[\r][\n]"
 2011-03-18 12:11:04,562,DEBUG,[org.apache.http.wire],<< "Date: Fri, 18 Mar
2011 11:12:45 GMT[\r][\n]"
 2011-03-18 12:11:04,562,DEBUG,[org.apache.http.wire],<< "[\r][\n]"
 2011-03-18
12:11:04,562,DEBUG,[org.apache.http.impl.conn.DefaultClientConnection],Receiving
response: HTTP/1.1 200 OK
 2011-03-18 12:11:04,562,DEBUG,[org.apache.http.headers],<< HTTP/1.1 200 OK
 2011-03-18 12:11:04,562,DEBUG,[org.apache.http.headers],<< Cache-Control:
private
 2011-03-18 12:11:04,562,DEBUG,[org.apache.http.headers],<< Content-Length:
4366
 2011-03-18 12:11:04,562,DEBUG,[org.apache.http.headers],<< Content-Type:
text/html
 2011-03-18 12:11:04,562,DEBUG,[org.apache.http.headers],<< Server:
Microsoft-IIS/7.0
 2011-03-18 12:11:04,562,DEBUG,[org.apache.http.headers],<< Set-Cookie:
ASPSESSIONIDAGRCQSBS=HNPDMMJBDCHIOCKNDAGKDABL; secure; path=/
 2011-03-18 12:11:04,562,DEBUG,[org.apache.http.headers],<< X-Powered-By:
ASP.NET
 2011-03-18 12:11:04,562,DEBUG,[org.apache.http.headers],<< Date: Fri, 18
Mar 2011 11:12:45 GMT
 2011-03-18
12:11:04,594,DEBUG,[org.apache.http.client.protocol.ResponseProcessCookies],Cookie
accepted: "[version: 0][name: ASPSESSIONIDAGRCQSBS][value:
HNPDMMJBDCHIOCKNDAGKDABL][domain: energydatabase.edftrading.com][path:
/][expiry: null]". 
 2011-03-18
12:11:04,594,DEBUG,[org.apache.http.impl.client.ContentEncodingHttpClient],Connection
can be kept alive indefinitely
 2011-03-18 12:11:04,625,DEBUG,[org.apache.http.wire],<< "[\r][\n]"
 2011-03-18 12:11:04,625,DEBUG,[org.apache.http.wire],<< "[\r][\n]"
 2011-03-18 12:11:04,625,DEBUG,[org.apache.http.wire],<< "<!DOCTYPE HTML
PUBLIC "-//W3C//DTD HTML 3.2//EN">[\r][\n]"
 2011-03-18 12:11:04,625,DEBUG,[org.apache.http.wire],<< "<HTML>[\r][\n]"
 2011-03-18 12:11:04,625,DEBUG,[org.apache.http.wire],<< "<HEAD>[\r][\n]"
 2011-03-18 12:11:04,625,DEBUG,[org.apache.http.wire],<< "   
<TITLE>[\r][\n]"
 2011-03-18 12:11:04,625,DEBUG,[org.apache.http.wire],<< "Powernext Power
Hourly Price in Euros per MWH   [\r][\n]"
 2011-03-18 12:11:04,625,DEBUG,[org.apache.http.wire],<< "   
</TITLE>[\r][\n]"
 2011-03-18 12:11:04,625,DEBUG,[org.apache.http.wire],<< "</HEAD>[\r][\n]"
 
...

 2011-03-18 12:11:04,641,DEBUG,[org.apache.http.wire],<< "</BODY>[\r][\n]"
 2011-03-18 12:11:04,641,DEBUG,[org.apache.http.wire],<< "</HTML>[\r][\n]"
 2011-03-18 12:11:04,641,DEBUG,[org.apache.http.wire],<< "[\r][\n]"
 2011-03-18
12:11:04,672,DEBUG,[org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager],Released
connection is reusable.
 2011-03-18
12:11:04,672,DEBUG,[org.apache.http.impl.conn.tsccm.ConnPoolByRoute],Releasing
connection
[HttpRoute[{tls}->http://10.34.18.7:3128->https://energydatabase.edftrading.com]][EMAILADDRESS=jose-manuel.estevez@edf.fr,
CN=Jose Manuel Estevez, O=EDF, L=Paris]
 2011-03-18
12:11:04,672,DEBUG,[org.apache.http.impl.conn.tsccm.ConnPoolByRoute],Pooling
connection
[HttpRoute[{tls}->http://10.34.18.7:3128->https://energydatabase.edftrading.com]][EMAILADDRESS=jose-manuel.estevez@edf.fr,
CN=Jose Manuel Estevez, O=EDF, L=Paris]; keep alive indefinitely
 2011-03-18
12:11:04,672,DEBUG,[org.apache.http.impl.conn.tsccm.ConnPoolByRoute],Notifying
no-one, there are no waiting threads


Source :

HttpParams params = new SyncBasicHttpParams();
HttpConnectionParams.setConnectionTimeout(params, 10000);
HttpProtocolParams.setVersion(params, HttpVersion.HTTP_1_1);

SchemeRegistry schemeRegistry = new SchemeRegistry();
schemeRegistry.register(new Scheme("http", 80,
PlainSocketFactory.getSocketFactory()));
schemeRegistry.register(new Scheme("https", 443,
SSLSocketFactory.getSocketFactory()));
		
ClientConnectionManager cm = new
ThreadSafeClientConnManager(schemeRegistry);
client = new ContentEncodingHttpClient(cm, params);
		
proxySelector = new MklProxySelector();
ProxySelectorRoutePlanner routePlanner = new
ProxySelectorRoutePlanner(client.getConnectionManager().getSchemeRegistry(),
proxySelector);
client.setRoutePlanner(routePlanner);

TrustStrategy trustStrategy = new TrustStrategy() {
			
		@Override
		public boolean isTrusted(X509Certificate[] arg0, String arg1)
				throws CertificateException {
			return true;
		}
	};

SchemeSocketFactory socketFactory = new SSLSocketFactory(null,
getUserKeyStore(), USER_KEYSTORE_PASSPHRASE, null, null, trustStrategy, new
BrowserCompatHostnameVerifier());
		
Scheme sch = new Scheme("https", 443, socketFactory);
client.getConnectionManager().getSchemeRegistry().register(sch);
			
HttpGet httpGet = new HttpGet(new
URI("https://energydatabase.edftrading.com/prices/pricesQueryHourly.asp?title=Powernext+Power+Hourly+Price+in+Euros+per+MWH&units=EUR%2FMWh&chain=POWERNEXT&column=PRICE&CHANGE=N&firsthour=00&lasthour=23&fill=NO&fillvalue=&weekend=Y&groupby=&agg=&decimals=3&SORT=A&OUTPUT=WWW&fromdate=01%2F03%2F2011&todate=02%2F03%2F2011"));
			
HttpResponse response = client.execute(httpGet);


public class MklProxySelector extends ProxySelector {

	private List<Proxy> proxies;
	
	public MklProxySelector() {
		super();
		
		proxies = new ArrayList<Proxy>();
		proxies.add(new Proxy(Proxy.Type.HTTP, new
InetSocketAddress(AppUtils.getAppUtils().getProperty("WEB_PROXY_HOST"),
Integer.parseInt(AppUtils.getAppUtils().getProperty("WEB_PROXY_PORT")))));
		proxies.add(new Proxy(Proxy.Type.HTTP, new
InetSocketAddress(AppUtils.getAppUtils().getProperty("WEB_PROXY_BACKUP_HOST"),
Integer.parseInt(AppUtils.getAppUtils().getProperty("WEB_PROXY_BACKUP_PORT")))));
		
	}
	
	@Override
	public void connectFailed(URI uri, SocketAddress sa, IOException ioe) {
	}

	@Override
	public List<Proxy> select(URI uri) {
		
		List<Proxy> result = new ArrayList<Proxy>();
		
		if(uri.getScheme().equalsIgnoreCase("http") ||
uri.getScheme().equalsIgnoreCase("https")) {
			result.addAll(proxies);
		} else {
			result.add(Proxy.NO_PROXY);
		}
		
		return result;
	}
	
	public void cycle() {
		
		if(proxies != null && proxies.size() > 1) {
			proxies.add(proxies.remove(0));
		}
		
	}
	
	public Proxy getCurrentProxy() {
		return proxies.get(0);
	}

}

-- 
View this message in context: http://old.nabble.com/ContentEncodingHttpClient-throws-NoHttpResponseException-tp31296663p31296663.html
Sent from the HttpClient-User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Re: ContentEncodingHttpClient throws NoHttpResponseException

Posted by Pololang <fd...@gmail.com>.
Hi,

the problem was caused by the little green men from Sun : it works with JDK
1.6.0_18 and not with 1.6.0_19+.

Maybe it's related to this issue :
http://blog.techstacks.com/2010/07/javas-recent-ssl-problems.html ?


Pololang


olegk wrote:
> 
> On Fri, 2011-04-01 at 08:51 -0700, Pololang wrote:
> 
> This can be basically anything: SSL problem, server side bug, little
> green men from Mars hiding in your server room. There is just no way to
> tell for sure given that the server simply dropped connection instead of
> returning a meaningful error code.
> 
> At any rate this does not look like a problem with HttpClient
> 
> Oleg
> 
> 

-- 
View this message in context: http://old.nabble.com/ContentEncodingHttpClient-throws-NoHttpResponseException-tp31296663p31477913.html
Sent from the HttpClient-User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Re: ContentEncodingHttpClient throws NoHttpResponseException

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Fri, 2011-04-01 at 08:51 -0700, Pololang wrote:
> Hi all :-),
> 
> I'm using HttpClient 4.1.1 with HttpCore 4.1, for a HTTPS request with
> client certificate stored inside a Java Keystore.
> The application runs with JBoss 5 and Spring 3.
> It works on my developpement computer (Windows), but not on my Red Hat
> Server.
> It looks like the connection is closed by the server after the GET is sent.
> 
> When I execute the code inside a standalone jar it works on both systems.
> When I execute curl request it works on both systems.
> 
> 
> Logs from Red Hat Server:

...

>  2011-03-18
> 11:06:15,024,DEBUG,[org.apache.http.impl.client.ContentEncodingHttpClient],The
> target server failed to respond
>  org.apache.http.NoHttpResponseException: The target server failed to
> respond
> 	

This can be basically anything: SSL problem, server side bug, little
green men from Mars hiding in your server room. There is just no way to
tell for sure given that the server simply dropped connection instead of
returning a meaningful error code.

At any rate this does not look like a problem with HttpClient

Oleg


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org