0

当我单击表单的提交按钮时,我遇到了异常。在谷歌上搜索了更多之后,当服务器没有响应 HTMLUnit 提交的请求时,似乎抛出了这个异常。我正在使用 HTMLUnit 2.9。

java.lang.RuntimeException: org.apache.http.NoHttpResponseException: 目标服务器在 com.gargoylesoftware.htmlunit.html.HtmlForm.submit( HtmlForm.java:135) 在 com.gargoylesoftware.htmlunit.html.HtmlSubmitInput.doClickAction(HtmlSubmitInput.java:75) 在 com.gargoylesoftware.htmlunit.html.HtmlElement.click(HtmlElement.java:1244) 在 com.gargoylesoftware.htmlunit .html.HtmlElement.click(HtmlElement.java:1195) at com.gargoylesoftware.htmlunit.html.HtmlElement.click(HtmlElement.java:1158) at com.quinstreet.dms.qaautomationtool.testengine.LeadSubmitter.submitForm(LeadSubmitter.java :1518) 在 com.quinstreet.dms.qaautomationtool.testengine.LeadSubmitter.processFodPage(LeadSubmitter.java:627) 在 com.quinstreet.dms.qaautomationtool.testengine.LeadSubmitter.submitLead(LeadSubmitter.java:431) 在 com.quinstreet.dms.qaautomationtool.testengine.LeadSubmitter.run(LeadSubmitter.java:174) 在 com.quinstreet.dms .qaautomationtool.util.ThreadPool$PooledThread.run(ThreadPool.java:123)

原因:org.apache.http.NoHttpResponseException:目标服务器在 org.apache.http.impl.io.AbstractMessageParser 的 org.apache.http.impl.conn.DefaultResponseParser.parseHead(DefaultResponseParser.java:101) 处响应失败.parse(AbstractMessageParser.java:252) 在 org.apache.http.impl.AbstractHttpClientConnection.receiveResponseHeader(AbstractHttpClientConnection.java:281) 在 org.apache.http.impl.conn.DefaultClientConnection.receiveResponseHeader(DefaultClientConnection.java:247) 在org.apache.http.impl.conn.AbstractClientConnAdapter.receiveResponseHeader(AbstractClientConnAdapter.java:219) 在 org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:298) 在 org.apache.http.protocol.HttpRequestExecutor。在组织执行(HttpRequestExecutor.java:125)。org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:464) 中的 org.apache.http.impl.client 中的 apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:645)。 AbstractHttpClient.execute(AbstractHttpClient.java:820) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:776) at com.gargoylesoftware.htmlunit.HttpWebConnection.getResponse(HttpWebConnection.java:152) at com .gargoylesoftware.htmlunit.WebClient.loadWebResponseFromWebConnection(WebClient.java:1439) at com.gargoylesoftware.htmlunit.WebClient.loadWebResponse(WebClient.java:1358) at com.gargoylesoftware.htmlunit.WebClient.download(WebClient.java:2127)org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:820) 在 org.apache.http.impl.client 的 apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:464)。 AbstractHttpClient.execute(AbstractHttpClient.java:776) at com.gargoylesoftware.htmlunit.HttpWebConnection.getResponse(HttpWebConnection.java:152) at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseFromWebConnection(WebClient.java:1439) at com.gargoylesoftware.htmlunit .WebClient.loadWebResponse(WebClient.java:1358) 在 com.gargoylesoftware.htmlunit.WebClient.download(WebClient.java:2127)org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:820) 在 org.apache.http.impl.client 的 apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:464)。 AbstractHttpClient.execute(AbstractHttpClient.java:776) at com.gargoylesoftware.htmlunit.HttpWebConnection.getResponse(HttpWebConnection.java:152) at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseFromWebConnection(WebClient.java:1439) at com.gargoylesoftware.htmlunit .WebClient.loadWebResponse(WebClient.java:1358) 在 com.gargoylesoftware.htmlunit.WebClient.download(WebClient.java:2127)http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:776) 在 com.gargoylesoftware.htmlunit.HttpWebConnection.getResponse(HttpWebConnection.java:152) 在 com.gargoylesoftware.htmlunit.WebClient.loadWebResponseFromWebConnection(WebClient.java:1439)在 com.gargoylesoftware.htmlunit.WebClient.loadWebResponse(WebClient.java:1358) 在 com.gargoylesoftware.htmlunit.WebClient.download(WebClient.java:2127)http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:776) 在 com.gargoylesoftware.htmlunit.HttpWebConnection.getResponse(HttpWebConnection.java:152) 在 com.gargoylesoftware.htmlunit.WebClient.loadWebResponseFromWebConnection(WebClient.java:1439)在 com.gargoylesoftware.htmlunit.WebClient.loadWebResponse(WebClient.java:1358) 在 com.gargoylesoftware.htmlunit.WebClient.download(WebClient.java:2127)下载(WebClient.java:2127)下载(WebClient.java:2127)

请提出解决方案或任何线索来解决此问题。

4

0 回答 0