From: Hani S. <ha...@fo...> - 2005-08-15 20:26:35
|
The fix is pretty trivial, adding the following two lines to getStateForUrl, before iterating through httpClients_: domain = domain + ":" + url.getPort(); rootDomain = rootDomain + ":" + url.getPort(); This does make some tests fail, but the tests are rather...silly. They use a key which can no longer exist anymore (no port part). Anyway, that does help me move along a little bit, but the next obstacle is that I get the exception below. Any ideas? java.lang.ClassCastException: org.mozilla.javascript.NativeObject at com.gargoylesoftware.htmlunit.javascript.SimpleScriptable.makeJavaScript Object(SimpleScriptable.java:126) at com.gargoylesoftware.htmlunit.javascript.SimpleScriptable.makeScriptable For(SimpleScriptable.java:399) at com.gargoylesoftware.htmlunit.html.DomNode.getScriptObject (DomNode.java:438) at com.gargoylesoftware.htmlunit.javascript.SimpleScriptable.getScriptableF or(SimpleScriptable.java:375) at com.gargoylesoftware.htmlunit.javascript.host.Document.jsxFunction_creat eElement(Document.java:550) at sun.reflect.GeneratedMethodAccessor14.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:174) at org.mozilla.javascript.FunctionObject.call (FunctionObject.java:456) at org.mozilla.javascript.Interpreter.interpret(Interpreter.java: 3026) at org.mozilla.javascript.Interpreter.interpret(Interpreter.java: 2164) at org.mozilla.javascript.InterpretedFunction.call (InterpretedFunction.java:140) at org.mozilla.javascript.ContextFactory.doTopCall (ContextFactory.java:304) at org.mozilla.javascript.ScriptRuntime.doTopCall (ScriptRuntime.java:2769) at org.mozilla.javascript.Interpreter.interpret(Interpreter.java: 2145) at org.mozilla.javascript.InterpretedFunction.call (InterpretedFunction.java:140) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction (JavaScriptEngine.java:299) at com.gargoylesoftware.htmlunit.html.HtmlPage.executeOnLoadHandlersIfNeede d(HtmlPage.java:964) == CALLING JAVASCRIPT == function () { func(); oldonload(); } On Aug 15, 2005, at 8:20 AM, Marc Guillemot wrote: > Hi, > > I agree that it may cause a problem. > > I've added the port in the key for getHttpClientFor(URL) to fix bug > http://sourceforge.net/tracker/index.php? > func=detail&aid=1195099&group_id=47038&atid=448266 > > and I hadn't time to look at how the port should be integrated in > getStateForUrl(URL). Therefore I've decided to ignore it a first > time as all this stuff should disappear when changes have been made > to use a single HttpClient. > > If you can test it and provide a patch I will integrate it asap. > > Marc. > > Hani Suleiman wrote: > >> This might be me missing something, but there's a rather >> disturbing bug in CVS in HttpWebConnection... >> In getHttpClientFor(URL), the key for the httpclients is >> calculated to be the protocol + host + port. Yet in getStateForUrl >> (URL), the condition to check for key matches only takes the host >> into consideration. >> So I'm rather perplexed how anyone testing on a non-default port >> with cookies can get things to work! >> Am I missing something? >> Hani >> ------------------------------------------------------- >> SF.Net email is Sponsored by the Better Software Conference & EXPO >> September 19-22, 2005 * San Francisco, CA * Development Lifecycle >> Practices >> Agile & Plan-Driven Development * Managing Projects & Teams * >> Testing & QA >> Security * Process Improvement & Measurement * http://www.sqe.com/ >> bsce5sf >> _______________________________________________ >> Htmlunit-user mailing list >> Htm...@li... >> https://lists.sourceforge.net/lists/listinfo/htmlunit-user >> > > > > ------------------------------------------------------- > SF.Net email is Sponsored by the Better Software Conference & EXPO > September 19-22, 2005 * San Francisco, CA * Development Lifecycle > Practices > Agile & Plan-Driven Development * Managing Projects & Teams * > Testing & QA > Security * Process Improvement & Measurement * http://www.sqe.com/ > bsce5sf > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > |