eclipse-ee4j / mojarra

Mojarra, a Jakarta Faces implementation
Other
158 stars 107 forks source link

WildFly includes Mojarra 4.0.6 and is seeing 16 (old) Faces 4.0 TCK failures #5436

Closed scottmarlow closed 2 months ago

scottmarlow commented 2 months ago

Describe the bug

I'm not sure of the cause yet. With https://www.eclipse.org/downloads/download.php?file=/jakartaee/faces/4.0/jakarta-faces-tck-4.0.3.zip + latest WildFly changes that includes Mojarra 4.0.6 we are seeing the following TCK tests failing:

[javatest.batch] FAILED........com/sun/ts/tests/jsf/api/jakarta_faces/application/navigationcase/URLClient.java#navigationCaseGetBookmarkableURLTest [javatest.batch] FAILED........com/sun/ts/tests/jsf/api/jakarta_faces/application/navigationcase/URLClient.java#navigationCaseGetRedirectURLTest [javatest.batch] FAILED........com/sun/ts/tests/jsf/api/jakarta_faces/component/html/htmlform/URLClient.java#uiComponentEncodeBeginELTest [javatest.batch] FAILED........com/sun/ts/tests/jsf/api/jakarta_faces/component/html/htmlform/URLClient.java#uiComponentEncodeEndELTest [javatest.batch] FAILED........com/sun/ts/tests/jsf/api/jakarta_faces/component/html/htmlform/URLClient.java#uiComponentGetCurrentComponentNullTest [javatest.batch] FAILED........com/sun/ts/tests/jsf/api/jakarta_faces/component/html/htmlform/URLClient.java#uiComponentGetCurrentComponentTest [javatest.batch] FAILED........com/sun/ts/tests/jsf/api/jakarta_faces/component/html/htmlform/URLClient.java#uiComponentGetCurrentCompositeComponentNullTest [javatest.batch] FAILED........com/sun/ts/tests/jsf/api/jakarta_faces/component/html/htmlform/URLClient.java#uiComponentPopComponentFromELTest [javatest.batch] FAILED........com/sun/ts/tests/jsf/api/jakarta_faces/component/html/htmlform/URLClient.java#uiComponentPushComponentToELTest [javatest.batch] FAILED........com/sun/ts/tests/jsf/api/jakarta_faces/component/uiform/URLClient.java#uiComponentEncodeBeginELTest [javatest.batch] FAILED........com/sun/ts/tests/jsf/api/jakarta_faces/component/uiform/URLClient.java#uiComponentEncodeEndELTest [javatest.batch] FAILED........com/sun/ts/tests/jsf/api/jakarta_faces/component/uiform/URLClient.java#uiComponentGetCurrentComponentNullTest [javatest.batch] FAILED........com/sun/ts/tests/jsf/api/jakarta_faces/component/uiform/URLClient.java#uiComponentGetCurrentComponentTest [javatest.batch] FAILED........com/sun/ts/tests/jsf/api/jakarta_faces/component/uiform/URLClient.java#uiComponentGetCurrentCompositeComponentNullTest [javatest.batch] FAILED........com/sun/ts/tests/jsf/api/jakarta_faces/component/uiform/URLClient.java#uiComponentPopComponentFromELTest [javatest.batch] FAILED........com/sun/ts/tests/jsf/api/jakarta_faces/component/uiform/URLClient.java#uiComponentPushComponentToELTest

The WildFly tracking issue is https://issues.redhat.com/browse/WFLY-19220

To Reproduce

I have reproduced it locally with WildFly but GlassFish is still using Mojarra 4.0.5 so didn't try that.

scottmarlow commented 2 months ago

Do any of the changes in https://github.com/eclipse-ee4j/mojarra/compare/4.0.5-RELEASE...4.0.6-RELEASE change anything that could cause failures like shown in https://issues.redhat.com/browse/WFLY-19220

scottmarlow commented 2 months ago

I'm doing a git bisect and testing with different changes included in the 4.0.6 release to narrow the cause down.

scottmarlow commented 2 months ago

git bisect identified https://github.com/eclipse-ee4j/mojarra/commit/5a23e8a4 as the cause.

pizzi80 commented 2 months ago

If the stacktrace is the one pasted in the textarea on the redhat website you linked

what I see is:

