Unknown Host exception

441 views
Skip to first unread message

sujal.w...@gmail.com

unread,
Mar 6, 2009, 12:21:51 AM3/6/09
to typica
Hi
I am using typica 1.2 .I am able to retrieve information about my
account through java code from wifi connection.But i am trying the
same thing through LAN but i am getting Unknown Exception


The Exception is
Exception in thread "main" com.xerox.amazonws.ec2.EC2Exception:
ec2.amazonaws.com
at com.xerox.amazonws.ec2.Jec2.describeAddresses(Jec2.java:
1419)
at Ec2.main(Ec2.java:57)
Caused by: java.net.UnknownHostException: ec2.amazonaws.com
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:519)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect
(SSLSocketImpl.java:550)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.<init>
(SSLSocketImpl.java:394)
at
com.sun.net.ssl.internal.ssl.SSLSocketFactoryImpl.createSocket
(SSLSocketFactoryImpl.java:123)
at
org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.createSocket
(SSLProtocolSocketFactory.java:81)
at
org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.createSocket
(SSLProtocolSocketFactory.java:126)
at org.apache.commons.httpclient.HttpConnection.open
(HttpConnection.java:706)
at
org.apache.commons.httpclient.MultiThreadedHttpConnectionManager
$HttpConnectionAdapter.open(MultiThreadedHttpConnectionManager.java:
1321)
at
org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry
(HttpMethodDirector.java:386)
at
org.apache.commons.httpclient.HttpMethodDirector.executeMethod
(HttpMethodDirector.java:170)
at org.apache.commons.httpclient.HttpClient.executeMethod
(HttpClient.java:396)
at org.apache.commons.httpclient.HttpClient.executeMethod
(HttpClient.java:324)
at com.xerox.amazonws.common.AWSQueryConnection.makeRequest
(AWSQueryConnection.java:314)
at com.xerox.amazonws.ec2.Jec2.describeAddresses(Jec2.java:
1404)
... 1 more


I am able to open https://ec2.amazonaws.com from browser and is
redirected to http://aws.amazon.com/ec2/ .


How can i fetch information about account through LAN also ???
May i set AWSQUERYConnection to make it work through LAN or something
else in java code ??
thanks

David Kavanagh

unread,
Mar 6, 2009, 7:09:45 AM3/6/09
to typ...@googlegroups.com
Usually what that means is that your WIFI is outside your firewall,
and the LAN is inside, and might disallow the traffic. Or, you have a
web proxy, so you could call Jec2.setProxyValues(..)

David

Sujal Wattamwar

unread,
Mar 10, 2009, 5:41:21 AM3/10/09
to typ...@googlegroups.com
Hi
i try to make changes in jec2.setproxyValues("proxy.xxx.com",8080,"username","password");
but it gave me following error
 
 
 
 
 
 
Mar 10, 2009 1:58:14 PM com.xerox.amazonws.common.AWSQueryConnection makeRequest
INFO: Proxy
Host set to proxy.xxx.com:proxy.xxx.com
Mar 10, 2009 1:58:39 PM
org.apache.commons.httpclient.auth.AuthChallengeProcessor selectAuthScheme
INFO: ntlm
authentication scheme selected
Mar 10, 2009 1:58:39 PM
org.apache.commons.httpclient.HttpMethodDirector executeConnect
SEVERE: Credentials cannot be
used for NTLM authentication: org.apache.commons.httpclient.UsernamePasswordCredentials
org.apache.commons.httpclient.auth.InvalidCredentialsException: Credentials cannot be used for
NTLM authentication: org.apache.commons.httpclient.UsernamePasswordCredentials
        at
org.apache.commons.httpclient.auth.NTLMScheme.authenticate(NTLMScheme.java:331)
        at
org.apache.commons.httpclient.HttpMethodDirector.authenticateProxy(HttpMethodDirector.java:319)
 
       at org.apache.commons.httpclient.HttpMethodDirector.executeConnect
(HttpMethodDirector.java:490)
        at
org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:390)
 
      at org.apache.commons.httpclient.HttpMethodDirector.executeMethod
(HttpMethodDirector.java:170)
        at org.apache.commons.httpclient.HttpClient.executeMethod
(HttpClient.java:396)
        at org.apache.commons.httpclient.HttpClient.executeMethod
(HttpClient.java:324)
        at com.xerox.amazonws.common.AWSQueryConnection.makeRequest
(AWSQueryConnection.java:314)
        at com.xerox.amazonws.ec2.Jec2.describeAddresses
(Jec2.java:1404)
        at Ec2.main(Ec2.java:64)
Mar 10, 2009 1:58:39 PM
org.apache.commons.httpclient.HttpMethodDirector processProxyAuthChallenge
INFO: Failure
authenticating with NTLM <any realm>@proxy.xxx.com:8080
Exception in thread "main"
com.xerox.amazonws.ec2.EC2Exception: Problem parsing returned message.
        at
