[ 
https://issues.apache.org/jira/browse/MYFACES-4760?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18104106#comment-18104106
 ] 

Ulrich Becker commented on MYFACES-4760:
----------------------------------------

[PR for 4.1.x: |https://github.com/apache/myfaces/pull/1041] 
[https://github.com/apache/myfaces/pull/1041]

PR for main: https://github.com/apache/myfaces/pull/1042

> QuarkusApplication.getELResolver() introduces data race
> -------------------------------------------------------
>
>                 Key: MYFACES-4760
>                 URL: https://issues.apache.org/jira/browse/MYFACES-4760
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: Extension Feature
>    Affects Versions: 5.0.0, 4.1.3
>         Environment: myfaces-quarkus 4.1.3, quarkus-primefaces 3.13.11, 
> quarkus-primefaces-extensions 3.13.11, jakarta.el-api 6.0.1, expressly 6.0.0
>            Reporter: Ulrich Becker
>            Priority: Minor
>   Original Estimate: 4h
>  Remaining Estimate: 4h
>
> On a freshly started application, the first page load fails intermittently. 
> Subsequent requests  succeed. Stack trace (excerpt):
> jakarta.el.ELException: java.lang.NullPointerException: Cannot invoke
> "jakarta.el.ELResolver.convertToType(...)" because "this.elResolvers[i]" is 
> null
>     at jakarta.el.ELContext.convertToType(ELContext.java:435)
>     at 
> org.glassfish.expressly.lang.EvaluationContext.convertToType(EvaluationContext.java:141)
>     at 
> org.glassfish.expressly.ValueExpressionImpl.getValue(ValueExpressionImpl.java:142)
>     at 
> org.apache.myfaces.application.ApplicationImpl.evaluateExpressionGet(ApplicationImpl.java:515)
>     ...
> Caused by: java.lang.NullPointerException: ... "this.elResolvers[i]" is null
>     at 
> jakarta.el.CompositeELResolver.convertToType(CompositeELResolver.java:446)
> {{ApplicationImpl}} builds its resolver chain inside a synchronized 
> {{Lazy<ELResolver>}} with safe publication, so core is not affected. However, 
> on Quarkus, 
> {{org.apache.myfaces.core.extensions.quarkus.runtime.application.QuarkusApplication}}
>  overrides {{getELResolver() and exposes a possibly partially built 
> elResolver.}}
> {{I see two ways to fix this:}}
> {{1) QuarkusApplication uses Lazy just as ApplicationImpl does}}
> {{2) A protected method in Application that provides the ELResolverBuilder. 
> QuarkusApplication can then override this method to supply its 
> QuarkusELResolverBuilder}}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to