[javatest.batch] Caused by: java.util.NoSuchElementException: No value present
[javatest.batch]    at java.base/java.util.Optional.get(Optional.java:148)
[javatest.batch]    at jakarta.faces.impl@4.0.6//com.sun.faces.util.Util.getResponseEncoding(Util.java:1680)
[javatest.batch]    at jakarta.faces.impl@4.0.6//com.sun.faces.util.Util.getResponseEncoding(Util.java:1629)
[javatest.batch]    at jakarta.faces.impl@4.0.6//com.sun.faces.context.ExternalContextImpl.encodeBookmarkableURL(ExternalContextImpl.java:976)
[javatest.batch]    at jakarta.faces.impl@4.0.6//com.sun.faces.application.view.MultiViewHandler.getBookmarkableURL(MultiViewHandler.java:327)

if this is the error, the cause is a bug inside the Util class:

public static String getResponseEncoding(FacesContext context) {
   return getResponseEncoding(context, Optional.empty());
}

and it's caused by the Omptional.empty() passed as a second parameter which throws a NoSuchElementException if the value is null , which is the exact value of Omptional.empty() :)

pizzi80 commented 2 months ago

probably it's better to pass a String and not an Optional<String> and I would pass the constant RIConstants.CHAR_ENCODING

soul2zimate commented 2 months ago

Hi @scottmarlow , @TomasHofman actually opened an issue https://github.com/eclipse-ee4j/mojarra/issues/5429 for very similar stacktrace, but he identified different commit causes the failure.

BalusC commented 2 months ago

Please retry with 4.0.7-SNAPSHOT. This has only been fixed in current 4.0 branch for #5429.

Or let me know if we should release 4.0.7 as soon as possible.

scottmarlow commented 2 months ago

Please retry with 4.0.7-SNAPSHOT. This has only been fixed in current 4.0 branch for https://github.com/eclipse-ee4j/mojarra/issues/5429.

Or let me know if we should release 4.0.7 as soon as possible.

@BalusC thanks, I will test with ^ by locally building with the 4.0 branch that has changes:

commit 1d8c54b4ce726d2dfc82d754e9dc91e468938905 (HEAD -> 4.0, origin/4.0)

Merge: fed22d6e cac7dabc Author: Bauke Scholtz balusc@gmail.com Date: Wed Apr 10 09:02:18 2024 -0400

Merge pull request #5433 from eclipse-ee4j/mojarra_issue_5431

size attribute is only supported on HtmlSelect*Listbox components

commit cac7dabc4e550803920233109f8e07dc7da0dca5 (origin/mojarra_issue_5431) Author: Bauke Scholtz balusc@gmail.com Date: Sun Apr 7 11:05:47 2024 -0400

size attribute is only supported on HtmlSelect*Listbox components
https://github.com/eclipse-ee4j/mojarra/issues/5431

commit fed22d6e8fa1b78c6a4a88c0a89b40448bdff3ce Merge: 0cd4025f cacad0d4 Author: Bauke Scholtz balusc@gmail.com Date: Tue Apr 2 08:20:53 2024 -0400

Merge pull request #5432 from codylerum/4.0

show which viewId was not found in exception

commit cacad0d4cda8e3980890e0a95f2817c5c13c5759 Author: Cody Lerum cody.lerum@gmail.com Date: Mon Apr 1 10:47:32 2024 -0600

show which viewId was not found in exception

commit 0cd4025f0223896d434fbf2e9fc804d690a5bc41 Merge: dd608290 acbdf4cb Author: Bauke Scholtz balusc@gmail.com Date: Sat Mar 30 09:15:43 2024 -0400

Merge pull request #5428 from eclipse-ee4j/mojarra_issue_5427

Fix #5427 UISelectMany collectionType ignored when VE resolves to non-Collection

And includes:

commit cea3398cd97628d3bef709b20fdbaa3add0c26b3 Author: Bauke Scholtz balusc@gmail.com Date: Mon Feb 12 06:56:32 2024 -0400

Default encoding should be prechecked https://github.com/eclipse-ee4j/mojarra/issues/5383

scottmarlow commented 2 months ago

Please retry with 4.0.7-SNAPSHOT. This has only been fixed in current 4.0 branch for #5429.

Or let me know if we should release 4.0.7 as soon as possible.

@BalusC thanks again for the quick fix! WildFly just passed all of the Faces (old + new) TCK tests with 4.0.7-SNAPSHOT!

We will switch to the 4.0.7 release when available. Having the 4.0.7 release as soon as possible would be appreciated! :-)

BalusC commented 2 months ago

Okay I'll look what I can do.

BalusC commented 2 months ago

Mojarra 4.0.7 will be released today.

BalusC commented 2 months ago

This issue is technically speaking duplicate of https://github.com/eclipse-ee4j/mojarra/issues/5429