gpt4 book ai didi

java - URLStreamHandler 是一个受限类

转载 作者:可可西里 更新时间:2023-11-01 17:10:55 25 4
gpt4 key购买 nike

我收到这个错误:

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 环境中工作,我可能缺少什么?

最佳答案

自从我使用较早版本的 HtmlUnit 以来,我似乎忘记执行“mvn clean”,工件仍然存在。

现在可以了!

关于java - URLStreamHandler 是一个受限类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15673942/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com