2013-02-15 41 views
1

我在Google App Engine上使用Jython,但無法使用'import urlfetch'工作。其他導入如'import sys'和'import zlib'可以工作,但不能'import urlfetch'。我得到一個500服務器錯誤。我究竟做錯了什麼?導入urlfetch無法在Jython Google App Engine上工作

在我的儀表板日誌中的錯誤信息是:

1)javax.servlet.ServletContext log: debug: Callable object not in cache

2)錯誤用於java.lang.ExceptionInInitializerError:java.security.AccessControlException:access嵌套否認/java.lang.ExceptionInInitializerError

3)(java.lang.RuntimePermission modifyThreadGroup)

4)來自servlet的未捕獲異常

java.lang.ExceptionInInitializerError 

我也試着將threadsafe切換爲false和true,但都沒有任何效果(我發現jython和threadsafe = TRUE可能存在問題)。

感謝您給我的任何幫助!

+0

我認爲這是因爲已經有一個名爲網址抓取嘗試進口的URLFetch – Tkingovr 2013-02-15 07:22:41

+0

感謝模塊,但爲什麼在運行時的Jython GAE支持純Python和純Java沒有工作 – user1937362 2013-02-16 00:39:24

+0

我的問題是...。 。? – Lipis 2013-02-16 10:31:36

回答

1

你試過:

from google.appengine.api import urlfetch 

從該:

您可以使用Python標準庫中的urllib,urllib2的或httplib的進行HTTP請求。在App Engine中運行時,這些庫使用App Engine的URL提取服務執行HTTP請求,該服務在Google的可擴展HTTP請求基礎架構上運行。

我讀到它不是在GAE中使用的「正常」urlfetch。

https://developers.google.com/appengine/docs/python/urlfetch/overview

+0

謝謝,是的,我一直在使用'from google.appengine.api import urlfetch',但它不起作用。當我嘗試導入urlfetch,urllib或urllib2時,出現錯誤。這可能是谷歌的一面嗎?他們不允許jython使用試圖發出HTTP請求的函數嗎? – user1937362 2013-02-16 00:41:28

相關問題