-
Notifications
You must be signed in to change notification settings - Fork 116
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
cc.attrs cannot be passed to nested composite (OWB) #5515
Comments
In Mojarra 4.0, ImplicitObjectELResolver was replaced with CDI. Now the cc implicit object is handled by CDI and CompositeComponentProducer. This creates an issue with nested components and OWB. When a child component tries to resolve The child component (cc) resolves correctly, but the parent component cc ends up being resolved to the child instead. The issue seems to come from a caching mechanism in OWB’s WebBeansELResolver.java. You can see the relevant code here: I worked around this by overriding the WebBeansELResolver class and disabling caching for implicit objects. I’d appreciate any feedback or thoughts from experts on this issue. No idea if it's Mojarra or OWB issue. Thanks! |
@arjantijms as you're the CDI expert, can you point out if the issue is in Mojarra or in OWB or even in CDI? This appears to be the consequence of replacing For reference, this is the StackOverflowError I reproduced in TomEE 10.0.0 Plume based on the code provided in the SO question:
|
See also jakartaee/faces#1564. We should probably restore |
Confirmed fixed in TomEE Plume 10.0.0 when swapping out its |
Hi BalusC, thanks a lot! and sorry if it sounds like a beginners questions but how/where can I access this snapshot build ? |
Mojarra snapshots are currently unfortunately not deployed to Jakarta's Sonatype Maven repo. So for the time being you'll have to build your own:
|
Ok wanted to avoid to start a custom build ;) @BalusC one more question: will your bugfix be automatically taken to the next TomEE 10.0.x bugfix release, or does someone (me?) have to create a Bug Issue in their JIRA as well |
@cyanotyp We'll update TomEE to pull this in once it is released. I'm imagine we'll want to get a TomEE release done fairly soon after that update to get this resolved. |
Describe the bug
This issue was originally discovered in Tomee10, but I was able to isolate it to mojarra+openwebbeans combination.
I have parent CompositeTest.xhtml that has
showSomeText
attribute. And I have nested component NestedCompositeTest.xhtml withshowSomeText2
attribute. I need to passshowSomeText
from parent toshowSomeText2
of nested component.CompositeTest.xhtml
NestedCompositeTest.xhtml
The issue is that the value of
showSomeText2
is always false. This assignment doesn't work:showSomeText2="#{cc.attrs.showSomeText}"
.It gets even more interesting when I use the same attribute name in parent and nested components. Then I get StackOverflowError.
I was able to debug it to the point when https://github.com/apache/openwebbeans/blob/openwebbeans-4.0.2/webbeans-el22/src/main/java/org/apache/webbeans/el22/WebBeansELResolver.java is trying to get value for
cc
bean and instead of CompositeTest.xhtml, it takes the one that belongs to nestedNestedCompositeTest.xhtml
.The same example works fine with Weld.
To Reproduce
Build war file from this repo and deploy it to tomcat: https://github.com/aleshi/mojarra_openwebbeans_issue
Open: http://localhost:8080/jsf_cdi_and_ejb_war/test.jsf
The page prints:
Expected behavior
Additional context
Mojarra version: 4.0.8
Openwebbeans version: 4.0.2
Tomcat version: 10.1.31
The text was updated successfully, but these errors were encountered: