commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Divakar Satyanarayan <Divak...@mascotsystems.com>
Subject [HTTPClient]java.net.UnknownHostException
Date Fri, 31 Jan 2003 13:22:15 GMT
Hi,

 I am using HTTPConnection to get a connection to an URL. It works fine when
I give just the IP address but when I specify the full path it gives me
following exception

java.net.UnknownHostException: 201.173.335.213/xxxx/xxxxx
        at java.net.InetAddress.getAllByName0(InetAddress.java:571)
        at java.net.InetAddress.getAllByName0(InetAddress.java:540)
        at java.net.InetAddress.getByName(InetAddress.java:472)
        at java.net.Socket.<init>(Socket.java:100)
        at
org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSo
cket(DefaultProtocolSocketFactory.java:104)
        at
org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:488)
        at TrialConnectionClient.main(TrialConnectionClient.java:237).

 What am I missing ? I've pasted the code

			HttpConnection oHttpConnection = new
HttpConnection(strURL,440); 

			logMessage("Connected before"+
oHttpConnection.isOpen() );
			
			logMessage("Connected before"+
oHttpConnection.getProxyHost());

			logMessage("Connected before"+
oHttpConnection.getPort());	 
			 
			oHttpConnection.open();

			logMessage("Connected after"+
oHttpConnection.isOpen() );
			
			RequestOutputStream oRequestOutputStream = new
RequestOutputStream(oHttpConnection.getRequestOutputStream(),false);
			
			logMessage("Output Stream ");

			strXml = "inputXml="+sbInputXML.toString(); 

			oRequestOutputStream.println(strXml); 
			//oRequestOutputStream.close();
			
			logMessage(" Input Stream ");
			
			
			
			BufferedReader oBufferedReader = new
BufferedReader(new
InputStreamReader(oHttpConnection.getResponseInputStream()));
			
			logMessage("Opening the input Stream");
			
			String line;
			
			System.out.println(System.currentTimeMillis());

			logMessage("Buffered Input starting to read");

			while ((line = oBufferedReader.readLine()) != null)
			{
				System.out.println(line);
				sbXMLText.append(line + "\n");
			}
		


> Regards,
> Divakar
> ___________________________
> DIVAKAR SATYANARAYAN
> +91-80-5521701-6 Ext : 1018
> 
> 
> 
> 
> Regards,
> Divakar
> ___________________________
> DIVAKAR SATYANARAYAN
> +91-80-5521701-6 Ext : 1018
> 
> 
> 
> 
DISCLAIMER: Information contained and transmitted by this E-MAIL is
proprietary to Mascot Systems Limited and is intended for use only by the
individual or entity to which it is addressed, and may contain information
that is privileged, confidential or exempt from disclosure under applicable
law. If this is a forwarded message, the content of this E-MAIL may not have
been sent with the authority of the Company. If you are not the intended
recipient, an agent of the intended recipient or a person responsible for
delivering the information to the named recipient, you are notified that any
use, distribution, transmission, printing, copying or dissemination of this
information in any way or in any manner is strictly prohibited. If you have
received this communication in error, please delete this mail & notify us
immediately at Mailadmin@mascotsystems.com Before opening attachments,
please scan for viruses. 



Mime
View raw message