有几天我面临着HTMLUnit的奇怪错误 - 所有页面加载都失败并出现以下异常:
java.lang.RuntimeException: Refresh to https://acme.com:11111/x/y/z aborted by HtmlUnit: Attempted to refresh a page using an ImmediateRefreshHandler which could have caused an OutOfMemoryError Please use WaitingRefreshHandler or ThreadedRefreshHandler instead.
at com.gargoylesoftware.htmlunit.ImmediateRefreshHandler.handleRefresh(ImmediateRefreshHandler.java:56)
at com.gargoylesoftware.htmlunit.html.HtmlPage.executeRefreshIfNeeded(HtmlPage.java:1276)
at com.gargoylesoftware.htmlunit.html.HtmlPage.initialize(HtmlPage.java:216)
at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:440)
at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:311)
at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:373)
at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:358)
...
嗯......错误信息足够描述,我想我可以让WebClient实例使用WaitingRefreshHandler或ThreadedRefreshHandler。
然而:
基于此 - 最可能的原因是在目标系统中,但错误没有提供任何进一步的细节发生了什么以及为什么。有谁知道这个问题的根本原因是什么?
注意:我正在使用htmlunit 2.9。