我收到了这个错误:
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环境中工作,我可能会缺少什么?
答案 0 :(得分:2)
由于我使用的是早期版本的HtmlUnit,我似乎忘了做'mvn clean',这个工件还在那里。
现在有效!