[OpenLayers-Users] error using urllib2.urlopen of the proxy.

lorkyo lorkyo at 163.com
Fri Aug 15 23:56:53 EDT 2008


Hello 
I came across error when using Tomcat 5.5 under Windows OS to set the proxy work properly. When I try to acess the http://localhost:8080/geoserver/cgi-bin/proxy.cgi,I always get a error:
Some unexpected error occurred. Error text was: <urlopen error (11001, 'getaddrinfo failed')>

I can get a  http://localhost:8080/geoserver/cgi-bin/test1.cgi work properly to print "hello world"
 
The problem is the urllib2.urlopen(). I write a test2.cgi:
************
#!C:\Python25\python -u
import urllib2
import cgi
import sys, os
import urllib
# Designed to prevent Open Proxy type stuff.

try:
 the_url = "http://www.google.com"
 req = urllib2.urlopen(the_url)
 print req.read()
except Exception, E:
    print "Status: 500 Unexpected Error"
    print "Content-Type: text/plain"
    print 
    print "Some unexpected error occurred. Error text was:", E
 the_url = "http://www.google.com"
 req = urllib2.urlopen(the_url)
************/
I can get it work properly using console command pythoy test2.cgi, but after I put it under tomcat, I get the same error:
 
 Some unexpected error occurred. Error text was: <urlopen error (11001, 'getaddrinfo failed')>

I don't know why, might it be rooted in the configuration of Tomacat?
 
Thank you, best regards! 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20080816/dda406c9/attachment.html


More information about the Users mailing list