java.lang.IllegalStateException: unsupported protocol: "<host name>" when using
ConnectMethod
---------------------------------------------------------------------------------------------
Key: COMMONSSITE-47
URL: https://issues.apache.org/jira/browse/COMMONSSITE-47
Project: Commons All
Issue Type: Bug
Components: Site
Environment: commons-httpclient-3.1.jar
Reporter: Barry Silis
The method org.apache.commons.httpclient.ConnectMethod.getURI() omits the
protocol from the returned URI, causing an exception
*java.lang.IllegalStateException* when trying to use the class ConnectMethod.
I believe it can be solved by not overriding
org.apache.commons.httpclient.HttpMethodBase.getURI() in the ConnectMethod
class.
The exception:
Exception in thread "main" java.lang.IllegalStateException: unsupported
protocol: 'www.google.com'
at
org.apache.commons.httpclient.protocol.Protocol.lazyRegisterProtocol(Protocol.java:149)
at
org.apache.commons.httpclient.protocol.Protocol.getProtocol(Protocol.java:117)
at
org.apache.commons.httpclient.HostConfiguration.setHost(HostConfiguration.java:253)
at
org.apache.commons.httpclient.HostConfiguration.setHost(HostConfiguration.java:315)
at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:388)
at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323)
at epicon.sbr.client.TestHttpGet.connectToProxy(TestHttpGet.java:293)
at epicon.sbr.client.TestHttpGet.main(TestHttpGet.java:41)
Cheers,
Barry.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.