Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Cannot access URL (unknown host exception)

19 views
Skip to first unread message

Nilson

unread,
Jul 23, 2003, 5:24:09 AM7/23/03
to
Hello everybody,
I wrote a programm to access a WebService and while trying to proceed
this line:

"connection.call(message, endpoint);"

i get this exception:

java.net.UnknownHostException: services.xmethods.net
at java.net.InetAddress.getAllByName0(InetAddress.java:571)
at java.net.InetAddress.getAllByName0(InetAddress.java:540)
at java.net.InetAddress.getByName(InetAddress.java:449)
at java.net.Socket.<init>(Socket.java:100)
at sun.net.NetworkClient.doConnect(NetworkClient.java:50)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:335)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:521)
at sun.net.www.http.HttpClient.<init>(HttpClient.java:271)
at sun.net.www.http.HttpClient.<init>(HttpClient.java:281)
at sun.net.www.http.HttpClient.New(HttpClient.java:293)
at sunn.net.www.protocol.http.HttpURLConnection.connectHttpURLConnection.java:404)
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:451)
at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection.postHttpSOAPConnection.java:246)
at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection$PriviledgedPost.run(HttpSOAPConnection.java:141)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection.call(HttpSOAPConnection.java:114)
at webservicesclient.SimpleJAXMClient.sendJAXMMessage(SimpleJAXMClient.java:84)
at webservicesclient.SimpleJAXMClient.main(SimpleJAXMClient.java:106)
java.security.PrivilegedActionException: javax.xml.soap.SOAPException:
Message send failed
at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection.post(HttpSOAPConnection.java:288)
at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection$PriviledgedPost.run(HttpSOAPConnection.java:141)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection.call(HttpSOAPConnection.java:114)
at webservicesclient.SimpleJAXMClient.sendJAXMMessage(SimpleJAXMClient.java:84)
at webservicesclient.SimpleJAXMClient.main(SimpleJAXMClient.java:106)
javax.xml.soap.SOAPException: java.security.PrivilegedActionException
<<javax.xml.soap.SOAPException: Message send failed>>
at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection.call(HttpSOAPConnection.java:120)
at webservicesclient.SimpleJAXMClient.sendJAXMMessage(SimpleJAXMClient.java:84)
at webservicesclient.SimpleJAXMClient.main(SimpleJAXMClient.java:106)

I'm working with a proxy server. Can somebody tell me how to fix this
problem?
Thanks, Nilson

Sudsy

unread,
Jul 23, 2003, 10:56:30 AM7/23/03
to
Nilson wrote:
> Hello everybody,
> I wrote a programm to access a WebService and while trying to proceed
> this line:
>
> "connection.call(message, endpoint);"
>
> i get this exception:
>
> java.net.UnknownHostException: services.xmethods.net
> at java.net.InetAddress.getAllByName0(InetAddress.java:571)
> at java.net.InetAddress.getAllByName0(InetAddress.java:540)
> at java.net.InetAddress.getByName(InetAddress.java:449)
> at java.net.Socket.<init>(Socket.java:100)
> at sun.net.NetworkClient.doConnect(NetworkClient.java:50)

The stack trace tells us that it's failing to resolve the hostname,
namely the mail.smtp.host in the properties you handed to
Session.getInstance(). It could be a matter of your /etc/resolv.conf
not being configured or a number of other things.
Try this from the command line:
ping <hostname>
You'll probably get something like "unknown host". One you have
DNS lookups properly configured then your problem should disappear.

Nilson

unread,
Jul 24, 2003, 5:04:36 AM7/24/03
to
Thank you for your answer. I solved the problem this way:

Properties p = System.getProperties();
p.put("http.proxyHost","http-proxy.xx.xxxxx.xx");
p.put("http.proxyPort","8080");
System.setProperties(p);

With this changes you can set your proxy.

Nilson

catalysoft.com

unread,
Jul 23, 2003, 5:45:31 PM7/23/03
to

Alternatively, try using the IP address of the host instead of its name.

..and then get someone else to sort out the DNS resolution problem ... ;-)

Simon
--
www.catalysoft.com - increasing the rate of your software development

"Sudsy" <bitbu...@hotmail.com> wrote in message
news:3F1EA21E...@hotmail.com...

0 new messages