Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

JavaScript validation error when calling a JakartaEE10 MyFaces page

Offen
#883 6 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
42/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
java, javascript
Bereich
backend, testing

Rechercherichtung

Start by inspecting the attached test.js and the JavaScript served as faces.js.jsf in the TomEE reproduction; compare it with the version served under Mojarra on WildFly. Run the provided Maven sample with Java 17 and TomEE 10.0M2 to reproduce the parser error. Done means identifying and addressing the incompatibility so the Jakarta Faces page with an Ajax call loads without the exception.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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:

  1. download TomEE 10.0M2 from https://tomee.apache.org/download.html (you need "TomEE Webprofile zip") and unzip
  2. you need Java 17
  3. rename attached "test.war.zip" to "test.war" and copy it to to TOMEE_HOME\webapps:
    test.war.zip
  4. start TomEE: TOMEE_HOME\bin\startup.bat (or startup.sh)
  5. you can test the app by browsing to http://localhost:8080/test/index.jsf
  6. now launch attached sample "htmlunittest.zip" (a small Eclipse maven project): mvn clean compile exec:java - you should see a large exception.
    htmlunittest.zip

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?

Vorherrschende Sprache
JavaScript
Sterne
952
Forks
183
Ø Merge
2 T. 1 Std.
Gemergte PRs (30 T.)
1

Entwicklungsumgebung

Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus HtmlUnit/htmlunit

Alle Issues in HtmlUnit/htmlunit

Ähnliche Issues

Weitere Issues zu JavaScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.