Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get Wrapped Viewhandler (Avoids java.lang.InstantiationException: org.jboss.weld.module.jsf.ConversationAwareViewHandler) #1656

Merged
merged 1 commit into from
Apr 24, 2022

Conversation

volosied
Copy link
Contributor

@volosied volosied commented Apr 24, 2022

Due to JSF-CDI changes, org.jboss.weld.module.jsf.ConversationAwareViewHandler is the default viewhandler.

https://github.com/weld/core/blob/master/modules/jsf/src/main/java/org/jboss/weld/module/jsf/ConversationAwareViewHandler.java

During the tests, JSFTestUtil tries to instantiate this class, but fails because it needs arguments in constructor.

Since ConversationAwareViewHandler extends ViewHandlerWrapper, we can cast it as ViewHandlerWrapper and get our JSF ViewHandler instead (com.sun.faces.application.view.MultiViewHandler).

As always, please test and verify :)

@arjantijms @alwin-joseph


Stack trace for reference:
java.lang.InstantiationException: org.jboss.weld.module.jsf.ConversationAwareViewHandler
[echo] at java.base/java.lang.Class.newInstance(Class.java:571)
[echo] at com.sun.ts.tests.jsf.common.util.JSFTestUtil.checkForNPE(JSFTestUtil.java:440)
[echo] at com.sun.ts.tests.jsf.api.jakarta_faces.application.viewhandler.TestServlet.viewHandlerWriteStateNPETest(TestServlet.java:335)
[echo] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[echo] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[echo] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[echo] at java.base/java.lang.reflect.Method.invoke(Method.java:566)
[echo] at com.sun.ts.tests.jsf.common.servlets.HttpTCKServlet.invokeTest(HttpTCKServlet.java:163)
[echo] at com.sun.ts.tests.jsf.common.servlets.HttpTCKServlet.doGet(HttpTCKServlet.java:104)

@alwin-joseph
Copy link
Contributor

Test Result with this change :

Test results: passed: 5,356; failed: 74
CI job logs : https://ci.eclipse.org/jakartaee-tck/job/10/job/jakarta-faces-tck-build-run/9/consoleText

@arjantijms arjantijms merged commit 5bbe133 into jakartaee:master Apr 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants