Menu

#768 about:url not supported exception

2.4
closed
nobody
None
5
2013-01-02
2009-01-22
No

The problem returns by HtmlUnit is :

com.gargoylesoftware.htmlunit.ScriptException: JavaException:
java.lang.IllegalArgumentException:
about:/include/RemoteFunctions/SimCheck.asp?callid=1is not supported,
only about:blank is supported now. (https://XXX/mfeTabPage.js#203)
at
com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:513)

The trace before the Exception is :

WebClient - Get page for window named 'RemoteFunction_frame_1', using WebRequestSettings[<url="about: include="" remotefunctions="" simcheck.asp?callid="1"," post,="" encodingtype[name="application/x-www-form-urlencoded]," [name="fname," value="SIMCheck," name="value_0," {referer="about:blank}," null="">]</url="about:>

The problem is coming from the HtmlForm.submit method:

public Page submit(final SubmittableElement submitElement) throws IOException {
...
try {
url = htmlPage.getFullyQualifiedUrl(actionUrl);
System.out.println("HtmlForm actionUrl="+actionUrl+" url="+url);
}

Debug : HtmlForm
actionUrl=/include/RemoteFunctions/SimCheck.asp?callid=1
url=about:/include/RemoteFunctions/SimCheck.asp?callid=1

In this case the HtmlPage.getFullyQualifiedUrl is using a baseUrl=about:blank so the
URL oUrl = WebClient.expandUrl(baseUrl, relativeUrl);

is returning a new URL(null, urlString, AboutUrlStreamHandler_) (see WebClient.makeUrl).

So why returning an URL that is rejected later ?

Discussion

  • Marc Guillemot

    Marc Guillemot - 2009-01-22

    about:/include/RemoteFunctions/SimCheck.asp?callid=1is is not a valid URL, this is correct. The problem is probably that HtmlUnit shouldn't compute such an URL and therefore you need to provide a minimal test case where HtmlUnit produces this kind of URL but where a "normal" browser doesn't.

     
  • denis queffeulou

    I'll try to make a test case asap, but I'm not sure to be able to reproduce because the related site is very complex and currently I don't understand why this problem occurs, but if I get one I'll put here.

     
  • Daniel Gredler

    Daniel Gredler - 2009-02-18

    The only way I can see something like this happening is if a frame/iframe with no src attribute has a form added to it dynamically, and the form is submitted. However, local testing shows that this scenario doesn't work in Firefox... Maybe it's something else? Marking pending; please reopen when you have a reproducible test case.

     
  • SourceForge Robot

    This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 30 days (the time period specified by
    the administrator of this Tracker).

     

Log in to post a comment.

MongoDB Logo MongoDB