com.xerox.amazonws.ec2.Jec2.describeAddresses(Jec2.java:1415)
        at Ec2.main(Ec2.java:64)
Caused by: javax.xml.bind.UnmarshalException: unexpected element (uri:"", local:"HTML").
-02-01/}DeregisterImageResponse>,<{http://ec2.amazonaws.com/doc/2008-02-01/}
com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext.handleEvent
(UnmarshallingContext.java:548)
        at
com.sun.xml.internal.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:224)
        at
com.sun.xml.internal.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:219)
        at
com.sun.xml.internal.bind.v2.runtime.unmarshaller.Loader.reportUnexpectedChildElement
(Loader.java:96)
        at
com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext$DefaultRootLoader.childE
lement(UnmarshallingContext.java:945)
        at
com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext._startElement
(UnmarshallingContext.java:391)
        at
com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext.startElement
(UnmarshallingContext.java:372)
        at
com.sun.xml.internal.bind.v2.runtime.unmarshaller.SAXConnector.startElement
(SAXConnector.java:126)
        at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement
(AbstractSAXParser.java:505)
        at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement
(XMLNSDocumentScannerImpl.java:377)
        at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDriver.scanRootElemen
tHook(XMLNSDocumentScannerImpl.java:603)
        at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.ne
xt(XMLDocumentFragmentScannerImpl.java:3065)
        at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next
(XMLDocumentScannerImpl.java:891)
        at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next
(XMLDocumentScannerImpl.java:624)
        at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next
(XMLNSDocumentScannerImpl.java:117)
        at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument
(XMLDocumentFragmentScannerImpl.java:485)
        at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse
(XML11Configuration.java:811)
        at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse
(XML11Configuration.java:741)
        at
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:111)
        at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1209)
 
       at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse
(SAXParserImpl.java:526)
        at
com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0
(UnmarshallerImpl.java:200)
        at
com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal
(UnmarshallerImpl.java:173)
        at
javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:157)
   
    at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal
(AbstractUnmarshallerImpl.java:204)
        at
com.xerox.amazonws.common.JAXBuddy.deserializeXMLStream(JAXBuddy.java:80)
        at
com.xerox.amazonws.common.AWSQueryConnection.getErrorDetails(AWSQueryConnection.java:372)
      
 at com.xerox.amazonws.common.AWSQueryConnection.makeRequest(AWSQueryConnection.java:336)
      
 at com.xerox.amazonws.ec2.Jec2.describeAddresses(Jec2.java:1404)
        ... 1 more
 
 
What could be the possible reason

David Kavanagh

unread,
Mar 10, 2009, 8:11:34 AM3/10/09
to typ...@googlegroups.com
I don't have access to an authenticating proxy to test against.
Another said the NLTM code worked fine. I'm not sure what the problem
is in your case. Perhaps find more information about the proxy in
place on your network and to some searches to see if apache
commons-httpclient works with it. If there is more code I can put in
to support your type of proxy, I'll do it.

David

Steve Loughran

unread,
Mar 17, 2009, 11:13:09 AM3/17/09
to typ...@googlegroups.com
On Tue, Mar 10, 2009 at 9:41 AM, Sujal Wattamwar
<sujal.w...@gmail.com> wrote:
> Hi
> i try to make changes in
> jec2.setproxyValues("proxy.xxx.com",8080,"username","password");
> but it gave me following error
>

Seen that stack trace in SOAP stacks that don't check the content-type
header before handing the response to the XML parser, with the result
that the XML parser bails out with some obscurre message, hiding the
HTML page that is trying to provide a user friendly response.

regardless of the root cause of this, it would be good to include the
original text in any exception, so that the user can see it. I'd also
have expected the error code to have been checked first -perhaps this
proxy server is responding with success+HTML ?

videoguy2

unread,
Apr 7, 2009, 3:14:06 PM4/7/09
to typica
We are using typica version 1.1. Ever since upgrading Ubuntu from 7.10
to 8.04, we are having intermittent issues with
MessageQueue.sendMessage, and a consistent error with
QueueService.listMessageQueues. Each exception complains about
UnknownHostException: queue.amazonaws.com. This hostname can be
resolved from the command line - the following wget and nslookup show
that each command can resolve queue.amazonaws.com :


# nslookup queue.amazonaws.com
Server: 10.199.202.51
Address: 10.199.202.51#53

Non-authoritative answer:
Name: queue.amazonaws.com
Address: 207.171.166.190



