<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<id>tag:www.nabble.com,2006:forum-29832</id>
	<title>Nabble - HttpComponents</title>
	<updated>2009-01-08T08:10:59Z</updated>
	<link rel="self" type="application/atom+xml" href="http://www.nabble.com/HttpComponents-f29832.xml" />
	<link rel="alternate" type="text/html" href="http://www.nabble.com/HttpComponents-f29832.html" />
	<subtitle type="html">Apache HttpComponents are Java libraries for HTTP communication, including a flexible HttpClient implementation.</subtitle>
	
<entry>
	<id>tag:www.nabble.com,2006:post-21354833</id>
	<title>[jira] Commented: (HTTPCLIENT-813) HttpClient throws NPE on Invalid Port when used with MultiThreadedHttpConnectionManager</title>
	<published>2009-01-08T08:10:59Z</published>
	<updated>2009-01-08T08:10:59Z</updated>
	<author>
		<name>JIRA jira@apache.org</name>
	</author>
	<content type="html">&lt;br&gt;&amp;nbsp; &amp;nbsp; [ &lt;a href=&quot;https://issues.apache.org/jira/browse/HTTPCLIENT-813?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&amp;focusedCommentId=12662021#action_12662021&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://issues.apache.org/jira/browse/HTTPCLIENT-813?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&amp;focusedCommentId=12662021#action_12662021&lt;/a&gt;&amp;nbsp;] 
&lt;br&gt;&lt;br&gt;Zhihong Zhang commented on HTTPCLIENT-813:
&lt;br&gt;------------------------------------------
&lt;br&gt;&lt;br&gt;You said 4.0 doesn't throw exception at all. That's not right behavior either. Since the input is invalid, it should throw a checked exception.
&lt;br&gt;&lt;br&gt;We want to switch to 4.0 but we have a policy not to use software in beta. Do you have an estimate on the official release?
&lt;br&gt;&lt;br&gt;Thanks for your quick response.
&lt;br&gt;&lt;br&gt;Zhihong
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; HttpClient throws NPE on Invalid Port when used with MultiThreadedHttpConnectionManager
&lt;br&gt;&amp;gt; ---------------------------------------------------------------------------------------
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Key: HTTPCLIENT-813
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; URL: &lt;a href=&quot;https://issues.apache.org/jira/browse/HTTPCLIENT-813&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://issues.apache.org/jira/browse/HTTPCLIENT-813&lt;/a&gt;&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Project: HttpComponents HttpClient
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Issue Type: Bug
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Components: HttpClient
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;Affects Versions: 3.1 Final
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Environment: Linux AS 3.1/Java 1.5
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Reporter: Zhihong Zhang
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Attachments: HttpTest.java, HttpTest2.java
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; The HttpClient throws NullPointerException in the main thread when an invalid port (like 80001) is used in the URL. An IllegalArgumentException is thrown in TimeoutGuard thread.
&lt;br&gt;&amp;gt; &amp;nbsp;
&lt;br&gt;&amp;gt; Exception in thread &amp;quot;Timeout guard&amp;quot; java.lang.IllegalArgumentException: port out of range:80001
&lt;br&gt;&amp;gt; 	at java.net.InetSocketAddress.&amp;lt;init&amp;gt;(InetSocketAddress.java:118)
&lt;br&gt;&amp;gt; 	at java.net.Socket.&amp;lt;init&amp;gt;(Socket.java:240)
&lt;br&gt;&amp;gt; 	at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:80)
&lt;br&gt;&amp;gt; 	at org.apache.commons.httpclient.protocol.ControllerThreadSocketFactory$1.doit(ControllerThreadSocketFactory.java:91)
&lt;br&gt;&amp;gt; 	at org.apache.commons.httpclient.protocol.ControllerThreadSocketFactory$SocketTask.run(ControllerThreadSocketFactory.java:158)
&lt;br&gt;&amp;gt; 	at java.lang.Thread.run(Thread.java:613)
&lt;br&gt;&amp;gt; Exception in thread &amp;quot;main&amp;quot; java.lang.NullPointerException
&lt;br&gt;&amp;gt; 	at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:721)
&lt;br&gt;&amp;gt; 	at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.open(MultiThreadedHttpConnectionManager.java:1361)
&lt;br&gt;&amp;gt; 	at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387)
&lt;br&gt;&amp;gt; 	at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
&lt;br&gt;&amp;gt; 	at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
&lt;br&gt;&amp;gt; 	at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323)
&lt;br&gt;&amp;gt; 	at com.aol.test.HttpTest$PoolingHttpConnector.doGet(HttpTest.java:47)
&lt;br&gt;&amp;gt; 	at com.aol.test.HttpTest.main(HttpTest.java:17)
&lt;br&gt;&amp;gt; It should throw a checked exception in main thread so caller can handle the error condition more gracefully.
&lt;br&gt;&amp;gt; The test program is attached. This is caused by a race condition and it's not always reproducible. Running in debugger shows a different behavior.
&lt;br&gt;&amp;gt; package com.aol.test;
&lt;br&gt;&amp;gt; import java.io.IOException;
&lt;br&gt;&amp;gt; import org.apache.commons.httpclient.HttpClient;
&lt;br&gt;&amp;gt; import org.apache.commons.httpclient.HttpStatus;
&lt;br&gt;&amp;gt; import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager;
&lt;br&gt;&amp;gt; import org.apache.commons.httpclient.methods.GetMethod;
&lt;br&gt;&amp;gt; import org.apache.commons.httpclient.params.HttpConnectionManagerParams;
&lt;br&gt;&amp;gt; public class HttpTest {
&lt;br&gt;&amp;gt; 	
&lt;br&gt;&amp;gt; 	public static void main(String[] args) {
&lt;br&gt;&amp;gt; 		PoolingHttpConnector conn = new PoolingHttpConnector();
&lt;br&gt;&amp;gt; 		
&lt;br&gt;&amp;gt; 		try {
&lt;br&gt;&amp;gt; 			String response = conn.doGet(&amp;quot;&lt;a href=&quot;http://www.aol.com:80001&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.aol.com:80001&lt;/a&gt;&amp;quot;);
&lt;br&gt;&amp;gt; 			System.out.println(&amp;quot;Response='&amp;quot; + response + &amp;quot;'&amp;quot;);
&lt;br&gt;&amp;gt; 		} catch (IOException e) {
&lt;br&gt;&amp;gt; 			e.printStackTrace();
&lt;br&gt;&amp;gt; 		}
&lt;br&gt;&amp;gt; 	}
&lt;br&gt;&amp;gt; 	static class PoolingHttpConnector {
&lt;br&gt;&amp;gt; 		
&lt;br&gt;&amp;gt; 		public static final int MAX_TOTAL_CONNECTIONS = 16;
&lt;br&gt;&amp;gt; 		public static final int MAX_CONNECTIONS_PER_HOST = 8;
&lt;br&gt;&amp;gt; 		public static final int CONNECT_TIMEOUT = 5000;
&lt;br&gt;&amp;gt; 		public static final int SOCKET_TIMEOUT = 5000;
&lt;br&gt;&amp;gt; 		public static final boolean TCP_NO_DELAY = true;
&lt;br&gt;&amp;gt; 		
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp;private static MultiThreadedHttpConnectionManager poolManager;
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp;private static HttpConnectionManagerParams httpParams;
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp;private static HttpClient httpClient;
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp;private static boolean initialized = false;
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp;
&lt;br&gt;&amp;gt; 		public PoolingHttpConnector() 
&lt;br&gt;&amp;gt; 		{
&lt;br&gt;&amp;gt; 			initialize();
&lt;br&gt;&amp;gt; 		}
&lt;br&gt;&amp;gt; 		public String doGet(String url) throws IOException {
&lt;br&gt;&amp;gt; 			GetMethod method = new GetMethod(url);
&lt;br&gt;&amp;gt; 					
&lt;br&gt;&amp;gt; 			try {
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;int status = httpClient.executeMethod(method);	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&lt;br&gt;&amp;gt; 		 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;String response = new String(method.getResponseBody());
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (status != HttpStatus.SC_OK)
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;	throw new IOException(&amp;quot;HTTP error: &amp;quot; + response);
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return response;
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&lt;br&gt;&amp;gt; 			} finally {
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;method.releaseConnection();
&lt;br&gt;&amp;gt; 			}
&lt;br&gt;&amp;gt; 	 	} 	
&lt;br&gt;&amp;gt; 	
&lt;br&gt;&amp;gt; 		private synchronized void initialize() {	
&lt;br&gt;&amp;gt; 			if (initialized)
&lt;br&gt;&amp;gt; 				return;
&lt;br&gt;&amp;gt; 			
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;poolManager = new MultiThreadedHttpConnectionManager();
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;httpParams = new HttpConnectionManagerParams();
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;httpParams.setMaxTotalConnections(MAX_TOTAL_CONNECTIONS);
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;httpParams.setDefaultMaxConnectionsPerHost(MAX_CONNECTIONS_PER_HOST);
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;httpParams.setTcpNoDelay(TCP_NO_DELAY);
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;httpParams.setSoTimeout(SOCKET_TIMEOUT);
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;httpParams.setConnectionTimeout(CONNECT_TIMEOUT);
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;poolManager.setParams(httpParams);
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;httpClient = new HttpClient(poolManager);
&lt;br&gt;&amp;gt; 			initialized = true;
&lt;br&gt;&amp;gt; 		}
&lt;br&gt;&amp;gt; 		
&lt;br&gt;&amp;gt; 	}
&lt;br&gt;&amp;gt; }
&lt;/div&gt;&lt;br&gt;-- 
&lt;br&gt;This message is automatically generated by JIRA.
&lt;br&gt;-
&lt;br&gt;You can reply to this email to add a comment to the issue online.
&lt;br&gt;&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe, e-mail: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=21354833&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dev-unsubscribe@...&lt;/a&gt;
&lt;br&gt;For additional commands, e-mail: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=21354833&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dev-help@...&lt;/a&gt;
&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/HttpComponents-Dev-f20179.html&quot; embed=&quot;fixTarget[20179]&quot; target=&quot;_top&quot; &gt;HttpComponents-Dev&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/-jira--Created%3A-%28HTTPCLIENT-813%29-HttpClient-throws-NPE-on-Invalid-Port-when-used-with-MultiThreadedHttpConnectionManager-tp21335629p21354833.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-21354630</id>
	<title>Two-Way SSL Problem</title>
	<published>2009-01-08T07:59:16Z</published>
	<updated>2009-01-08T07:59:16Z</updated>
	<author>
		<name>Tim Williams</name>
	</author>
	<content type="html">I'm using the MultiThreadedConnectionManager with HttpClient and 2-way
&lt;br&gt;ssl similar to the example[1] and having problems. &amp;nbsp;The very first
&lt;br&gt;request goes through and returns HTTP 200 Ok. &amp;nbsp;All subsequent requests
&lt;br&gt;return HTTP 401. &amp;nbsp;This happens when I run this inside a webapp
&lt;br&gt;deployed in either glassfish or tomcat. &amp;nbsp;However, if I take the same
&lt;br&gt;code and run from within a simple driver &amp;quot;main&amp;quot; program, all calls to
&lt;br&gt;that same server succeed with no problems. &amp;nbsp;Oddly enough, this only
&lt;br&gt;happens when communicating with one particular Weblogic service -
&lt;br&gt;other servers allow multiple calls with the same fetcher code just
&lt;br&gt;fine. &amp;nbsp;Anyone have an idea what would make the first request go
&lt;br&gt;through go through properly but not subsequent ones?
&lt;br&gt;&lt;br&gt;Thanks,
&lt;br&gt;--tim
&lt;br&gt;&lt;br&gt;[1] - &lt;a href=&quot;http://svn.apache.org/viewvc/httpcomponents/oac.hc3x/trunk/src/examples/MultiThreadedExample.java?view=markup&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://svn.apache.org/viewvc/httpcomponents/oac.hc3x/trunk/src/examples/MultiThreadedExample.java?view=markup&lt;/a&gt;&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe, e-mail: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=21354630&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;httpclient-users-unsubscribe@...&lt;/a&gt;
&lt;br&gt;For additional commands, e-mail: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=21354630&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;httpclient-users-help@...&lt;/a&gt;
&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/HttpClient-User-f20180.html&quot; embed=&quot;fixTarget[20180]&quot; target=&quot;_top&quot; &gt;HttpClient-User&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Two-Way-SSL-Problem-tp21354630p21354630.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-21353798</id>
	<title>[jira] Resolved: (HTTPCLIENT-813) HttpClient throws NPE on Invalid Port when used with MultiThreadedHttpConnectionManager</title>
	<published>2009-01-08T07:16:59Z</published>
	<updated>2009-01-08T07:16:59Z</updated>
	<author>
		<name>JIRA jira@apache.org</name>
	</author>
	<content type="html">&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;[ &lt;a href=&quot;https://issues.apache.org/jira/browse/HTTPCLIENT-813?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://issues.apache.org/jira/browse/HTTPCLIENT-813?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel&lt;/a&gt;&amp;nbsp;]
&lt;br&gt;&lt;br&gt;Oleg Kalnichevski resolved HTTPCLIENT-813.
&lt;br&gt;------------------------------------------
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; Resolution: Won't Fix
&lt;br&gt;&lt;br&gt;HttpClient 3.x is nearing end of life. There is no point fixing it (unless some one volunteers to provide a complete patch in udiff format including test coverage).
&lt;br&gt;&lt;br&gt;Oleg
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; HttpClient throws NPE on Invalid Port when used with MultiThreadedHttpConnectionManager
&lt;br&gt;&amp;gt; ---------------------------------------------------------------------------------------
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Key: HTTPCLIENT-813
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; URL: &lt;a href=&quot;https://issues.apache.org/jira/browse/HTTPCLIENT-813&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://issues.apache.org/jira/browse/HTTPCLIENT-813&lt;/a&gt;&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Project: HttpComponents HttpClient
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Issue Type: Bug
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Components: HttpClient
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;Affects Versions: 3.1 Final
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Environment: Linux AS 3.1/Java 1.5
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Reporter: Zhihong Zhang
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Attachments: HttpTest.java, HttpTest2.java
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; The HttpClient throws NullPointerException in the main thread when an invalid port (like 80001) is used in the URL. An IllegalArgumentException is thrown in TimeoutGuard thread.
&lt;br&gt;&amp;gt; &amp;nbsp;
&lt;br&gt;&amp;gt; Exception in thread &amp;quot;Timeout guard&amp;quot; java.lang.IllegalArgumentException: port out of range:80001
&lt;br&gt;&amp;gt; 	at java.net.InetSocketAddress.&amp;lt;init&amp;gt;(InetSocketAddress.java:118)
&lt;br&gt;&amp;gt; 	at java.net.Socket.&amp;lt;init&amp;gt;(Socket.java:240)
&lt;br&gt;&amp;gt; 	at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:80)
&lt;br&gt;&amp;gt; 	at org.apache.commons.httpclient.protocol.ControllerThreadSocketFactory$1.doit(ControllerThreadSocketFactory.java:91)
&lt;br&gt;&amp;gt; 	at org.apache.commons.httpclient.protocol.ControllerThreadSocketFactory$SocketTask.run(ControllerThreadSocketFactory.java:158)
&lt;br&gt;&amp;gt; 	at java.lang.Thread.run(Thread.java:613)
&lt;br&gt;&amp;gt; Exception in thread &amp;quot;main&amp;quot; java.lang.NullPointerException
&lt;br&gt;&amp;gt; 	at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:721)
&lt;br&gt;&amp;gt; 	at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.open(MultiThreadedHttpConnectionManager.java:1361)
&lt;br&gt;&amp;gt; 	at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387)
&lt;br&gt;&amp;gt; 	at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
&lt;br&gt;&amp;gt; 	at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
&lt;br&gt;&amp;gt; 	at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323)
&lt;br&gt;&amp;gt; 	at com.aol.test.HttpTest$PoolingHttpConnector.doGet(HttpTest.java:47)
&lt;br&gt;&amp;gt; 	at com.aol.test.HttpTest.main(HttpTest.java:17)
&lt;br&gt;&amp;gt; It should throw a checked exception in main thread so caller can handle the error condition more gracefully.
&lt;br&gt;&amp;gt; The test program is attached. This is caused by a race condition and it's not always reproducible. Running in debugger shows a different behavior.
&lt;br&gt;&amp;gt; package com.aol.test;
&lt;br&gt;&amp;gt; import java.io.IOException;
&lt;br&gt;&amp;gt; import org.apache.commons.httpclient.HttpClient;
&lt;br&gt;&amp;gt; import org.apache.commons.httpclient.HttpStatus;
&lt;br&gt;&amp;gt; import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager;
&lt;br&gt;&amp;gt; import org.apache.commons.httpclient.methods.GetMethod;
&lt;br&gt;&amp;gt; import org.apache.commons.httpclient.params.HttpConnectionManagerParams;
&lt;br&gt;&amp;gt; public class HttpTest {
&lt;br&gt;&amp;gt; 	
&lt;br&gt;&amp;gt; 	public static void main(String[] args) {
&lt;br&gt;&amp;gt; 		PoolingHttpConnector conn = new PoolingHttpConnector();
&lt;br&gt;&amp;gt; 		
&lt;br&gt;&amp;gt; 		try {
&lt;br&gt;&amp;gt; 			String response = conn.doGet(&amp;quot;&lt;a href=&quot;http://www.aol.com:80001&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.aol.com:80001&lt;/a&gt;&amp;quot;);
&lt;br&gt;&amp;gt; 			System.out.println(&amp;quot;Response='&amp;quot; + response + &amp;quot;'&amp;quot;);
&lt;br&gt;&amp;gt; 		} catch (IOException e) {
&lt;br&gt;&amp;gt; 			e.printStackTrace();
&lt;br&gt;&amp;gt; 		}
&lt;br&gt;&amp;gt; 	}
&lt;br&gt;&amp;gt; 	static class PoolingHttpConnector {
&lt;br&gt;&amp;gt; 		
&lt;br&gt;&amp;gt; 		public static final int MAX_TOTAL_CONNECTIONS = 16;
&lt;br&gt;&amp;gt; 		public static final int MAX_CONNECTIONS_PER_HOST = 8;
&lt;br&gt;&amp;gt; 		public static final int CONNECT_TIMEOUT = 5000;
&lt;br&gt;&amp;gt; 		public static final int SOCKET_TIMEOUT = 5000;
&lt;br&gt;&amp;gt; 		public static final boolean TCP_NO_DELAY = true;
&lt;br&gt;&amp;gt; 		
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp;private static MultiThreadedHttpConnectionManager poolManager;
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp;private static HttpConnectionManagerParams httpParams;
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp;private static HttpClient httpClient;
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp;private static boolean initialized = false;
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp;
&lt;br&gt;&amp;gt; 		public PoolingHttpConnector() 
&lt;br&gt;&amp;gt; 		{
&lt;br&gt;&amp;gt; 			initialize();
&lt;br&gt;&amp;gt; 		}
&lt;br&gt;&amp;gt; 		public String doGet(String url) throws IOException {
&lt;br&gt;&amp;gt; 			GetMethod method = new GetMethod(url);
&lt;br&gt;&amp;gt; 					
&lt;br&gt;&amp;gt; 			try {
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;int status = httpClient.executeMethod(method);	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&lt;br&gt;&amp;gt; 		 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;String response = new String(method.getResponseBody());
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (status != HttpStatus.SC_OK)
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;	throw new IOException(&amp;quot;HTTP error: &amp;quot; + response);
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return response;
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&lt;br&gt;&amp;gt; 			} finally {
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;method.releaseConnection();
&lt;br&gt;&amp;gt; 			}
&lt;br&gt;&amp;gt; 	 	} 	
&lt;br&gt;&amp;gt; 	
&lt;br&gt;&amp;gt; 		private synchronized void initialize() {	
&lt;br&gt;&amp;gt; 			if (initialized)
&lt;br&gt;&amp;gt; 				return;
&lt;br&gt;&amp;gt; 			
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;poolManager = new MultiThreadedHttpConnectionManager();
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;httpParams = new HttpConnectionManagerParams();
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;httpParams.setMaxTotalConnections(MAX_TOTAL_CONNECTIONS);
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;httpParams.setDefaultMaxConnectionsPerHost(MAX_CONNECTIONS_PER_HOST);
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;httpParams.setTcpNoDelay(TCP_NO_DELAY);
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;httpParams.setSoTimeout(SOCKET_TIMEOUT);
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;httpParams.setConnectionTimeout(CONNECT_TIMEOUT);
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;poolManager.setParams(httpParams);
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;httpClient = new HttpClient(poolManager);
&lt;br&gt;&amp;gt; 			initialized = true;
&lt;br&gt;&amp;gt; 		}
&lt;br&gt;&amp;gt; 		
&lt;br&gt;&amp;gt; 	}
&lt;br&gt;&amp;gt; }
&lt;/div&gt;&lt;br&gt;-- 
&lt;br&gt;This message is automatically generated by JIRA.
&lt;br&gt;-
&lt;br&gt;You can reply to this email to add a comment to the issue online.
&lt;br&gt;&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe, e-mail: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=21353798&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dev-unsubscribe@...&lt;/a&gt;
&lt;br&gt;For additional commands, e-mail: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=21353798&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dev-help@...&lt;/a&gt;
&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/HttpComponents-Dev-f20179.html&quot; embed=&quot;fixTarget[20179]&quot; target=&quot;_top&quot; &gt;HttpComponents-Dev&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/-jira--Created%3A-%28HTTPCLIENT-813%29-HttpClient-throws-NPE-on-Invalid-Port-when-used-with-MultiThreadedHttpConnectionManager-tp21335629p21353798.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-21353768</id>
	<title>[jira] Updated: (HTTPCLIENT-813) HttpClient throws NPE on Invalid Port when used with MultiThreadedHttpConnectionManager</title>
	<published>2009-01-08T07:14:59Z</published>
	<updated>2009-01-08T07:14:59Z</updated>
	<author>
		<name>JIRA jira@apache.org</name>
	</author>
	<content type="html">&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;[ &lt;a href=&quot;https://issues.apache.org/jira/browse/HTTPCLIENT-813?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://issues.apache.org/jira/browse/HTTPCLIENT-813?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel&lt;/a&gt;&amp;nbsp;]
&lt;br&gt;&lt;br&gt;Oleg Kalnichevski updated HTTPCLIENT-813:
&lt;br&gt;-----------------------------------------
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; Attachment: HttpTest2.java
&lt;br&gt;&lt;br&gt;I can reproduce the bug for HttpClient 3.x using the test case. However, the same code ported to 4.0 API seems to work for me without throwing any exception at all. See HttpTest2 attached.
&lt;br&gt;&lt;br&gt;The bug in HttpClient 3.x can be worked around by providing a better implementation of the ProtocolSocketFactory. 
&lt;br&gt;&lt;br&gt;Oleg
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; HttpClient throws NPE on Invalid Port when used with MultiThreadedHttpConnectionManager
&lt;br&gt;&amp;gt; ---------------------------------------------------------------------------------------
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Key: HTTPCLIENT-813
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; URL: &lt;a href=&quot;https://issues.apache.org/jira/browse/HTTPCLIENT-813&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://issues.apache.org/jira/browse/HTTPCLIENT-813&lt;/a&gt;&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Project: HttpComponents HttpClient
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Issue Type: Bug
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Components: HttpClient
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;Affects Versions: 3.1 Final
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Environment: Linux AS 3.1/Java 1.5
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Reporter: Zhihong Zhang
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Attachments: HttpTest.java, HttpTest2.java
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; The HttpClient throws NullPointerException in the main thread when an invalid port (like 80001) is used in the URL. An IllegalArgumentException is thrown in TimeoutGuard thread.
&lt;br&gt;&amp;gt; &amp;nbsp;
&lt;br&gt;&amp;gt; Exception in thread &amp;quot;Timeout guard&amp;quot; java.lang.IllegalArgumentException: port out of range:80001
&lt;br&gt;&amp;gt; 	at java.net.InetSocketAddress.&amp;lt;init&amp;gt;(InetSocketAddress.java:118)
&lt;br&gt;&amp;gt; 	at java.net.Socket.&amp;lt;init&amp;gt;(Socket.java:240)
&lt;br&gt;&amp;gt; 	at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:80)
&lt;br&gt;&amp;gt; 	at org.apache.commons.httpclient.protocol.ControllerThreadSocketFactory$1.doit(ControllerThreadSocketFactory.java:91)
&lt;br&gt;&amp;gt; 	at org.apache.commons.httpclient.protocol.ControllerThreadSocketFactory$SocketTask.run(ControllerThreadSocketFactory.java:158)
&lt;br&gt;&amp;gt; 	at java.lang.Thread.run(Thread.java:613)
&lt;br&gt;&amp;gt; Exception in thread &amp;quot;main&amp;quot; java.lang.NullPointerException
&lt;br&gt;&amp;gt; 	at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:721)
&lt;br&gt;&amp;gt; 	at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.open(MultiThreadedHttpConnectionManager.java:1361)
&lt;br&gt;&amp;gt; 	at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387)
&lt;br&gt;&amp;gt; 	at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
&lt;br&gt;&amp;gt; 	at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
&lt;br&gt;&amp;gt; 	at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323)
&lt;br&gt;&amp;gt; 	at com.aol.test.HttpTest$PoolingHttpConnector.doGet(HttpTest.java:47)
&lt;br&gt;&amp;gt; 	at com.aol.test.HttpTest.main(HttpTest.java:17)
&lt;br&gt;&amp;gt; It should throw a checked exception in main thread so caller can handle the error condition more gracefully.
&lt;br&gt;&amp;gt; The test program is attached. This is caused by a race condition and it's not always reproducible. Running in debugger shows a different behavior.
&lt;br&gt;&amp;gt; package com.aol.test;
&lt;br&gt;&amp;gt; import java.io.IOException;
&lt;br&gt;&amp;gt; import org.apache.commons.httpclient.HttpClient;
&lt;br&gt;&amp;gt; import org.apache.commons.httpclient.HttpStatus;
&lt;br&gt;&amp;gt; import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager;
&lt;br&gt;&amp;gt; import org.apache.commons.httpclient.methods.GetMethod;
&lt;br&gt;&amp;gt; import org.apache.commons.httpclient.params.HttpConnectionManagerParams;
&lt;br&gt;&amp;gt; public class HttpTest {
&lt;br&gt;&amp;gt; 	
&lt;br&gt;&amp;gt; 	public static void main(String[] args) {
&lt;br&gt;&amp;gt; 		PoolingHttpConnector conn = new PoolingHttpConnector();
&lt;br&gt;&amp;gt; 		
&lt;br&gt;&amp;gt; 		try {
&lt;br&gt;&amp;gt; 			String response = conn.doGet(&amp;quot;&lt;a href=&quot;http://www.aol.com:80001&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.aol.com:80001&lt;/a&gt;&amp;quot;);
&lt;br&gt;&amp;gt; 			System.out.println(&amp;quot;Response='&amp;quot; + response + &amp;quot;'&amp;quot;);
&lt;br&gt;&amp;gt; 		} catch (IOException e) {
&lt;br&gt;&amp;gt; 			e.printStackTrace();
&lt;br&gt;&amp;gt; 		}
&lt;br&gt;&amp;gt; 	}
&lt;br&gt;&amp;gt; 	static class PoolingHttpConnector {
&lt;br&gt;&amp;gt; 		
&lt;br&gt;&amp;gt; 		public static final int MAX_TOTAL_CONNECTIONS = 16;
&lt;br&gt;&amp;gt; 		public static final int MAX_CONNECTIONS_PER_HOST = 8;
&lt;br&gt;&amp;gt; 		public static final int CONNECT_TIMEOUT = 5000;
&lt;br&gt;&amp;gt; 		public static final int SOCKET_TIMEOUT = 5000;
&lt;br&gt;&amp;gt; 		public static final boolean TCP_NO_DELAY = true;
&lt;br&gt;&amp;gt; 		
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp;private static MultiThreadedHttpConnectionManager poolManager;
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp;private static HttpConnectionManagerParams httpParams;
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp;private static HttpClient httpClient;
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp;private static boolean initialized = false;
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp;
&lt;br&gt;&amp;gt; 		public PoolingHttpConnector() 
&lt;br&gt;&amp;gt; 		{
&lt;br&gt;&amp;gt; 			initialize();
&lt;br&gt;&amp;gt; 		}
&lt;br&gt;&amp;gt; 		public String doGet(String url) throws IOException {
&lt;br&gt;&amp;gt; 			GetMethod method = new GetMethod(url);
&lt;br&gt;&amp;gt; 					
&lt;br&gt;&amp;gt; 			try {
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;int status = httpClient.executeMethod(method);	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&lt;br&gt;&amp;gt; 		 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;String response = new String(method.getResponseBody());
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (status != HttpStatus.SC_OK)
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;	throw new IOException(&amp;quot;HTTP error: &amp;quot; + response);
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return response;
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&lt;br&gt;&amp;gt; 			} finally {
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;method.releaseConnection();
&lt;br&gt;&amp;gt; 			}
&lt;br&gt;&amp;gt; 	 	} 	
&lt;br&gt;&amp;gt; 	
&lt;br&gt;&amp;gt; 		private synchronized void initialize() {	
&lt;br&gt;&amp;gt; 			if (initialized)
&lt;br&gt;&amp;gt; 				return;
&lt;br&gt;&amp;gt; 			
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;poolManager = new MultiThreadedHttpConnectionManager();
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;httpParams = new HttpConnectionManagerParams();
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;httpParams.setMaxTotalConnections(MAX_TOTAL_CONNECTIONS);
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;httpParams.setDefaultMaxConnectionsPerHost(MAX_CONNECTIONS_PER_HOST);
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;httpParams.setTcpNoDelay(TCP_NO_DELAY);
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;httpParams.setSoTimeout(SOCKET_TIMEOUT);
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;httpParams.setConnectionTimeout(CONNECT_TIMEOUT);
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;poolManager.setParams(httpParams);
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;httpClient = new HttpClient(poolManager);
&lt;br&gt;&amp;gt; 			initialized = true;
&lt;br&gt;&amp;gt; 		}
&lt;br&gt;&amp;gt; 		
&lt;br&gt;&amp;gt; 	}
&lt;br&gt;&amp;gt; }
&lt;/div&gt;&lt;br&gt;-- 
&lt;br&gt;This message is automatically generated by JIRA.
&lt;br&gt;-
&lt;br&gt;You can reply to this email to add a comment to the issue online.
&lt;br&gt;&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe, e-mail: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=21353768&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dev-unsubscribe@...&lt;/a&gt;
&lt;br&gt;For additional commands, e-mail: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=21353768&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dev-help@...&lt;/a&gt;
&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/HttpComponents-Dev-f20179.html&quot; embed=&quot;fixTarget[20179]&quot; target=&quot;_top&quot; &gt;HttpComponents-Dev&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/-jira--Created%3A-%28HTTPCLIENT-813%29-HttpClient-throws-NPE-on-Invalid-Port-when-used-with-MultiThreadedHttpConnectionManager-tp21335629p21353768.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-21348202</id>
	<title>[GUMP@vmgump]: Project commons-httpclient (in module httpcomponents) failed</title>
	<published>2009-01-08T01:11:05Z</published>
	<updated>2009-01-08T01:11:05Z</updated>
	<author>
		<name>Stefan Bodewig</name>
	</author>
	<content type="html">To whom it may engage...
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;This is an automated request, but not an unsolicited one. For 
&lt;br&gt;more information please visit &lt;a href=&quot;http://gump.apache.org/nagged.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://gump.apache.org/nagged.html&lt;/a&gt;, 
&lt;br&gt;and/or contact the folk at &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=21348202&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;general@...&lt;/a&gt;.
&lt;br&gt;&lt;br&gt;Project commons-httpclient has an issue affecting its community integration.
&lt;br&gt;This issue affects 1 projects,
&lt;br&gt;&amp;nbsp;and has been outstanding for 137 runs.
&lt;br&gt;The current state of this project is 'Failed', with reason 'Configuration Failed'.
&lt;br&gt;For reference only, the following projects are affected by this:
&lt;br&gt;&amp;nbsp; &amp;nbsp; - commons-httpclient : &amp;nbsp;HTTP Client Library, version 3.1
&lt;br&gt;&lt;br&gt;&lt;br&gt;Full details are available at:
&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://vmgump.apache.org/gump/public/httpcomponents/commons-httpclient/index.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://vmgump.apache.org/gump/public/httpcomponents/commons-httpclient/index.html&lt;/a&gt;&lt;br&gt;&lt;br&gt;That said, some information snippets are provided here.
&lt;br&gt;&lt;br&gt;The following annotations (debug/informational/warning/error messages) were provided:
&lt;br&gt;&amp;nbsp;-DEBUG- Sole output [commons-httpclient.jar] identifier set to project name
&lt;br&gt;&amp;nbsp;-INFO- Failed with reason configuration failed
&lt;br&gt;&amp;nbsp;-ERROR- Bad Dependency. Project: commons-logging : unknown to *this* workspace 
&lt;br&gt;&amp;nbsp;-ERROR- Bad Dependency. Project: commons-codec : unknown to *this* workspace 
&lt;br&gt;&amp;nbsp;-DEBUG- Extracted fallback artifacts from Gump Repository
&lt;br&gt;&lt;br&gt;To subscribe to this information via syndicated feeds:
&lt;br&gt;- RSS: &lt;a href=&quot;http://vmgump.apache.org/gump/public/httpcomponents/commons-httpclient/rss.xml&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://vmgump.apache.org/gump/public/httpcomponents/commons-httpclient/rss.xml&lt;/a&gt;&lt;br&gt;- Atom: &lt;a href=&quot;http://vmgump.apache.org/gump/public/httpcomponents/commons-httpclient/atom.xml&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://vmgump.apache.org/gump/public/httpcomponents/commons-httpclient/atom.xml&lt;/a&gt;&lt;br&gt;&lt;br&gt;============================== Gump Tracking Only ===
&lt;br&gt;Produced by Gump version 2.3.
&lt;br&gt;Gump Run 15000008012009, vmgump:vmgump-public:15000008012009
&lt;br&gt;Gump E-mail Identifier (unique within run) #15.
&lt;br&gt;&lt;br&gt;--
&lt;br&gt;Apache Gump
&lt;br&gt;&lt;a href=&quot;http://gump.apache.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://gump.apache.org/&lt;/a&gt;&amp;nbsp;[Instance: vmgump]
&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe, e-mail: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=21348202&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dev-unsubscribe@...&lt;/a&gt;
&lt;br&gt;For additional commands, e-mail: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=21348202&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dev-help@...&lt;/a&gt;
&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/HttpComponents-Dev-f20179.html&quot; embed=&quot;fixTarget[20179]&quot; target=&quot;_top&quot; &gt;HttpComponents-Dev&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/-GUMP%40vmgump-%3A-Project-commons-httpclient-%28in-module-httpcomponents%29-failed-tp21348202p21348202.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-21347353</id>
	<title>[GUMP@vmgump]: Project commons-httpclient-2.0-branch (in module httpcomponents) failed</title>
	<published>2009-01-08T00:04:46Z</published>
	<updated>2009-01-08T00:04:46Z</updated>
	<author>
		<name>Stefan Bodewig</name>
	</author>
	<content type="html">To whom it may engage...
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;This is an automated request, but not an unsolicited one. For 
&lt;br&gt;more information please visit &lt;a href=&quot;http://gump.apache.org/nagged.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://gump.apache.org/nagged.html&lt;/a&gt;, 
&lt;br&gt;and/or contact the folk at &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=21347353&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;general@...&lt;/a&gt;.
&lt;br&gt;&lt;br&gt;Project commons-httpclient-2.0-branch has an issue affecting its community integration.
&lt;br&gt;This issue affects 1 projects,
&lt;br&gt;&amp;nbsp;and has been outstanding for 137 runs.
&lt;br&gt;The current state of this project is 'Failed', with reason 'Configuration Failed'.
&lt;br&gt;For reference only, the following projects are affected by this:
&lt;br&gt;&amp;nbsp; &amp;nbsp; - commons-httpclient-2.0-branch : &amp;nbsp;HTTP Client Library, version 2.0
&lt;br&gt;&lt;br&gt;&lt;br&gt;Full details are available at:
&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://vmgump.apache.org/gump/public/httpcomponents/commons-httpclient-2.0-branch/index.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://vmgump.apache.org/gump/public/httpcomponents/commons-httpclient-2.0-branch/index.html&lt;/a&gt;&lt;br&gt;&lt;br&gt;That said, some information snippets are provided here.
&lt;br&gt;&lt;br&gt;The following annotations (debug/informational/warning/error messages) were provided:
&lt;br&gt;&amp;nbsp;-DEBUG- Sole output [commons-httpclient-2.0.2.jar] identifier set to project name
&lt;br&gt;&amp;nbsp;-INFO- Failed with reason configuration failed
&lt;br&gt;&amp;nbsp;-ERROR- Bad Dependency. Project: commons-logging : unknown to *this* workspace 
&lt;br&gt;&amp;nbsp;-ERROR- Bad Dependency. Project: commons-codec : unknown to *this* workspace 
&lt;br&gt;&amp;nbsp;-DEBUG- Extracted fallback artifacts from Gump Repository
&lt;br&gt;&lt;br&gt;To subscribe to this information via syndicated feeds:
&lt;br&gt;- RSS: &lt;a href=&quot;http://vmgump.apache.org/gump/public/httpcomponents/commons-httpclient-2.0-branch/rss.xml&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://vmgump.apache.org/gump/public/httpcomponents/commons-httpclient-2.0-branch/rss.xml&lt;/a&gt;&lt;br&gt;- Atom: &lt;a href=&quot;http://vmgump.apache.org/gump/public/httpcomponents/commons-httpclient-2.0-branch/atom.xml&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://vmgump.apache.org/gump/public/httpcomponents/commons-httpclient-2.0-branch/atom.xml&lt;/a&gt;&lt;br&gt;&lt;br&gt;============================== Gump Tracking Only ===
&lt;br&gt;Produced by Gump version 2.3.
&lt;br&gt;Gump Run 15000008012009, vmgump:vmgump-public:15000008012009
&lt;br&gt;Gump E-mail Identifier (unique within run) #1.
&lt;br&gt;&lt;br&gt;--
&lt;br&gt;Apache Gump
&lt;br&gt;&lt;a href=&quot;http://gump.apache.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://gump.apache.org/&lt;/a&gt;&amp;nbsp;[Instance: vmgump]
&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe, e-mail: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=21347353&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dev-unsubscribe@...&lt;/a&gt;
&lt;br&gt;For additional commands, e-mail: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=21347353&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dev-help@...&lt;/a&gt;
&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/HttpComponents-Dev-f20179.html&quot; embed=&quot;fixTarget[20179]&quot; target=&quot;_top&quot; &gt;HttpComponents-Dev&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/-GUMP%40vmgump-%3A-Project-commons-httpclient-2.0-branch-%28in-module-httpcomponents%29-failed-tp21347353p21347353.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-21339749</id>
	<title>[jira] Commented: (HTTPCLIENT-787) Redirects with spaces in them are not handled correctly</title>
	<published>2009-01-07T12:36:44Z</published>
	<updated>2009-01-07T12:36:44Z</updated>
	<author>
		<name>JIRA jira@apache.org</name>
	</author>
	<content type="html">&lt;br&gt;&amp;nbsp; &amp;nbsp; [ &lt;a href=&quot;https://issues.apache.org/jira/browse/HTTPCLIENT-787?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&amp;focusedCommentId=12661696#action_12661696&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://issues.apache.org/jira/browse/HTTPCLIENT-787?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&amp;focusedCommentId=12661696#action_12661696&lt;/a&gt;&amp;nbsp;] 
&lt;br&gt;&lt;br&gt;Eric Sword commented on HTTPCLIENT-787:
&lt;br&gt;---------------------------------------
&lt;br&gt;&lt;br&gt;For anyone who comes across this issue and is tied to HttpClient 3.x, it is possible to do this pretty easily by overriding GetMethod.readResponseHeaders (assuming that the main use case for doing this is with GET). &amp;nbsp;The child class can just call super.readResponseHeaders and then check the response header group for any &amp;quot;location&amp;quot; headers with bad URLs. &amp;nbsp;It's not the most obvious approach, but it was the only one I found that works (along with being very simple to implement), so I thought I would record it for posterity.
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Redirects with spaces in them are not handled correctly
&lt;br&gt;&amp;gt; -------------------------------------------------------
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Key: HTTPCLIENT-787
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; URL: &lt;a href=&quot;https://issues.apache.org/jira/browse/HTTPCLIENT-787&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://issues.apache.org/jira/browse/HTTPCLIENT-787&lt;/a&gt;&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Project: HttpComponents HttpClient
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Issue Type: Bug
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Components: HttpClient
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Reporter: Dave Clemmer
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Priority: Minor
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; If a redirect address has spaces in it (yes, I know, the person creating that situation should be beaten, but, alas, that is not an option), they are not converted to %20 before opening, and, hence, fail to open.
&lt;br&gt;&amp;gt; changing line 107 of DefaultRedirectHandler to
&lt;br&gt;&amp;gt; String location = locationHeader.getValue().replaceAll (&amp;quot; &amp;quot;, &amp;quot;%20&amp;quot;);
&lt;br&gt;&amp;gt; seems to fix it.
&lt;/div&gt;&lt;br&gt;-- 
&lt;br&gt;This message is automatically generated by JIRA.
&lt;br&gt;-
&lt;br&gt;You can reply to this email to add a comment to the issue online.
&lt;br&gt;&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe, e-mail: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=21339749&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dev-unsubscribe@...&lt;/a&gt;
&lt;br&gt;For additional commands, e-mail: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=21339749&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dev-help@...&lt;/a&gt;
&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/HttpComponents-Dev-f20179.html&quot; embed=&quot;fixTarget[20179]&quot; target=&quot;_top&quot; &gt;HttpComponents-Dev&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/-jira--Created%3A-%28HTTPCLIENT-787%29-Redirects-with-spaces-in-them-are-not-handled-correctly-tp18490020p21339749.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-21339362</id>
	<title>Re: Submit HTTP requests and asynchronously receive HTTP responses</title>
	<published>2009-01-07T12:13:40Z</published>
	<updated>2009-01-07T12:13:40Z</updated>
	<author>
		<name>olegk</name>
	</author>
	<content type="html">slytherine wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; olegk wrote:
&lt;br&gt;&amp;gt;&amp;gt; Works for me. Please note this example will NOT be able to connect to
&lt;br&gt;&amp;gt;&amp;gt; remote hosts if you are behind a firewall of some kind.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Feel free to add more output to the console to see why connect requests
&lt;br&gt;&amp;gt;&amp;gt; fail. 
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; You may be right here. connect request fails even after setting the http
&lt;br&gt;&amp;gt; proxy in jvm options.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Here is my console output: ( not even entering into initalizeContext(),
&lt;br&gt;&amp;gt; submitRequest(),..)
&lt;br&gt;&amp;gt; Inside MyHttpRequestExecutionHandler
&lt;br&gt;&amp;gt; Initiating SessionRequest..
&lt;br&gt;&amp;gt; Connect request failed: www.yahoo.com:80
&lt;br&gt;&amp;gt; Connect request failed: www.google.com:80
&lt;br&gt;&amp;gt; Connect request failed: www.apache.org:80
&lt;br&gt;&amp;gt; Shutting down I/O reactor
&lt;br&gt;&amp;gt; Shutdown
&lt;br&gt;&amp;gt; Done
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I'm clueless on what to do next.
&lt;br&gt;&amp;gt; 
&lt;/div&gt;&lt;br&gt;HttpCore is a toolkit of low level transport components one can use to 
&lt;br&gt;build custom HTTP services. It does not provide support for HTTP proxies 
&lt;br&gt;out of the box. You'll have to program it by yourself if you want to be 
&lt;br&gt;able to send HTTP requests via a proxy using non-blocking HTTP stack.
&lt;br&gt;&lt;br&gt;There are plans to develop a full-blown HTTP client on top of HttpCore 
&lt;br&gt;NIO, similar to the one based on classic (blocking) I/O. But this will 
&lt;br&gt;happen only if more people are wiling to contribute to this effort.
&lt;br&gt;&lt;br&gt;Oleg
&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe, e-mail: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=21339362&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;httpclient-users-unsubscribe@...&lt;/a&gt;
&lt;br&gt;For additional commands, e-mail: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=21339362&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;httpclient-users-help@...&lt;/a&gt;
&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/HttpClient-User-f20180.html&quot; embed=&quot;fixTarget[20180]&quot; target=&quot;_top&quot; &gt;HttpClient-User&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Submit-HTTP-requests-and-asynchronously-receive-HTTP-responses-tp21328235p21339362.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-21335665</id>
	<title>[jira] Updated: (HTTPCLIENT-813) HttpClient throws NPE on Invalid Port when used with MultiThreadedHttpConnectionManager</title>
	<published>2009-01-07T08:58:44Z</published>
	<updated>2009-01-07T08:58:44Z</updated>
	<author>
		<name>JIRA jira@apache.org</name>
	</author>
	<content type="html">&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;[ &lt;a href=&quot;https://issues.apache.org/jira/browse/HTTPCLIENT-813?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://issues.apache.org/jira/browse/HTTPCLIENT-813?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel&lt;/a&gt;&amp;nbsp;]
&lt;br&gt;&lt;br&gt;Zhihong Zhang updated HTTPCLIENT-813:
&lt;br&gt;-------------------------------------
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; Attachment: HttpTest.java
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; HttpClient throws NPE on Invalid Port when used with MultiThreadedHttpConnectionManager
&lt;br&gt;&amp;gt; ---------------------------------------------------------------------------------------
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Key: HTTPCLIENT-813
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; URL: &lt;a href=&quot;https://issues.apache.org/jira/browse/HTTPCLIENT-813&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://issues.apache.org/jira/browse/HTTPCLIENT-813&lt;/a&gt;&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Project: HttpComponents HttpClient
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Issue Type: Bug
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Components: HttpClient
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;Affects Versions: 3.1 Final
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Environment: Linux AS 3.1/Java 1.5
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Reporter: Zhihong Zhang
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Attachments: HttpTest.java
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; The HttpClient throws NullPointerException in the main thread when an invalid port (like 80001) is used in the URL. An IllegalArgumentException is thrown in TimeoutGuard thread.
&lt;br&gt;&amp;gt; &amp;nbsp;
&lt;br&gt;&amp;gt; Exception in thread &amp;quot;Timeout guard&amp;quot; java.lang.IllegalArgumentException: port out of range:80001
&lt;br&gt;&amp;gt; 	at java.net.InetSocketAddress.&amp;lt;init&amp;gt;(InetSocketAddress.java:118)
&lt;br&gt;&amp;gt; 	at java.net.Socket.&amp;lt;init&amp;gt;(Socket.java:240)
&lt;br&gt;&amp;gt; 	at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:80)
&lt;br&gt;&amp;gt; 	at org.apache.commons.httpclient.protocol.ControllerThreadSocketFactory$1.doit(ControllerThreadSocketFactory.java:91)
&lt;br&gt;&amp;gt; 	at org.apache.commons.httpclient.protocol.ControllerThreadSocketFactory$SocketTask.run(ControllerThreadSocketFactory.java:158)
&lt;br&gt;&amp;gt; 	at java.lang.Thread.run(Thread.java:613)
&lt;br&gt;&amp;gt; Exception in thread &amp;quot;main&amp;quot; java.lang.NullPointerException
&lt;br&gt;&amp;gt; 	at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:721)
&lt;br&gt;&amp;gt; 	at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.open(MultiThreadedHttpConnectionManager.java:1361)
&lt;br&gt;&amp;gt; 	at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387)
&lt;br&gt;&amp;gt; 	at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
&lt;br&gt;&amp;gt; 	at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
&lt;br&gt;&amp;gt; 	at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323)
&lt;br&gt;&amp;gt; 	at com.aol.test.HttpTest$PoolingHttpConnector.doGet(HttpTest.java:47)
&lt;br&gt;&amp;gt; 	at com.aol.test.HttpTest.main(HttpTest.java:17)
&lt;br&gt;&amp;gt; It should throw a checked exception in main thread so caller can handle the error condition more gracefully.
&lt;br&gt;&amp;gt; The test program is attached. This is caused by a race condition and it's not always reproducible. Running in debugger shows a different behavior.
&lt;br&gt;&amp;gt; package com.aol.test;
&lt;br&gt;&amp;gt; import java.io.IOException;
&lt;br&gt;&amp;gt; import org.apache.commons.httpclient.HttpClient;
&lt;br&gt;&amp;gt; import org.apache.commons.httpclient.HttpStatus;
&lt;br&gt;&amp;gt; import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager;
&lt;br&gt;&amp;gt; import org.apache.commons.httpclient.methods.GetMethod;
&lt;br&gt;&amp;gt; import org.apache.commons.httpclient.params.HttpConnectionManagerParams;
&lt;br&gt;&amp;gt; public class HttpTest {
&lt;br&gt;&amp;gt; 	
&lt;br&gt;&amp;gt; 	public static void main(String[] args) {
&lt;br&gt;&amp;gt; 		PoolingHttpConnector conn = new PoolingHttpConnector();
&lt;br&gt;&amp;gt; 		
&lt;br&gt;&amp;gt; 		try {
&lt;br&gt;&amp;gt; 			String response = conn.doGet(&amp;quot;&lt;a href=&quot;http://www.aol.com:80001&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.aol.com:80001&lt;/a&gt;&amp;quot;);
&lt;br&gt;&amp;gt; 			System.out.println(&amp;quot;Response='&amp;quot; + response + &amp;quot;'&amp;quot;);
&lt;br&gt;&amp;gt; 		} catch (IOException e) {
&lt;br&gt;&amp;gt; 			e.printStackTrace();
&lt;br&gt;&amp;gt; 		}
&lt;br&gt;&amp;gt; 	}
&lt;br&gt;&amp;gt; 	static class PoolingHttpConnector {
&lt;br&gt;&amp;gt; 		
&lt;br&gt;&amp;gt; 		public static final int MAX_TOTAL_CONNECTIONS = 16;
&lt;br&gt;&amp;gt; 		public static final int MAX_CONNECTIONS_PER_HOST = 8;
&lt;br&gt;&amp;gt; 		public static final int CONNECT_TIMEOUT = 5000;
&lt;br&gt;&amp;gt; 		public static final int SOCKET_TIMEOUT = 5000;
&lt;br&gt;&amp;gt; 		public static final boolean TCP_NO_DELAY = true;
&lt;br&gt;&amp;gt; 		
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp;private static MultiThreadedHttpConnectionManager poolManager;
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp;private static HttpConnectionManagerParams httpParams;
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp;private static HttpClient httpClient;
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp;private static boolean initialized = false;
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp;
&lt;br&gt;&amp;gt; 		public PoolingHttpConnector() 
&lt;br&gt;&amp;gt; 		{
&lt;br&gt;&amp;gt; 			initialize();
&lt;br&gt;&amp;gt; 		}
&lt;br&gt;&amp;gt; 		public String doGet(String url) throws IOException {
&lt;br&gt;&amp;gt; 			GetMethod method = new GetMethod(url);
&lt;br&gt;&amp;gt; 					
&lt;br&gt;&amp;gt; 			try {
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;int status = httpClient.executeMethod(method);	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&lt;br&gt;&amp;gt; 		 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;String response = new String(method.getResponseBody());
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (status != HttpStatus.SC_OK)
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;	throw new IOException(&amp;quot;HTTP error: &amp;quot; + response);
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return response;
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&lt;br&gt;&amp;gt; 			} finally {
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;method.releaseConnection();
&lt;br&gt;&amp;gt; 			}
&lt;br&gt;&amp;gt; 	 	} 	
&lt;br&gt;&amp;gt; 	
&lt;br&gt;&amp;gt; 		private synchronized void initialize() {	
&lt;br&gt;&amp;gt; 			if (initialized)
&lt;br&gt;&amp;gt; 				return;
&lt;br&gt;&amp;gt; 			
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;poolManager = new MultiThreadedHttpConnectionManager();
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;httpParams = new HttpConnectionManagerParams();
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;httpParams.setMaxTotalConnections(MAX_TOTAL_CONNECTIONS);
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;httpParams.setDefaultMaxConnectionsPerHost(MAX_CONNECTIONS_PER_HOST);
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;httpParams.setTcpNoDelay(TCP_NO_DELAY);
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;httpParams.setSoTimeout(SOCKET_TIMEOUT);
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;httpParams.setConnectionTimeout(CONNECT_TIMEOUT);
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;poolManager.setParams(httpParams);
&lt;br&gt;&amp;gt; 	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;httpClient = new HttpClient(poolManager);
&lt;br&gt;&amp;gt; 			initialized = true;
&lt;br&gt;&amp;gt; 		}
&lt;br&gt;&amp;gt; 		
&lt;br&gt;&amp;gt; 	}
&lt;br&gt;&amp;gt; }
&lt;/div&gt;&lt;br&gt;-- 
&lt;br&gt;This message is automatically generated by JIRA.
&lt;br&gt;-
&lt;br&gt;You can reply to this email to add a comment to the issue online.
&lt;br&gt;&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe, e-mail: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=21335665&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dev-unsubscribe@...&lt;/a&gt;
&lt;br&gt;For additional commands, e-mail: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=21335665&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dev-help@...&lt;/a&gt;
&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/HttpComponents-Dev-f20179.html&quot; embed=&quot;fixTarget[20179]&quot; target=&quot;_top&quot; &gt;HttpComponents-Dev&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/-jira--Created%3A-%28HTTPCLIENT-813%29-HttpClient-throws-NPE-on-Invalid-Port-when-used-with-MultiThreadedHttpConnectionManager-tp21335629p21335665.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-21335629</id>
	<title>[jira] Created: (HTTPCLIENT-813) HttpClient throws NPE on Invalid Port when used with MultiThreadedHttpConnectionManager</title>
	<published>2009-01-07T08:56:44Z</published>
	<updated>2009-01-07T08:56:44Z</updated>
	<author>
		<name>JIRA jira@apache.org</name>
	</author>
	<content type="html">HttpClient throws NPE on Invalid Port when used with MultiThreadedHttpConnectionManager
&lt;br&gt;---------------------------------------------------------------------------------------
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Key: HTTPCLIENT-813
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;URL: &lt;a href=&quot;https://issues.apache.org/jira/browse/HTTPCLIENT-813&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://issues.apache.org/jira/browse/HTTPCLIENT-813&lt;/a&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Project: HttpComponents HttpClient
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Issue Type: Bug
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Components: HttpClient
&lt;br&gt;&amp;nbsp; &amp;nbsp; Affects Versions: 3.1 Final
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Environment: Linux AS 3.1/Java 1.5
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Reporter: Zhihong Zhang
&lt;br&gt;&lt;br&gt;&lt;br&gt;The HttpClient throws NullPointerException in the main thread when an invalid port (like 80001) is used in the URL. An IllegalArgumentException is thrown in TimeoutGuard thread.
&lt;br&gt;&amp;nbsp;
&lt;br&gt;Exception in thread &amp;quot;Timeout guard&amp;quot; java.lang.IllegalArgumentException: port out of range:80001
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; at java.net.InetSocketAddress.&amp;lt;init&amp;gt;(InetSocketAddress.java:118)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; at java.net.Socket.&amp;lt;init&amp;gt;(Socket.java:240)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:80)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; at org.apache.commons.httpclient.protocol.ControllerThreadSocketFactory$1.doit(ControllerThreadSocketFactory.java:91)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; at org.apache.commons.httpclient.protocol.ControllerThreadSocketFactory$SocketTask.run(ControllerThreadSocketFactory.java:158)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; at java.lang.Thread.run(Thread.java:613)
&lt;br&gt;Exception in thread &amp;quot;main&amp;quot; java.lang.NullPointerException
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:721)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.open(MultiThreadedHttpConnectionManager.java:1361)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; at com.aol.test.HttpTest$PoolingHttpConnector.doGet(HttpTest.java:47)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; at com.aol.test.HttpTest.main(HttpTest.java:17)
&lt;br&gt;&lt;br&gt;It should throw a checked exception in main thread so caller can handle the error condition more gracefully.
&lt;br&gt;&lt;br&gt;The test program is attached. This is caused by a race condition and it's not always reproducible. Running in debugger shows a different behavior.
&lt;br&gt;&lt;br&gt;package com.aol.test;
&lt;br&gt;&lt;br&gt;import java.io.IOException;
&lt;br&gt;&lt;br&gt;import org.apache.commons.httpclient.HttpClient;
&lt;br&gt;import org.apache.commons.httpclient.HttpStatus;
&lt;br&gt;import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager;
&lt;br&gt;import org.apache.commons.httpclient.methods.GetMethod;
&lt;br&gt;import org.apache.commons.httpclient.params.HttpConnectionManagerParams;
&lt;br&gt;&lt;br&gt;public class HttpTest {
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public static void main(String[] args) {
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; PoolingHttpConnector conn = new PoolingHttpConnector();
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; try {
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; String response = conn.doGet(&amp;quot;&lt;a href=&quot;http://www.aol.com:80001&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.aol.com:80001&lt;/a&gt;&amp;quot;);
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(&amp;quot;Response='&amp;quot; + response + &amp;quot;'&amp;quot;);
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } catch (IOException e) {
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; e.printStackTrace();
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&lt;br&gt;&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; static class PoolingHttpConnector {
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public static final int MAX_TOTAL_CONNECTIONS = 16;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public static final int MAX_CONNECTIONS_PER_HOST = 8;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public static final int CONNECT_TIMEOUT = 5000;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public static final int SOCKET_TIMEOUT = 5000;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public static final boolean TCP_NO_DELAY = true;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private static MultiThreadedHttpConnectionManager poolManager;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private static HttpConnectionManagerParams httpParams;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private static HttpClient httpClient;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private static boolean initialized = false;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public PoolingHttpConnector() 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; initialize();
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public String doGet(String url) throws IOException {
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; GetMethod method = new GetMethod(url);
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; try {
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int status = httpClient.executeMethod(method);	 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; String response = new String(method.getResponseBody());
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (status != HttpStatus.SC_OK)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 	throw new IOException(&amp;quot;HTTP error: &amp;quot; + response);
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return response;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } finally {
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; method.releaseConnection();
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;	} 	
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private synchronized void initialize() {	
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (initialized)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; poolManager = new MultiThreadedHttpConnectionManager();
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; httpParams = new HttpConnectionManagerParams();
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; httpParams.setMaxTotalConnections(MAX_TOTAL_CONNECTIONS);
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; httpParams.setDefaultMaxConnectionsPerHost(MAX_CONNECTIONS_PER_HOST);
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; httpParams.setTcpNoDelay(TCP_NO_DELAY);
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; httpParams.setSoTimeout(SOCKET_TIMEOUT);
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; httpParams.setConnectionTimeout(CONNECT_TIMEOUT);
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; poolManager.setParams(httpParams);
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; httpClient = new HttpClient(poolManager);
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; initialized = true;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&lt;br&gt;}
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;This message is automatically generated by JIRA.
&lt;br&gt;-
&lt;br&gt;You can reply to this email to add a comment to the issue online.
&lt;br&gt;&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe, e-mail: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=21335629&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dev-unsubscribe@...&lt;/a&gt;
&lt;br&gt;For additional commands, e-mail: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=21335629&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dev-help@...&lt;/a&gt;
&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/HttpComponents-Dev-f20179.html&quot; embed=&quot;fixTarget[20179]&quot; target=&quot;_top&quot; &gt;HttpComponents-Dev&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/-jira--Created%3A-%28HTTPCLIENT-813%29-HttpClient-throws-NPE-on-Invalid-Port-when-used-with-MultiThreadedHttpConnectionManager-tp21335629p21335629.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-21330449</id>
	<title>Re: Submit HTTP requests and asynchronously receive HTTP responses</title>
	<published>2009-01-07T04:33:43Z</published>
	<updated>2009-01-07T04:33:43Z</updated>
	<author>
		<name>slytherine</name>
	</author>
	<content type="html">&lt;blockquote class=&quot;quote light-black dark-border-color&quot;&gt;&lt;div class=&quot;quote light-border-color&quot;&gt;
&lt;div class=&quot;quote-author&quot; style=&quot;font-weight: bold;&quot;&gt;olegk wrote:&lt;/div&gt;
&lt;div class=&quot;quote-message&quot;&gt;Works for me. Please note this example will NOT be able to connect to
&lt;br&gt;remote hosts if you are behind a firewall of some kind.
&lt;br&gt;&lt;br&gt;Feel free to add more output to the console to see why connect requests
&lt;br&gt;fail. 
&lt;/div&gt;
&lt;/div&gt;&lt;/blockquote&gt;
You may be right here. connect request fails even after setting the http proxy in jvm options.
&lt;br&gt;&lt;br&gt;Here is my console output: ( not even entering into initalizeContext(), submitRequest(),..)
&lt;br&gt;Inside MyHttpRequestExecutionHandler
&lt;br&gt;Initiating SessionRequest..
&lt;br&gt;Connect request failed: www.yahoo.com:80
&lt;br&gt;Connect request failed: www.google.com:80
&lt;br&gt;Connect request failed: www.apache.org:80
&lt;br&gt;Shutting down I/O reactor
&lt;br&gt;Shutdown
&lt;br&gt;Done
&lt;br&gt;&lt;br&gt;I'm clueless on what to do next.
&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/HttpClient-User-f20180.html&quot; embed=&quot;fixTarget[20180]&quot; target=&quot;_top&quot; &gt;HttpClient-User&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Submit-HTTP-requests-and-asynchronously-receive-HTTP-responses-tp21328235p21330449.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-21329508</id>
	<title>Re: Submit HTTP requests and asynchronously receive HTTP responses</title>
	<published>2009-01-07T03:29:25Z</published>
	<updated>2009-01-07T03:29:25Z</updated>
	<author>
		<name>olegk</name>
	</author>
	<content type="html">On Wed, 2009-01-07 at 02:40 -0800, slytherine wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; olegk wrote:
&lt;br&gt;&amp;gt; &amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt; On Wed, 2009-01-07 at 01:57 -0800, sveno wrote:
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; Hi,
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; I am looking for a basic example using NHttpClientConnection where It can
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; be
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; used to submit HTTP requests and asynchronously receive HTTP responses. 
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; In my app, I am extablishing a connection and freeze the connection for
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; few
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; minutes in the server-side( long polling). The response will be sent to
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; the
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; client, &amp;nbsp;if some event occurs or when the freezing time out expires.
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; Here, I
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; don't want to block the connections rather I just want to use the
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; asynchronous (non-blocking) approach just like the above class. (submit
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; HTTP
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; requests and asynchronously receive HTTP responses)
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; It would be great if you could be provide some working example using
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; NHttpClientConnection.
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; Thanks
&lt;br&gt;&amp;gt; &amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt; &lt;a href=&quot;http://svn.apache.org/repos/asf/httpcomponents/httpcore/trunk/module-nio/src/examples/org/apache/http/examples/nio/NHttpClient.java&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://svn.apache.org/repos/asf/httpcomponents/httpcore/trunk/module-nio/src/examples/org/apache/http/examples/nio/NHttpClient.java&lt;/a&gt;&lt;br&gt;&amp;gt; &amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt; Thanks for the reply.
&lt;br&gt;&amp;gt; &amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt; But this example doesn't seems to be working for me.
&lt;br&gt;&amp;gt; &amp;gt; Reactor starts and then it shutdown,nothing happens in the middle.
&lt;br&gt;&amp;gt; &amp;gt; Is that something I'm missing here.
&lt;br&gt;&amp;gt; &amp;gt; 
&lt;/div&gt;&lt;br&gt;Works for me. Please note this example will NOT be able to connect to
&lt;br&gt;remote hosts if you are behind a firewall of some kind.
&lt;br&gt;&lt;br&gt;Feel free to add more output to the console to see why connect requests
&lt;br&gt;fail. 
&lt;br&gt;&lt;br&gt;---
&lt;br&gt;&amp;nbsp; &amp;nbsp; static class MySessionRequestCallback implements
&lt;br&gt;SessionRequestCallback {
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private final CountDownLatch requestCount; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public MySessionRequestCallback(final CountDownLatch
&lt;br&gt;requestCount) {
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; super();
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; this.requestCount = requestCount;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public void cancelled(final SessionRequest request) {
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(&amp;quot;Connect request cancelled: &amp;quot; +
&lt;br&gt;request.getRemoteAddress());
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; this.requestCount.countDown();
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public void completed(final SessionRequest request) {
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public void failed(final SessionRequest request) {
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(&amp;quot;Connect request failed: &amp;quot; +
&lt;br&gt;request.getRemoteAddress());
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; this.requestCount.countDown();
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public void timeout(final SessionRequest request) {
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(&amp;quot;Connect request timed out: &amp;quot; +
&lt;br&gt;request.getRemoteAddress());
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; this.requestCount.countDown();
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;nbsp; &amp;nbsp; }
&lt;br&gt;--- 
&lt;br&gt;&lt;br&gt;Oleg
&lt;br&gt;&lt;br&gt;&amp;gt; 
&lt;br&gt;&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe, e-mail: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=21329508&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;httpclient-users-unsubscribe@...&lt;/a&gt;
&lt;br&gt;For additional commands, e-mail: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=21329508&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;httpclient-users-help@...&lt;/a&gt;
&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/HttpClient-User-f20180.html&quot; embed=&quot;fixTarget[20180]&quot; target=&quot;_top&quot; &gt;HttpClient-User&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Submit-HTTP-requests-and-asynchronously-receive-HTTP-responses-tp21328235p21329508.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-21329319</id>
	<title>Connecting to webservice</title>
	<published>2009-01-07T03:14:09Z</published>
	<updated>2009-01-07T03:14:09Z</updated>
	<author>
		<name>sivasaibabu.parupalli</name>
	</author>
	<content type="html">Hi,
&lt;br&gt;&amp;nbsp;I have one webservice to connect and get the result. It is very secure
&lt;br&gt;and it has .pfx certificate and login credentials. I am accessing this
&lt;br&gt;from behind a fire wall and got necessary permissions from the web
&lt;br&gt;service provider for our fire wall. Now I can open wsdl file from my
&lt;br&gt;browser.
&lt;br&gt;&lt;br&gt;Can any one tell me is it possible to connect to the web service by
&lt;br&gt;using Httpclient by posting soap request by configuring certificate.
&lt;br&gt;Is it ok to send id and password in a soap request?
&lt;br&gt;Please can any one send sample code in this. What special care needs to
&lt;br&gt;be taken apart from connecting to normal url?
&lt;br&gt;Any ideas will be greatly helpful for me.
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;Thanks and Regards, 
&lt;br&gt;Sai, 
&lt;br&gt;pp3.2.46, BT Ipswich ISU, Bibb Way, Ipswich, 
&lt;br&gt;Suffolk, IP1 2EQ,UK 
&lt;br&gt;+44 1473 348748 
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/HttpClient-User-f20180.html&quot; embed=&quot;fixTarget[20180]&quot; target=&quot;_top&quot; &gt;HttpClient-User&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Connecting-to-webservice-tp21329319p21329319.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-21328853</id>
	<title>Re: Submit HTTP requests and asynchronously receive HTTP responses</title>
	<published>2009-01-07T02:40:58Z</published>
	<updated>2009-01-07T02:40:58Z</updated>
	<author>
		<name>slytherine</name>
	</author>
	<content type="html">&lt;blockquote class=&quot;quote light-black dark-border-color&quot;&gt;&lt;div class=&quot;quote light-border-color&quot;&gt;
&lt;div class=&quot;quote-author&quot; style=&quot;font-weight: bold;&quot;&gt;olegk wrote:&lt;/div&gt;
&lt;div class=&quot;quote-message shrinkable-quote&quot;&gt;On Wed, 2009-01-07 at 01:57 -0800, sveno wrote:
&lt;br&gt;&amp;gt; Hi,
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I am looking for a basic example using NHttpClientConnection where It can be
&lt;br&gt;&amp;gt; used to submit HTTP requests and asynchronously receive HTTP responses. 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; In my app, I am extablishing a connection and freeze the connection for few
&lt;br&gt;&amp;gt; minutes in the server-side( long polling). The response will be sent to the
&lt;br&gt;&amp;gt; client, &amp;nbsp;if some event occurs or when the freezing time out expires. Here, I
&lt;br&gt;&amp;gt; don't want to block the connections rather I just want to use the
&lt;br&gt;&amp;gt; asynchronous (non-blocking) approach just like the above class. (submit HTTP
&lt;br&gt;&amp;gt; requests and asynchronously receive HTTP responses)
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; It would be great if you could be provide some working example using
&lt;br&gt;&amp;gt; NHttpClientConnection.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Thanks
&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://svn.apache.org/repos/asf/httpcomponents/httpcore/trunk/module-nio/src/examples/org/apache/http/examples/nio/NHttpClient.java&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://svn.apache.org/repos/asf/httpcomponents/httpcore/trunk/module-nio/src/examples/org/apache/http/examples/nio/NHttpClient.java&lt;/a&gt;&lt;br&gt;&lt;br&gt;Thanks for the reply.
&lt;br&gt;&lt;br&gt;But this example doesn't seems to be working for me.
&lt;br&gt;Reactor starts and then it shutdown,nothing happens in the middle.
&lt;br&gt;Is that something I'm missing here.
&lt;/div&gt;
&lt;/div&gt;&lt;/blockquote&gt;
&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/HttpClient-User-f20180.html&quot; embed=&quot;fixTarget[20180]&quot; target=&quot;_top&quot; &gt;HttpClient-User&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Submit-HTTP-requests-and-asynchronously-receive-HTTP-responses-tp21328235p21328853.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-21328570</id>
	<title>Re: Submit HTTP requests and asynchronously receive HTTP responses</title>
	<published>2009-01-07T02:20:36Z</published>
	<updated>2009-01-07T02:20:36Z</updated>
	<author>
		<name>olegk</name>
	</author>
	<content type="html">On Wed, 2009-01-07 at 01:57 -0800, sveno wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hi,
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I am looking for a basic example using NHttpClientConnection where It can be
&lt;br&gt;&amp;gt; used to submit HTTP requests and asynchronously receive HTTP responses. 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; In my app, I am extablishing a connection and freeze the connection for few
&lt;br&gt;&amp;gt; minutes in the server-side( long polling). The response will be sent to the
&lt;br&gt;&amp;gt; client, &amp;nbsp;if some event occurs or when the freezing time out expires. Here, I
&lt;br&gt;&amp;gt; don't want to block the connections rather I just want to use the
&lt;br&gt;&amp;gt; asynchronous (non-blocking) approach just like the above class. (submit HTTP
&lt;br&gt;&amp;gt; requests and asynchronously receive HTTP responses)
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; It would be great if you could be provide some working example using
&lt;br&gt;&amp;gt; NHttpClientConnection.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Thanks
&lt;/div&gt;&lt;br&gt;&lt;a href=&quot;http://svn.apache.org/repos/asf/httpcomponents/httpcore/trunk/module-nio/src/examples/org/apache/http/examples/nio/NHttpClient.java&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://svn.apache.org/repos/asf/httpcomponents/httpcore/trunk/module-nio/src/examples/org/apache/http/examples/nio/NHttpClient.java&lt;/a&gt;&lt;br&gt;&lt;br&gt;More examples can be found here:
&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://hc.apache.org/httpcomponents-core/examples.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://hc.apache.org/httpcomponents-core/examples.html&lt;/a&gt;&lt;br&gt;&lt;br&gt;HttpCore tutorial draft can be found here:
&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://wiki.apache.org/HttpComponents/HttpCoreTutorial#head-8cb5537621a15607ec286c525bb4a5fb0ac76d45&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://wiki.apache.org/HttpComponents/HttpCoreTutorial#head-8cb5537621a15607ec286c525bb4a5fb0ac76d45&lt;/a&gt;&lt;br&gt;&lt;br&gt;Oleg
&lt;br&gt;&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe, e-mail: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=21328570&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;httpclient-users-unsubscribe@...&lt;/a&gt;
&lt;br&gt;For additional commands, e-mail: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=21328570&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;httpclient-users-help@...&lt;/a&gt;
&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/HttpClient-User-f20180.html&quot; embed=&quot;fixTarget[20180]&quot; target=&quot;_top&quot; &gt;HttpClient-User&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Submit-HTTP-requests-and-asynchronously-receive-HTTP-responses-tp21328235p21328570.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-21328235</id>
	<title>Submit HTTP requests and asynchronously receive HTTP responses</title>
	<published>2009-01-07T01:57:13Z</published>
	<updated>2009-01-07T01:57:13Z</updated>
	<author>
		<name>slytherine</name>
	</author>
	<content type="html">Hi,

I am looking for a basic example using NHttpClientConnection where It can be used to submit HTTP requests and asynchronously receive HTTP responses. 

In my app, I am extablishing a connection and freeze the connection for few minutes in the server-side( long polling). The response will be sent to the client,  if some event occurs or when the freezing time out expires. Here, I don't want to block the connections rather I just want to use the asynchronous (non-blocking) approach just like the above class. (submit HTTP requests and asynchronously receive HTTP responses)

It would be great if you could be provide some working example using NHttpClientConnection.

Thanks&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/HttpClient-User-f20180.html&quot; embed=&quot;fixTarget[20180]&quot; target=&quot;_top&quot; &gt;HttpClient-User&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Submit-HTTP-requests-and-asynchronously-receive-HTTP-responses-tp21328235p21328235.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-21328074</id>
	<title>RE: FW: HttpClient authentication problem.</title>
	<published>2009-01-07T01:38:34Z</published>
	<updated>2009-01-07T01:38:34Z</updated>
	<author>
		<name>olegk</name>
	</author>
	<content type="html">On Tue, 2009-01-06 at 15:21 -0800, Pankaj Arora wrote:
&lt;br&gt;&amp;gt; Hi Odi and Roland,
&lt;br&gt;&amp;gt; Was curious to know if this feature finally made to 4.0.
&lt;br&gt;&lt;br&gt;Yes, it has
&lt;br&gt;&lt;br&gt;&lt;br&gt;&amp;gt; &amp;nbsp;Moreover when final 4.0 verison for commons is expected?
&lt;br&gt;&amp;gt; 
&lt;br&gt;&lt;br&gt;Q2 2009
&lt;br&gt;&lt;br&gt;Oleg
&lt;br&gt;&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Thanks,
&lt;br&gt;&amp;gt; Pankaj Arora
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Hi Odi,
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt; I would actually consider this a security issue in the connection
&lt;br&gt;&amp;gt; &amp;gt; managers: It may hand out an already authenticated connection to an 
&lt;br&gt;&amp;gt; &amp;gt; unsuspecting client. We should add fields to HttpConnection that keep 
&lt;br&gt;&amp;gt; &amp;gt; track of the credentials for connection oriented AuthSchemes. So 
&lt;br&gt;&amp;gt; &amp;gt; connection managers can take this into account. Also the connection 
&lt;br&gt;&amp;gt; &amp;gt; managers lack a parameter in the getConnection methods that carries 
&lt;br&gt;&amp;gt; &amp;gt; authentication information for connection based auth schemes.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; It's on my list for 4.0, though it won't make it into client alpha1:
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://wiki.apache.org/jakarta-httpclient/ConnectionManagementDesign&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://wiki.apache.org/jakarta-httpclient/ConnectionManagementDesign&lt;/a&gt;&lt;br&gt;&amp;gt; It's not urgent since we won't have NTLM support for a while.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I don't think we can or should squeeze this into 3.x anymore.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; cheers,
&lt;br&gt;&amp;gt; &amp;nbsp; Roland
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; -----Original Message-----
&lt;br&gt;&amp;gt; From: Ortwin Glück [mailto:&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=21328074&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;odi@...&lt;/a&gt;] 
&lt;br&gt;&amp;gt; Sent: Friday, May 18, 2007 5:41 AM
&lt;br&gt;&amp;gt; To: HttpComponents Project
&lt;br&gt;&amp;gt; Subject: Re: FW: HttpClient authentication problem.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Pankaj,
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; NTLM is designed to authenticate a connection. AFAIK it does not support 
&lt;br&gt;&amp;gt; a &amp;quot;logout&amp;quot; in the middle of a connection, nor does it support preemptive 
&lt;br&gt;&amp;gt; authentication. So the only way to force a new authentication is to 
&lt;br&gt;&amp;gt; close the connection. (e.g. try and clear the authentication to a mapped 
&lt;br&gt;&amp;gt; network drive in Windows. Probably the same issue there.)
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Thus it's not possible to share a connection between users when using 
&lt;br&gt;&amp;gt; NTLM auth. Yes, this may cause a performance hit if you were planning to 
&lt;br&gt;&amp;gt; share a connection between different users.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; You could tweak your connection manager to remember the authenticated 
&lt;br&gt;&amp;gt; user for each connection and try to find an already authenticated one or 
&lt;br&gt;&amp;gt; hand out a new one if you can't.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I would actually consider this a security issue in the connection 
&lt;br&gt;&amp;gt; managers: It may hand out an already authenticated connection to an 
&lt;br&gt;&amp;gt; unsuspecting client. We should add fields to HttpConnection that keep 
&lt;br&gt;&amp;gt; track of the credentials for connection oriented AuthSchemes. So 
&lt;br&gt;&amp;gt; connection managers can take this into account. Also the connection 
&lt;br&gt;&amp;gt; managers lack a parameter in the getConnection methods that carries 
&lt;br&gt;&amp;gt; authentication information for connection based auth schemes.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Ortwin
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Pankaj Arora wrote:
&lt;br&gt;&amp;gt; &amp;gt; Thanks, That worked for me. Only thing that worries me is that
&lt;br&gt;&amp;gt; &amp;gt; connections don't persist now. It might be a performance issue. Only
&lt;br&gt;&amp;gt; &amp;gt; thing which I would like to know from you( as I am bit novice here)-
&lt;br&gt;&amp;gt; &amp;gt; what is the right behavior, my client not authenticating second time
&lt;br&gt;&amp;gt; &amp;gt; as connection is already authenticated or closing the connections to
&lt;br&gt;&amp;gt; &amp;gt; force authentication repeatedly.
&lt;br&gt;&amp;gt; &amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt; Thanks, Pankaj Arora.
&lt;br&gt;&amp;gt; 
&lt;/div&gt;&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe, e-mail: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=21328074&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dev-unsubscribe@...&lt;/a&gt;
&lt;br&gt;For additional commands, e-mail: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=21328074&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dev-help@...&lt;/a&gt;
&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/HttpComponents-Dev-f20179.html&quot; embed=&quot;fixTarget[20179]&quot; target=&quot;_top&quot; &gt;HttpComponents-Dev&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/FW%3A-HttpClient-authentication-problem.-tp10675834p21328074.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-21321616</id>
	<title>RE: FW: HttpClient authentication problem.</title>
	<published>2009-01-06T15:21:19Z</published>
	<updated>2009-01-06T15:21:19Z</updated>
	<author>
		<name>Pankaj Arora-3</name>
	</author>
	<content type="html">Hi Odi and Roland,
&lt;br&gt;Was curious to know if this feature finally made to 4.0. Moreover when final 4.0 verison for commons is expected?
&lt;br&gt;&lt;br&gt;Thanks,
&lt;br&gt;Pankaj Arora
&lt;br&gt;&lt;br&gt;&lt;br&gt;Hi Odi,
&lt;br&gt;&lt;br&gt;&amp;gt; I would actually consider this a security issue in the connection
&lt;br&gt;&amp;gt; managers: It may hand out an already authenticated connection to an 
&lt;br&gt;&amp;gt; unsuspecting client. We should add fields to HttpConnection that keep 
&lt;br&gt;&amp;gt; track of the credentials for connection oriented AuthSchemes. So 
&lt;br&gt;&amp;gt; connection managers can take this into account. Also the connection 
&lt;br&gt;&amp;gt; managers lack a parameter in the getConnection methods that carries 
&lt;br&gt;&amp;gt; authentication information for connection based auth schemes.
&lt;br&gt;&lt;br&gt;It's on my list for 4.0, though it won't make it into client alpha1:
&lt;br&gt;&lt;a href=&quot;http://wiki.apache.org/jakarta-httpclient/ConnectionManagementDesign&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://wiki.apache.org/jakarta-httpclient/ConnectionManagementDesign&lt;/a&gt;&lt;br&gt;It's not urgent since we won't have NTLM support for a while.
&lt;br&gt;&lt;br&gt;I don't think we can or should squeeze this into 3.x anymore.
&lt;br&gt;&lt;br&gt;cheers,
&lt;br&gt;&amp;nbsp; Roland
&lt;br&gt;&lt;br&gt;-----Original Message-----
&lt;br&gt;From: Ortwin Glück [mailto:&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=21321616&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;odi@...&lt;/a&gt;] 
&lt;br&gt;Sent: Friday, May 18, 2007 5:41 AM
&lt;br&gt;To: HttpComponents Project
&lt;br&gt;Subject: Re: FW: HttpClient authentication problem.
&lt;br&gt;&lt;br&gt;Pankaj,
&lt;br&gt;&lt;br&gt;NTLM is designed to authenticate a connection. AFAIK it does not support 
&lt;br&gt;a &amp;quot;logout&amp;quot; in the middle of a connection, nor does it support preemptive 
&lt;br&gt;authentication. So the only way to force a new authentication is to 
&lt;br&gt;close the connection. (e.g. try and clear the authentication to a mapped 
&lt;br&gt;network drive in Windows. Probably the same issue there.)
&lt;br&gt;&lt;br&gt;Thus it's not possible to share a connection between users when using 
&lt;br&gt;NTLM auth. Yes, this may cause a performance hit if you were planning to 
&lt;br&gt;share a connection between different users.
&lt;br&gt;&lt;br&gt;You could tweak your connection manager to remember the authenticated 
&lt;br&gt;user for each connection and try to find an already authenticated one or 
&lt;br&gt;hand out a new one if you can't.
&lt;br&gt;&lt;br&gt;I would actually consider this a security issue in the connection 
&lt;br&gt;managers: It may hand out an already authenticated connection to an 
&lt;br&gt;unsuspecting client. We should add fields to HttpConnection that keep 
&lt;br&gt;track of the credentials for connection oriented AuthSchemes. So 
&lt;br&gt;connection managers can take this into account. Also the connection 
&lt;br&gt;managers lack a parameter in the getConnection methods that carries 
&lt;br&gt;authentication information for connection based auth schemes.
&lt;br&gt;&lt;br&gt;Ortwin
&lt;br&gt;&lt;br&gt;&lt;br&gt;Pankaj Arora wrote:
&lt;br&gt;&amp;gt; Thanks, That worked for me. Only thing that worries me is that
&lt;br&gt;&amp;gt; connections don't persist now. It might be a performance issue. Only
&lt;br&gt;&amp;gt; thing which I would like to know from you( as I am bit novice here)-
&lt;br&gt;&amp;gt; what is the right behavior, my client not authenticating second time
&lt;br&gt;&amp;gt; as connection is already authenticated or closing the connections to
&lt;br&gt;&amp;gt; force authentication repeatedly.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Thanks, Pankaj Arora.
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;[web] &amp;nbsp;&lt;a href=&quot;http://www.odi.ch/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.odi.ch/&lt;/a&gt;&lt;br&gt;[blog] &lt;a href=&quot;http://www.odi.ch/weblog/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.odi.ch/weblog/&lt;/a&gt;&lt;br&gt;[pgp] &amp;nbsp;key 0x81CF3416
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; finger print F2B1 B21F F056 D53E 5D79 A5AF 02BE 70F5 81CF 3416
&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe, e-mail: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=21321616&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;httpcomponents-dev-unsubscribe@...&lt;/a&gt;
&lt;br&gt;For additional commands, e-mail: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=21321616&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;httpcomponents-dev-help@...&lt;/a&gt;
&lt;br&gt;&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe, e-mail: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=21321616&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dev-unsubscribe@...&lt;/a&gt;
&lt;br&gt;For additional commands, e-mail: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=21321616&amp;i=4&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dev-help@...&lt;/a&gt;
&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/HttpComponents-Dev-f20179.html&quot; embed=&quot;fixTarget[20179]&quot; target=&quot;_top&quot; &gt;HttpComponents-Dev&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/FW%3A-HttpClient-authentication-problem.-tp10675834p21321616.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-21310583</id>
	<title>[jira] Resolved: (HTTPCLIENT-812) Would like to record and then retrieve the time, in ms,  when an &quot;http get&quot; request is sent and likewise when the first byte of the response is received.</title>
	<published>2009-01-06T05:42:44Z</published>
	<updated>2009-01-06T05:42:44Z</updated>
	<author>
		<name>JIRA jira@apache.org</name>
	</author>
	<content type="html">&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;[ &lt;a href=&quot;https://issues.apache.org/jira/browse/HTTPCLIENT-812?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://issues.apache.org/jira/browse/HTTPCLIENT-812?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel&lt;/a&gt;&amp;nbsp;]
&lt;br&gt;&lt;br&gt;Oleg Kalnichevski resolved HTTPCLIENT-812.
&lt;br&gt;------------------------------------------
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; Resolution: Won't Fix
&lt;br&gt;&lt;br&gt;Lawrence,
&lt;br&gt;&lt;br&gt;HttpClient 3.x code line is nearing its end of life. There will be no more releases of HttpClient 3.1.x barring critical security related issues. Please consider porting your changes to HttpClient 4.0 API
&lt;br&gt;&lt;br&gt;Oleg
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Would like to record and then retrieve the time, in ms, &amp;nbsp;when an &amp;quot;http get&amp;quot; request is sent and likewise when the first byte of the response is received.
&lt;br&gt;&amp;gt; ---------------------------------------------------------------------------------------------------------------------------------------------------------
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Key: HTTPCLIENT-812
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; URL: &lt;a href=&quot;https://issues.apache.org/jira/browse/HTTPCLIENT-812&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://issues.apache.org/jira/browse/HTTPCLIENT-812&lt;/a&gt;&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Project: HttpComponents HttpClient
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Issue Type: New Feature
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Components: HttpClient
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;Affects Versions: 3.1 Final
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Environment: Windows XP, Java 1.6.0_03, Tomcat 6
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Reporter: Lawrence M. Bates
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Priority: Minor
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Attachments: HttpMethodBase.java, HttpParser.java
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; Original Estimate: 2h
&lt;br&gt;&amp;gt; &amp;nbsp;Remaining Estimate: 2h
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Would like to record and then retrieve the time, in ms, &amp;nbsp;when an &amp;quot;http get&amp;quot; request is sent and likewise when the first byte of the response is received.
&lt;br&gt;&amp;gt; Downloaded the source code for commons-httpclient-3.0.1. &amp;nbsp;I built a custom commons-httpclient-3.0.1.jar where org.apache.commons.httpclient.HttpMethodBase records the time an &amp;quot;http get&amp;quot; request is first sent (execute method) , along with adding getters and setters. &amp;nbsp;Also modified org.apache.commons.httpclient.HttpParser to record, get, and set the time that the first byte of the response is received.
&lt;br&gt;&amp;gt; This non-standard feature allows us in our project to log and audit how long it's taking the targeted server to respond to our requests.
&lt;/div&gt;&lt;br&gt;-- 
&lt;br&gt;This message is automatically generated by JIRA.
&lt;br&gt;-
&lt;br&gt;You can reply to this email to add a comment to the issue online.
&lt;br&gt;&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe, e-mail: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=21310583&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dev-unsubscribe@...&lt;/a&gt;
&lt;br&gt;For additional commands, e-mail: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=21310583&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dev-help@...&lt;/a&gt;
&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/HttpComponents-Dev-f20179.html&quot; embed=&quot;fixTarget[20179]&quot; target=&quot;_top&quot; &gt;HttpComponents-Dev&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/-jira--Created%3A-%28HTTPCLIENT-812%29-Would-like-to-record-and-then-retrieve-the-time%2C-in-ms%2C--when-an-%22http-get%22-request-is-sent-and-likewise-when-the-first-byte-of-the-response-is-received.-tp21295481p21310583.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-21310543</id>
	<title>[jira] Resolved: (HTTPCLIENT-811) Maven POM: JUnit should have only scope &quot;test&quot;</title>
	<published>2009-01-06T05:40:44Z</published>
	<updated>2009-01-06T05:40:44Z</updated>
	<author>
		<name>JIRA jira@apache.org</name>
	</author>
	<content type="html">&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;[ &lt;a href=&quot;https://issues.apache.org/jira/browse/HTTPCLIENT-811?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://issues.apache.org/jira/browse/HTTPCLIENT-811?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel&lt;/a&gt;&amp;nbsp;]
&lt;br&gt;&lt;br&gt;Oleg Kalnichevski resolved HTTPCLIENT-811.
&lt;br&gt;------------------------------------------
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; Resolution: Duplicate
&lt;br&gt;&lt;br&gt;Has been fixed in 3.1
&lt;br&gt;&lt;br&gt;Oleg
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Maven POM: JUnit should have only scope &amp;quot;test&amp;quot;
&lt;br&gt;&amp;gt; ----------------------------------------------
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Key: HTTPCLIENT-811
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; URL: &lt;a href=&quot;https://issues.apache.org/jira/browse/HTTPCLIENT-811&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://issues.apache.org/jira/browse/HTTPCLIENT-811&lt;/a&gt;&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Project: HttpComponents HttpClient
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Issue Type: Bug
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Components: Contrib
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Environment: Maven2
&lt;br&gt;&amp;gt; commons-httpclient 3.0.1
&lt;br&gt;&amp;gt; Default Maven Repository
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Reporter: Fegote
&lt;br&gt;&amp;gt; &amp;nbsp; Original Estimate: 0.17h
&lt;br&gt;&amp;gt; &amp;nbsp;Remaining Estimate: 0.17h
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; The pom file defines JUNIT as provided:
&lt;br&gt;&amp;gt; &amp;lt;dependency&amp;gt;
&lt;br&gt;&amp;gt; 	&amp;lt;groupId&amp;gt;junit&amp;lt;/groupId&amp;gt;
&lt;br&gt;&amp;gt; 	&amp;lt;artifactId&amp;gt;junit&amp;lt;/artifactId&amp;gt;
&lt;br&gt;&amp;gt; 	&amp;lt;version&amp;gt;3.8.1&amp;lt;/version&amp;gt;
&lt;br&gt;&amp;gt; &amp;lt;/dependency&amp;gt;
&lt;br&gt;&amp;gt; But it should be only has test scope:
&lt;br&gt;&amp;gt; &amp;lt;dependency&amp;gt;
&lt;br&gt;&amp;gt; 	&amp;lt;groupId&amp;gt;junit&amp;lt;/groupId&amp;gt;
&lt;br&gt;&amp;gt; 	&amp;lt;artifactId&amp;gt;junit&amp;lt;/artifactId&amp;gt;
&lt;br&gt;&amp;gt; 	&amp;lt;version&amp;gt;3.8.1&amp;lt;/version&amp;gt;
&lt;br&gt;&amp;gt; 	&amp;lt;scope&amp;gt;test&amp;lt;/scope&amp;gt;
&lt;br&gt;&amp;gt; &amp;lt;/dependency&amp;gt;
&lt;/div&gt;&lt;br&gt;-- 
&lt;br&gt;This message is automatically generated by JIRA.
&lt;br&gt;-
&lt;br&gt;You can reply to this email to add a comment to the issue online.
&lt;br&gt;&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe, e-mail: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=21310543&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dev-unsubscribe@...&lt;/a&gt;
&lt;br&gt;For additional commands, e-mail: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=21310543&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dev-help@...&lt;/a&gt;
&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/HttpComponents-Dev-f20179.html&quot; embed=&quot;fixTarget[20179]&quot; target=&quot;_top&quot; &gt;HttpComponents-Dev&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/-jira--Created%3A-%28HTTPCLIENT-811%29-Maven-POM%3A-JUnit-should-have-only-scope-%22test%22-tp21282527p21310543.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-21309276</id>
	<title>Incorrect link for client-4.0-beta2 source zip MD5</title>
	<published>2009-01-06T04:14:01Z</published>
	<updated>2009-01-06T04:14:01Z</updated>
	<author>
		<name>sebb-2-2</name>
	</author>
	<content type="html">The link for the source MD5 file:
&lt;br&gt;&lt;br&gt;httpcomponents-client-4.0-beta2-src.zip.md5
&lt;br&gt;&lt;br&gt;was coded as
&lt;br&gt;&lt;br&gt;httpcomponents-client-4.0-beta2-alpha6-src.zip.md5
&lt;br&gt;&lt;br&gt;i.e. it had a spurious -alpha6 suffix.
&lt;br&gt;&lt;br&gt;As a quick fix, I've editted the file downloads.html on people.
&lt;br&gt;&lt;br&gt;I'm not sure offhand where the source file is located.
&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe, e-mail: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=21309276&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dev-unsubscribe@...&lt;/a&gt;
&lt;br&gt;For additional commands, e-mail: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=21309276&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dev-help@...&lt;/a&gt;
&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/HttpComponents-Dev-f20179.html&quot; embed=&quot;fixTarget[20179]&quot; target=&quot;_top&quot; &gt;HttpComponents-Dev&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Incorrect-link-for-client-4.0-beta2-source-zip-MD5-tp21309276p21309276.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-21295531</id>
	<title>[jira] Updated: (HTTPCLIENT-812) Would like to record and then retrieve the time, in ms,  when an &quot;http get&quot; request is sent and likewise when the first byte of the response is received.</title>
	<published>2009-01-05T09:35:44Z</published>
	<updated>2009-01-05T09:35:44Z</updated>
	<author>
		<name>JIRA jira@apache.org</name>
	</author>
	<content type="html">&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;[ &lt;a href=&quot;https://issues.apache.org/jira/browse/HTTPCLIENT-812?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://issues.apache.org/jira/browse/HTTPCLIENT-812?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel&lt;/a&gt;&amp;nbsp;]
&lt;br&gt;&lt;br&gt;Lawrence M. Bates updated HTTPCLIENT-812:
&lt;br&gt;-----------------------------------------
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; Attachment: HttpParser.java
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; HttpMethodBase.java
&lt;br&gt;&lt;br&gt;3.0.1 HttpMethodBase.java, with time request sent modifications.
&lt;br&gt;3.0.1 HttpParser.java, with time response received modifications.
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Would like to record and then retrieve the time, in ms, &amp;nbsp;when an &amp;quot;http get&amp;quot; request is sent and likewise when the first byte of the response is received.
&lt;br&gt;&amp;gt; ---------------------------------------------------------------------------------------------------------------------------------------------------------
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Key: HTTPCLIENT-812
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; URL: &lt;a href=&quot;https://issues.apache.org/jira/browse/HTTPCLIENT-812&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://issues.apache.org/jira/browse/HTTPCLIENT-812&lt;/a&gt;&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Project: HttpComponents HttpClient
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Issue Type: New Feature
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Components: HttpClient
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;Affects Versions: 3.1 Final
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Environment: Windows XP, Java 1.6.0_03, Tomcat 6
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Reporter: Lawrence M. Bates
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Priority: Minor
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Attachments: HttpMethodBase.java, HttpParser.java
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; Original Estimate: 2h
&lt;br&gt;&amp;gt; &amp;nbsp;Remaining Estimate: 2h
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Would like to record and then retrieve the time, in ms, &amp;nbsp;when an &amp;quot;http get&amp;quot; request is sent and likewise when the first byte of the response is received.
&lt;br&gt;&amp;gt; Downloaded the source code for commons-httpclient-3.0.1. &amp;nbsp;I built a custom commons-httpclient-3.0.1.jar where org.apache.commons.httpclient.HttpMethodBase records the time an &amp;quot;http get&amp;quot; request is first sent (execute method) , along with adding getters and setters. &amp;nbsp;Also modified org.apache.commons.httpclient.HttpParser to record, get, and set the time that the first byte of the response is received.
&lt;br&gt;&amp;gt; This non-standard feature allows us in our project to log and audit how long it's taking the targeted server to respond to our requests.
&lt;/div&gt;&lt;br&gt;-- 
&lt;br&gt;This message is automatically generated by JIRA.
&lt;br&gt;-
&lt;br&gt;You can reply to this email to add a comment to the issue online.
&lt;br&gt;&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe, e-mail: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=21295531&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dev-unsubscribe@...&lt;/a&gt;
&lt;br&gt;For additional commands, e-mail: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=21295531&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dev-help@...&lt;/a&gt;
&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/HttpComponents-Dev-f20179.html&quot; embed=&quot;fixTarget[20179]&quot; target=&quot;_top&quot; &gt;HttpComponents-Dev&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/-jira--Created%3A-%28HTTPCLIENT-812%29-Would-like-to-record-and-then-retrieve-the-time%2C-in-ms%2C--when-an-%22http-get%22-request-is-sent-and-likewise-when-the-first-byte-of-the-response-is-received.-tp21295481p21295531.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-21295481</id>
	<title>[jira] Created: (HTTPCLIENT-812) Would like to record and then retrieve the time, in ms,  when an &quot;http get&quot; request is sent and likewise when the first byte of the response is received.</title>
	<published>2009-01-05T09:31:44Z</published>
	<updated>2009-01-05T09:31:44Z</updated>
	<author>
		<name>JIRA jira@apache.org</name>
	</author>
	<content type="html">Would like to record and then retrieve the time, in ms, &amp;nbsp;when an &amp;quot;http get&amp;quot; request is sent and likewise when the first byte of the response is received.
&lt;br&gt;---------------------------------------------------------------------------------------------------------------------------------------------------------
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Key: HTTPCLIENT-812
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;URL: &lt;a href=&quot;https://issues.apache.org/jira/browse/HTTPCLIENT-812&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://issues.apache.org/jira/browse/HTTPCLIENT-812&lt;/a&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Project: HttpComponents HttpClient
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Issue Type: New Feature
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Components: HttpClient
&lt;br&gt;&amp;nbsp; &amp;nbsp; Affects Versions: 3.1 Final
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Environment: Windows XP, Java 1.6.0_03, Tomcat 6
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Reporter: Lawrence M. Bates
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Priority: Minor
&lt;br&gt;&lt;br&gt;&lt;br&gt;Would like to record and then retrieve the time, in ms, &amp;nbsp;when an &amp;quot;http get&amp;quot; request is sent and likewise when the first byte of the response is received.
&lt;br&gt;&lt;br&gt;Downloaded the source code for commons-httpclient-3.0.1. &amp;nbsp;I built a custom commons-httpclient-3.0.1.jar where org.apache.commons.httpclient.HttpMethodBase records the time an &amp;quot;http get&amp;quot; request is first sent (execute method) , along with adding getters and setters. &amp;nbsp;Also modified org.apache.commons.httpclient.HttpParser to record, get, and set the time that the first byte of the response is received.
&lt;br&gt;&lt;br&gt;This non-standard feature allows us in our project to log and audit how long it's taking the targeted server to respond to our requests.
&lt;br&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;This message is automatically generated by JIRA.
&lt;br&gt;-
&lt;br&gt;You can reply to this email to add a comment to the issue online.
&lt;br&gt;&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe, e-mail: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=21295481&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dev-unsubscribe@...&lt;/a&gt;
&lt;br&gt;For additional commands, e-mail: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=21295481&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dev-help@...&lt;/a&gt;
&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/HttpComponents-Dev-f20179.html&quot; embed=&quot;fixTarget[20179]&quot; target=&quot;_top&quot; &gt;HttpComponents-Dev&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/-jira--Created%3A-%28HTTPCLIENT-812%29-Would-like-to-record-and-then-retrieve-the-time%2C-in-ms%2C--when-an-%22http-get%22-request-is-sent-and-likewise-when-the-first-byte-of-the-response-is-received.-tp21295481p21295481.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-21290109</id>
	<title>Re: Tests of NTLM proxy</title>
	<published>2009-01-05T04:21:44Z</published>
	<updated>2009-01-05T04:21:44Z</updated>
	<author>
		<name>olegk</name>
	</author>
	<content type="html">On Mon, 2009-01-05 at 11:38 +0100, Fabien Bousquet wrote:
&lt;br&gt;&amp;gt; Hi,
&lt;br&gt;&amp;gt; I develop an application which use httpclient (3.1). This application
&lt;br&gt;&amp;gt; connects to a server. It can use a NTLM proxy for connection to server.
&lt;br&gt;&amp;gt; So my question, is how can i test this feature ? I don't find how install a
&lt;br&gt;&amp;gt; simple NTLM proxy. Does exist mock NTLM proxy for the tests ?
&lt;br&gt;&amp;gt; 
&lt;br&gt;&lt;br&gt;NTLM is a pretty complex authentication scheme, which cannot be mocked
&lt;br&gt;easily in a meaningful way. There is virtually no test coverage for NTLM
&lt;br&gt;scheme in the HttpClient test suite.
&lt;br&gt;&lt;br&gt;Have a look at JCIFS library developed by the Samba project. Maybe they
&lt;br&gt;have something.
&lt;br&gt;&lt;br&gt;Oleg
&lt;br&gt;&lt;br&gt;&lt;br&gt;&amp;gt; Thanks,
&lt;br&gt;&amp;gt; Fabien.
&lt;br&gt;&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe, e-mail: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=21290109&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;httpclient-users-unsubscribe@...&lt;/a&gt;
&lt;br&gt;For additional commands, e-mail: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=21290109&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;httpclient-users-help@...&lt;/a&gt;
&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://www.nabble.com/HttpClient-User-f20180.html&quot; embed=&quot;fixTarget[20180]&quot; target=&quot;_top&quot; &gt;HttpClient-User&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Tests-of-NTLM-proxy-tp21288791p21290109.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-21288791</id>
	<title>Tests of NTLM proxy</title>
	<published>2009-01-05T02:38:39Z</published>
	<updated>2009-01-05T02:38:39Z</updated>
	<author>
		<name>Fabien Bousquet</name>
	</author>
	<content type="html">Hi,
&lt;br&gt;I develop an application which use httpclient (3.1). This a