1
我得到這個錯誤:的URLStreamHandler是受限制類
java.lang.NoClassDefFoundError: java.net.URLStreamHandler is a restricted class. Please see the Google App Engine developer's guide for more details.
at com.google.appengine.tools.development.agent.runtime.Runtime.reject(Runtime.java:51)
at com.gargoylesoftware.htmlunit.protocol.javascript.Handler.<init>(Handler.java:50)
at com.gargoylesoftware.htmlunit.WebClient.<clinit>(WebClient.java:144)
當運行我的GAE應用程序,錯誤的是這個代碼塊中:
// Setup the headless browser
webClient = new WebClient();
webClient.setWebConnection(new UrlFetchWebConnection(webClient));
我的應用程序被配置爲:
<dependency>
<groupId>net.sourceforge.htmlunit</groupId>
<artifactId>htmlunit</artifactId>
<version>2.13-SNAPSHOT</version>
</dependency>
我相信HTMLUnit
有一個補丁,允許它在GAE環境中工作,有什麼事情我會丟失?
唯一的例外是相當清楚的給我。您不能使用java.net.URLStreamHandler中和是的HtmlUnit使用它。您應該將測試與GAE環境隔離開來。 – DiogoSantana 2013-03-28 04:15:12
由於的URLStreamHandler是在白名單中,我認爲https://developers.google.com/appengine/docs/java/jrewhitelist – 2013-03-28 07:52:54
@DiogoSantana我能夠使之與2.13快照 – xybrek 2013-03-28 08:14:41