# wget -O - http://queue.amazonaws.com
--11:38:36-- http://queue.amazonaws.com/
=> `-'
Resolving queue.amazonaws.com... 207.171.166.190
Connecting to queue.amazonaws.com|207.171.166.190|:80... connected.
HTTP request sent, awaiting response... 403 Forbidden
11:38:37 ERROR 403: Forbidden.



Here is the stack trace from a typical occurrence of the sendMessage
error:

jvm 1 | 13:08:36,260 ERROR SqsMessage:? - sendMessage EXCEPTION:
queue.amazonaws.com
jvm 1 | com.xerox.amazonws.sqs.SQSException: queue.amazonaws.com
jvm 1 | at com.xerox.amazonws.sqs.MessageQueue.sendMessage
(MessageQueue.java:137)
[...]
jvm 1 | Caused by: java.net.UnknownHostException: queue.amazonaws.com
jvm 1 | at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177)
jvm 1 | at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
jvm 1 | at java.net.Socket.connect(Socket.java:519)
jvm 1 | at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect
(SSLSocketImpl.java:550)
jvm 1 | at com.sun.net.ssl.internal.ssl.SSLSocketImpl.<init>
(SSLSocketImpl.java:394)
jvm 1 | at
com.sun.net.ssl.internal.ssl.SSLSocketFactoryImpl.createSocket
(SSLSocketFactoryImpl.java:123)
jvm 1 | at
org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.createSocket
(SSLProtocolSocketFactory.java:82)
jvm 1 | at
org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.createSocket
(SSLProtocolSocketFactory.java:127)
jvm 1 | at org.apache.commons.httpclient.HttpConnection.open
(HttpConnection.java:707)
jvm 1 | at
org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry
(HttpMethodDirector.java:387)
jvm 1 | at
org.apache.commons.httpclient.HttpMethodDirector.executeMethod
(HttpMethodDirector.java:171)
jvm 1 | at org.apache.commons.httpclient.HttpClient.executeMethod
(HttpClient.java:397)
jvm 1 | at org.apache.commons.httpclient.HttpClient.executeMethod
(HttpClient.java:323)
jvm 1 | at com.xerox.amazonws.common.AWSQueryConnection.makeRequest
(AWSQueryConnection.java:154)
jvm 1 | at com.xerox.amazonws.sqs.MessageQueue.sendMessage
(MessageQueue.java:129)




Here is the stack trace from a typical occurrence of the
QueueService.listMessageQueues error:


jvm 1 | 12:46:33,356 DEBUG SQSUtils:84 - Service: https://queue.amazonaws.com:443/
jvm 1 | 12:46:33,363 DEBUG SQSUtils:84 - Service: https://queue.amazonaws.com:443/
[...]
jvm 1 | 12:46:33,709 ERROR RequestHandlerDaemon:118 - Exception Info:
java.lang.Exception: com.xerox.amazonws.sqs.SQSException:
queue.amazonaws.com
jvm 1 | java.lang.Exception: com.xerox.amazonws.sqs.SQSException:
queue.amazonaws.com
[...]

jvm 1 | Caused by: java.net.UnknownHostException: queue.amazonaws.com
jvm 1 | at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177)
jvm 1 | at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
jvm 1 | at java.net.Socket.connect(Socket.java:519)
jvm 1 | at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect
(SSLSocketImpl.java:550)
jvm 1 | at com.sun.net.ssl.internal.ssl.SSLSocketImpl.<init>
(SSLSocketImpl.java:394)
jvm 1 | at
com.sun.net.ssl.internal.ssl.SSLSocketFactoryImpl.createSocket
(SSLSocketFactoryImpl.java:123)
jvm 1 | at
org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.createSocket
(SSLProtocolSocketFactory.java:82)
jvm 1 | at
org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.createSocket
(SSLProtocolSocketFactory.java:127)
jvm 1 | at org.apache.commons.httpclient.HttpConnection.open
(HttpConnection.java:707)
jvm 1 | at
org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry
(HttpMethodDirector.java:387)
jvm 1 | at
org.apache.commons.httpclient.HttpMethodDirector.executeMethod
(HttpMethodDirector.java:171)
jvm 1 | at org.apache.commons.httpclient.HttpClient.executeMethod
(HttpClient.java:397)
jvm 1 | at org.apache.commons.httpclient.HttpClient.executeMethod
(HttpClient.java:323)
jvm 1 | at com.xerox.amazonws.common.AWSQueryConnection.makeRequest
(AWSQueryConnection.java:154)
jvm 1 | at com.xerox.amazonws.sqs.QueueService.listMessageQueues
(QueueService.java:174)



videoguy2

unread,
Apr 9, 2009, 8:29:54 PM4/9/09
to typica
This is a known issue with 32-bit Java on 64-bit Ubuntu 8, and a
couple solutions are given here:
https://bugs.launchpad.net/ubuntu/+bug/227111
Reply all
Reply to author
Forward
0 new messages