Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/google-app-engine/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/list/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java URLStreamHandler是一个受限类_Java_Google App Engine_Http_Servlets - Fatal编程技术网

Java URLStreamHandler是一个受限类

Java URLStreamHandler是一个受限类,java,google-app-engine,http,servlets,Java,Google App Engine,Http,Servlets,我得到了这个错误: 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:5

我得到了这个错误:

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)
我的应用程序配置为:

<dependency>
    <groupId>net.sourceforge.htmlunit</groupId>
    <artifactId>htmlunit</artifactId>
    <version>2.13-SNAPSHOT</version>
</dependency>

net.sourceforge.htmlunit
htmlunit
2.13-1

我相信
HTMLUnit
有一个补丁,可以让它在GAE环境中工作,我会错过什么呢?

看起来我忘了做“mvn清理”,因为我使用了早期版本的HTMLUnit,工件仍然存在


现在它工作了

我很清楚这个例外。您不能使用java.net.URLStreamHandler,HTMLUnit正在使用它。您应该将测试与GAE环境隔离。因为URLStreamHandler在白名单中,我认为@DiogoSantana我能够使它与2.13-Snapshot一起工作,太棒了!我很乐意帮忙。
<dependency>
    <groupId>net.sourceforge.htmlunit</groupId>
    <artifactId>htmlunit</artifactId>
    <version>2.13-SNAPSHOT</version>
</dependency>