Using HtmlUnitDriver 4.23.0, I observe an ugly EvaluatorException when calling a minimal Jakarta Faces page with just an Ajax call:
org.htmlunit.corejs.javascript.EvaluatorException: syntax error (http://localhost:8080/test/jakarta.faces.resource/faces.js.jsf;jsessionid=6C2C888968266540AA88DD3A0FCD95C5?ln=jakarta.faces&stage=Development#194)
at org.htmlunit.javascript.HtmlUnitContextFactory$HtmlUnitErrorReporter.error (HtmlUnitContextFactory.java:399)
at org.htmlunit.corejs.javascript.Parser.addError (Parser.java:241)
… (a lot of parser methods)...
at org.htmlunit.corejs.javascript.Context.parse (Context.java:2550)
at org.htmlunit.corejs.javascript.Context.compileImpl (Context.java:2481)
at org.htmlunit.corejs.javascript.Context.compileString (Context.java:1443)
at org.htmlunit.javascript.HtmlUnitContextFactory$TimeoutContext.compileString (HtmlUnitContextFactory.java:193)
at org.htmlunit.corejs.javascript.Context.compileString (Context.java:1431)
at org.htmlunit.javascript.JavaScriptEngine$1.doRun (JavaScriptEngine.java:722)
at org.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run (JavaScriptEngine.java:930)
at org.htmlunit.corejs.javascript.Context.call (Context.java:586)
at org.htmlunit.corejs.javascript.ContextFactory.call (ContextFactory.java:481)
at org.htmlunit.javascript.HtmlUnitContextFactory.callSecured (HtmlUnitContextFactory.java:315)
at org.htmlunit.javascript.JavaScriptEngine.compile (JavaScriptEngine.java:731)
at org.htmlunit.javascript.JavaScriptEngine.compile (JavaScriptEngine.java:112)
at org.htmlunit.html.HtmlPage.loadJavaScriptFromUrl (HtmlPage.java:1124)
at org.htmlunit.html.HtmlPage.loadExternalJavaScriptFile (HtmlPage.java:1015)
at org.htmlunit.html.ScriptElementSupport.executeScriptIfNeeded (ScriptElementSupport.java:191)
at org.htmlunit.html.ScriptElementSupport$1.execute (ScriptElementSupport.java:112)
at org.htmlunit.html.ScriptElementSupport.onAllChildrenAddedToPage (ScriptElementSupport.java:135)
at org.htmlunit.html.HtmlScript.onAllChildrenAddedToPage (HtmlScript.java:192)
at org.htmlunit.html.parser.neko.HtmlUnitNekoDOMBuilder.endElement (HtmlUnitNekoDOMBuilder.java:508)
at org.htmlunit.cyberneko.xerces.parsers.AbstractSAXParser.endElement (AbstractSAXParser.java:291)
at org.htmlunit.html.parser.neko.HtmlUnitNekoDOMBuilder.endElement (HtmlUnitNekoDOMBuilder.java:454)
at org.htmlunit.cyberneko.HTMLTagBalancer.callEndElement (HTMLTagBalancer.java:1220)
at org.htmlunit.cyberneko.HTMLTagBalancer.endElement (HTMLTagBalancer.java:1164)
at org.htmlunit.cyberneko.filters.DefaultFilter.endElement (DefaultFilter.java:168)
at org.htmlunit.cyberneko.filters.NamespaceBinder.endElement (NamespaceBinder.java:266)
at org.htmlunit.cyberneko.HTMLScanner$ContentScanner.scanEndElement (HTMLScanner.java:3208)
at org.htmlunit.cyberneko.HTMLScanner$ContentScanner.scan (HTMLScanner.java:2098)
at org.htmlunit.cyberneko.HTMLScanner.scanDocument (HTMLScanner.java:909)
at org.htmlunit.cyberneko.HTMLConfiguration.parse (HTMLConfiguration.java:336)
at org.htmlunit.cyberneko.HTMLConfiguration.parse (HTMLConfiguration.java:294)
at org.htmlunit.cyberneko.xerces.parsers.AbstractXMLDocumentParser.parse (AbstractXMLDocumentParser.java:80)
at org.htmlunit.html.parser.neko.HtmlUnitNekoDOMBuilder.parse (HtmlUnitNekoDOMBuilder.java:753)
at org.htmlunit.html.parser.neko.HtmlUnitNekoHtmlParser.parse (HtmlUnitNekoHtmlParser.java:195)
at org.htmlunit.DefaultPageCreator.createHtmlPage (DefaultPageCreator.java:300)
at org.htmlunit.DefaultPageCreator.createPage (DefaultPageCreator.java:219)
at org.htmlunit.WebClient.loadWebResponseInto (WebClient.java:681)
at org.htmlunit.WebClient.loadWebResponseInto (WebClient.java:575)
at org.htmlunit.WebClient.getPage (WebClient.java:493)
at org.htmlunit.WebClient.getPage (WebClient.java:402)
at org.openqa.selenium.htmlunit.HtmlUnitDriver.get (HtmlUnitDriver.java:638)
at org.openqa.selenium.htmlunit.HtmlUnitDriver.lambda$get$7 (HtmlUnitDriver.java:619)
at org.openqa.selenium.htmlunit.HtmlUnitDriver.lambda$runAsync$0 (HtmlUnitDriver.java:351)
at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1136)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:635)
at java.lang.Thread.run (Thread.java:842)
Posting the full stacktrace probably does not bring any additional information.
I have a sample to reprocuce, but i requires a few steps:
mvn clean compile exec:java
- you should see a large exception.From the log output, I picked this JavaScript file:
test.js.zip
I ran my sample also on WildFly, which includes the Mojarra Jakarta Faces implementation, and here the error did not happen. So maybe it is really a syntax error?
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too