Since Michael posted a bugreport regarding HTMLUnit support.
We nailed that down it was a combination of dirty stuff htmlunit did and
a bug introduced by me by the refactoring on the codebase.
(the dirty trick from htmlunit was passing a "null" string back instead
of giving null back or undefined while masking itself as IE )
I just would like to know since I never really tested the scripts
against HTMLUnit not before nor after the the refactoring.
How far was it running for 2.0.0?
Because as I see it getting a full htmlunit support for 2.0.1 is not a
requirement in my eyes which should hold up the 2.0.1 release, which is
important due to the pending security issue, unless
2.0.0 was entirely running with htmlunit.
The way I see it from what I am getting in, html unit does some things
quite differently while masking itself as IE so we have to add some
fallback code in our codebase just to deal with html unit as masked IE
in certain parts - as if dealing with various versions of IE was not bad
enough we get a fourth IE version in, which is html unit (Rhino + added
stuff passing a user agent string as ie down the system). The way I see
it full html unit support should be a goal for 2.0.2 not 2.0.1.
As I said not that I am against it, getting htmlunit support in makes
testing definitely easier in the long run, I just try to evaluate how
far the html unit tests from Michael etc... were going for 2.0.0 to get
a clearer picture here on what is needed for 2.0.1.
Was ist just loading the page and doing some html/jsf related stuff or
was it triggering the entire lifecycle on Ajax and running through a
series of ajaxed tests?
Werner
Am 08.06.10 23:01, schrieb Leonardo Uribe (JIRA):
[
https://issues.apache.org/jira/browse/MYFACES-2745?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Leonardo Uribe resolved MYFACES-2745.
-------------------------------------
Fix Version/s: 2.0.1
(was: 2.0.1-SNAPSHOT)
Resolution: Fixed
Cannot set property "_mfProto" of null to "null" error with new javascript
--------------------------------------------------------------------------
Key: MYFACES-2745
URL: https://issues.apache.org/jira/browse/MYFACES-2745
Project: MyFaces Core
Issue Type: Bug
Components: JSR-314
Affects Versions: 2.0.1
Reporter: Michael Concini
Assignee: Leonardo Uribe
Fix For: 2.0.1
The javascript changes from 5/25 have caused a regression when using htmlunit
against even the simplest JSF page as long as it loads the jsf.js script.
The exception occurs simply executing getPage() on the webClient.
WebClient webClient = new WebClient();
HtmlPage page =
webClient.getPage("http://localhost:8080/JSF20AJAXTag/DisabledFalse.jsf");
It can be recreated by a page with nothing but this form in the body:
<h:form id="form1" prependId="false">
<h:outputText id="out1" value="This is broken"/>
<h:outputScript name="jsf.js" library="javax.faces" target="head" />
</h:form>
Attached is the exception trace from a run this morning which includes Werner's
changes from MYFACES-2742 this morning so we are up to date in our sandbox.
======= EXCEPTION START ========
EcmaError: lineNumber=[51] column=[0] lineSource=[<no source>] name=[TypeError]
sourceName=[http://localhost:8080/JSF20AJAXTag/javax.faces.resource/jsf.js.jsf?ln=javax.faces]
message=[TypeError: Cannot set property "_mfProto" of null to "null"
(http://localhost:8080/JSF20AJAXTag/javax.faces.resource/jsf.js.jsf?ln=javax.faces#51)]
com.gargoylesoftware.htmlunit.ScriptException: TypeError: Cannot set property "_mfProto"
of null to "null"
(http://localhost:8080/JSF20AJAXTag/javax.faces.resource/jsf.js.jsf?ln=javax.faces#51)
at
com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:527)
at
net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:537)
at
net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:538)
at
com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:425)
at
com.gargoylesoftware.htmlunit.html.HtmlPage.loadExternalJavaScriptFile(HtmlPage.java:980)
at
com.gargoylesoftware.htmlunit.html.HtmlScript.executeScriptIfNeeded(HtmlScript.java:353)
at
com.gargoylesoftware.htmlunit.html.HtmlScript$1.execute(HtmlScript.java:215)
at
com.gargoylesoftware.htmlunit.html.HtmlScript.onAllChildrenAddedToPage(HtmlScript.java:235)
at
com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:718)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown
Source)
at
com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:676)
at
org.cyberneko.html.HTMLTagBalancer.callEndElement(HTMLTagBalancer.java:1136)
at
org.cyberneko.html.HTMLTagBalancer.endElement(HTMLTagBalancer.java:1038)
at
org.cyberneko.html.filters.DefaultFilter.endElement(DefaultFilter.java:206)
at
org.cyberneko.html.filters.NamespaceBinder.endElement(NamespaceBinder.java:329)
at
org.cyberneko.html.HTMLScanner$ContentScanner.scanEndElement(HTMLScanner.java:2999)
at
org.cyberneko.html.HTMLScanner$ContentScanner.scan(HTMLScanner.java:1991)
at org.cyberneko.html.HTMLScanner.scanDocument(HTMLScanner.java:895)
at
org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:499)
at
org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:452)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at
com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.parse(HTMLParser.java:896)
at
com.gargoylesoftware.htmlunit.html.HTMLParser.parse(HTMLParser.java:350)
at
com.gargoylesoftware.htmlunit.html.HTMLParser.parseHtml(HTMLParser.java:304)
at
com.gargoylesoftware.htmlunit.DefaultPageCreator.createHtmlPage(DefaultPageCreator.java:134)
at
com.gargoylesoftware.htmlunit.DefaultPageCreator.createPage(DefaultPageCreator.java:101)
at
com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:420)
at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:303)
at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:360)
at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:345)
at com.ibm.mike.TestJS.homePage(TestJS.java:19)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:600)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at
org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: net.sourceforge.htmlunit.corejs.javascript.EcmaError: TypeError: Cannot set property
"_mfProto" of null to "null"
(http://localhost:8080/JSF20AJAXTag/javax.faces.resource/jsf.js.jsf?ln=javax.faces#51)
at
net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3753)
at
net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3731)
at
net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3759)
at
net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.typeError3(ScriptRuntime.java:3785)
at
net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.undefWriteError(ScriptRuntime.java:3807)
at
net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.setObjectElem(ScriptRuntime.java:1578)
at
net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpretLoop(Interpreter.java:1450)
at
net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpret(Interpreter.java:845)
at
net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.call(InterpretedFunction.java:164)
at
net.sourceforge.htmlunit.corejs.javascript.ContextFactory.doTopCall(ContextFactory.java:429)
at
com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory.doTopCall(HtmlUnitContextFactory.java:264)
at
net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3157)
at
net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.exec(InterpretedFunction.java:175)
at
com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$3.doRun(JavaScriptEngine.java:416)
at
com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:521)
... 46 more
Enclosed exception:
net.sourceforge.htmlunit.corejs.javascript.EcmaError: TypeError: Cannot set property
"_mfProto" of null to "null"
(http://localhost:8080/JSF20AJAXTag/javax.faces.resource/jsf.js.jsf?ln=javax.faces#51)
at
net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3753)
at
net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3731)
at
net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3759)
at
net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.typeError3(ScriptRuntime.java:3785)
at
net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.undefWriteError(ScriptRuntime.java:3807)
at
net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.setObjectElem(ScriptRuntime.java:1578)
at
net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpretLoop(Interpreter.java:1450)
at
script(http://localhost:8080/JSF20AJAXTag/javax.faces.resource/jsf.js.jsf?ln=javax.faces:51)
at
script(http://localhost:8080/JSF20AJAXTag/javax.faces.resource/jsf.js.jsf?ln=javax.faces:48)
at
script(http://localhost:8080/JSF20AJAXTag/javax.faces.resource/jsf.js.jsf?ln=javax.faces:65)
at
net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpret(Interpreter.java:845)
at
net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.call(InterpretedFunction.java:164)
at
net.sourceforge.htmlunit.corejs.javascript.ContextFactory.doTopCall(ContextFactory.java:429)
at
com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory.doTopCall(HtmlUnitContextFactory.java:264)
at
net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3157)
at
net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.exec(InterpretedFunction.java:175)
at
com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$3.doRun(JavaScriptEngine.java:416)
at
com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:521)
at
net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:537)
at
net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:538)
at
com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:425)
at
com.gargoylesoftware.htmlunit.html.HtmlPage.loadExternalJavaScriptFile(HtmlPage.java:980)
at
com.gargoylesoftware.htmlunit.html.HtmlScript.executeScriptIfNeeded(HtmlScript.java:353)
at
com.gargoylesoftware.htmlunit.html.HtmlScript$1.execute(HtmlScript.java:215)
at
com.gargoylesoftware.htmlunit.html.HtmlScript.onAllChildrenAddedToPage(HtmlScript.java:235)
at
com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:718)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown
Source)
at
com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:676)
at
org.cyberneko.html.HTMLTagBalancer.callEndElement(HTMLTagBalancer.java:1136)
at
org.cyberneko.html.HTMLTagBalancer.endElement(HTMLTagBalancer.java:1038)
at
org.cyberneko.html.filters.DefaultFilter.endElement(DefaultFilter.java:206)
at
org.cyberneko.html.filters.NamespaceBinder.endElement(NamespaceBinder.java:329)
at
org.cyberneko.html.HTMLScanner$ContentScanner.scanEndElement(HTMLScanner.java:2999)
at
org.cyberneko.html.HTMLScanner$ContentScanner.scan(HTMLScanner.java:1991)
at org.cyberneko.html.HTMLScanner.scanDocument(HTMLScanner.java:895)
at
org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:499)
at
org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:452)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at
com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.parse(HTMLParser.java:896)
at
com.gargoylesoftware.htmlunit.html.HTMLParser.parse(HTMLParser.java:350)
at
com.gargoylesoftware.htmlunit.html.HTMLParser.parseHtml(HTMLParser.java:304)
at
com.gargoylesoftware.htmlunit.DefaultPageCreator.createHtmlPage(DefaultPageCreator.java:134)
at
com.gargoylesoftware.htmlunit.DefaultPageCreator.createPage(DefaultPageCreator.java:101)
at
com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:420)
at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:303)
at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:360)
at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:345)
at com.ibm.mike.TestJS.homePage(TestJS.java:19)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:600)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at
org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
======= EXCEPTION END ========