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

java.net.UnknownHostException: api.google.com

1,843 views
Skip to first unread message

inma

unread,
Oct 1, 2003, 7:51:31 AM10/1/03
to
Hello,

Could you help me?

I am getting this error:

C:\jakarta-tomcat-4.1.27-src\webapps\axis\WEB-INF\classes>java org.apache.axis.w
sdl.WSDL2Java http://api.google.com/GoogleSearch.wsdl
java.net.UnknownHostException: api.google.com
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:153)
at java.net.Socket.connect(Socket.java:434)
at java.net.Socket.connect(Socket.java:384)
at sun.net.NetworkClient.doConnect(NetworkClient.java:139)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:386)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:602)
at sun.net.www.http.HttpClient.<init>(HttpClient.java:303)
at sun.net.www.http.HttpClient.<init>(HttpClient.java:264)
at sun.net.www.http.HttpClient.New(HttpClient.java:336)
at sun.net.www.http.HttpClient.New(HttpClient.java:317)
at sun.net.www.http.HttpClient.New(HttpClient.java:312)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConne
ction.java:481)
at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection
.java:472)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon
nection.java:574)
at java.net.URL.openStream(URL.java:960)
at org.apache.crimson.parser.InputEntity.init(InputEntity.java:209)
at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:505)
at org.apache.crimson.parser.Parser2.parse(Parser2.java:318)
at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:442)

at org.apache.crimson.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl
.java:185)
at org.apache.axis.utils.XMLUtils.newDocument(XMLUtils.java:322)
at org.apache.axis.utils.XMLUtils.newDocument(XMLUtils.java:367)
at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.jav
a:384)
at org.apache.axis.wsdl.gen.Parser$WSDLRunnable.run(Parser.java:245)
at java.lang.Thread.run(Thread.java:536)

C:\jakarta-tomcat-4.1.27-src\webapps\axis\WEB-INF\classes>

thanks very much,

Inma

Paul

unread,
Oct 3, 2003, 9:23:34 PM10/3/03
to
inmacula...@es.prosegur.com (inma) wrote in message news:<dfe9c697.03100...@posting.google.com>...

Hi Inma,

>C:\jakarta-tomcat-4.1.27-src\webapps\axis\WEB-INF\classes>java
org.apache.axis.w
> sdl.WSDL2Java http://api.google.com/GoogleSearch.wsdl

The first line above is telling you the above named package is not a
recognised host or module to Tomcat. NOTE: even if an app shows as
installed under the Tomcat Application Manager Tool , the main Tomcat
server can still fail to recognise it as a host or module if it is not
installed/ interfaced properly.

> java.net.UnknownHostException: api.google.com

The exception line above is the actual error that occurs after being
caused by the problem i have mentioned above. Every line to follow
except the last line below , is the actual errors that the main
exception above causes.

> C:\jakarta-tomcat-4.1.27-src\webapps\axis\WEB-INF\classes>

The last line above points to the culprit, the package and class files
responsible for the exception/ error. the cause of the problem... in
other words fix or remove the package, otherwise there will be no
progress.


Tomcat application server is designed to throw an
"UnknownHostException" if an unregistered host, app or module tries to
connect to the server, without a registered connection interface in
order to prevent external hosts from taking control of URL requests
passed to or from Tomcat.

Please, please, please NOTE: theres a difference between an installed
App and a registered app, a registered app is given full access
priveledges to Tomcat server i.e. URL requests from any context, were
as an installed up is limited to a fixed URL location i.e.
www.your-webpage.com/foo.txt (foo.txt can only be accessible from the
/foo or foo.txt context) thus if you installed your app to a similar
context with such constraints thats why Tomcat throws an exception
when you point the server to an external resource/ host.

Have you created a connection module/ interface for the Google API and
your app ,and registered it with your Tomcat server?

Read the Tomcat API documentation on how to pass connection requests
and URL's to an external host or how to accept connections or URL
requests from an external host /resource.

If you implement a connection interface in the right manner, i.e.
register the external host / resouce within the Tomcat "server.xml"
configuration file as set by the Tomcat app server API spec you will
not have any problems.

I will point it out again... READ THE TOMCAT API DOCs thats were the
solution is. Pay particular attention to writting and using your own
modules, note some in depth knowledge in XML will help a lot, as you
will have to add and modify a lot of xml statements in your Tomcat
server.xml config file.

Or you could simply browse the web for a module/ app implementing the
Google API for Tomcat, visit the tomcat homepage and newsgroup.

Hope this helps,
Paul
(Many nights spent drugged on coffee, and ripping my hair out)

jana

unread,
Oct 8, 2003, 8:49:02 AM10/8/03
to
I only read the error message, because I didn`t understand all...
But as I took an example script and execute it on my shell the same
error message came. And one colleague said, that I have to know, that
we`re having a proxy in between me and the google API. The script does
not know my proxy and the firewall said no, I don`t know any host.
... so I could solve it in perl with ...$ENV{HTTP_proxy} = "http://
..."; which set an environment variable, so that the script knows
where the http-message may go - which port (it stands there somewhere
in the internet as I searched for a manual for google webservice with
perl)

=> So you may use the corresponding way to your different problem.

0 new messages