From: Marc G. <mgu...@ya...> - 2005-08-17 08:34:47
|
I think that I've now fixed it adapting your proposition but we definitely need test for this stuff. What for an element does your js create with document.createElement? Marc. Hani Suleiman wrote: > 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(); > } > |