[jira] [Commented] (MYFACES-4633) Suspicious Logic when setting BeanManager from JNDI

2023-10-06 Thread James McLeod (Jira)


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

James McLeod commented on MYFACES-4633:
---

On review, it appears no change is necessary for the [2.3-next 
branch|https://github.com/apache/myfaces/blob/41fbb9e57b2b9e68f1705b98a9d7298d2601a8de/impl/src/main/java/org/apache/myfaces/webapp/AbstractFacesInitializer.java#L607].

> Suspicious Logic when setting BeanManager from JNDI
> ---
>
> Key: MYFACES-4633
> URL: https://issues.apache.org/jira/browse/MYFACES-4633
> Project: MyFaces Core
>  Issue Type: Bug
>Reporter: James McLeod
>Priority: Major
> Attachments: beanmanager-init-from-jndi.patch
>
>
> Function {{private}} BeanManager lookupBeanManagerFromJndi() in 
> [FacesInitializerImpl|https://github.com/apache/myfaces/blob/main/impl/src/main/java/org/apache/myfaces/webapp/FacesInitializerImpl.java]
>  (specifically [line 594 of the current 
> version|https://github.com/apache/myfaces/blob/7905297aee87def27bd77975e07545f2e59aa357/impl/src/main/java/org/apache/myfaces/webapp/FacesInitializerImpl.java#L594]
>  looks incorrect to me.
> The logic in the function is:
>  # Try to retrieve {{beanManager}} as {{java:comp/BeanManager}} in 
> {{InitialContext}}
>  # If this succeeds (i.e. {{beanManager}} is non-null), try to retrieve 
> {{beanManager}} as {{java:comp/env/BeanManager}} in {{InitialContext}}
> The second step should be done if the first attempt to retrieve 
> {{beanManager}} fails, not if it succeeds. (If my interpretation is wrong, I 
> think an explanatory comment is warranted here!)



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


[jira] [Commented] (MYFACES-4633) Suspicious Logic when setting BeanManager from JNDI

2023-10-06 Thread James McLeod (Jira)


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

James McLeod commented on MYFACES-4633:
---

Shall do; will complete by sometime next week (possibly earlier).

> Suspicious Logic when setting BeanManager from JNDI
> ---
>
> Key: MYFACES-4633
> URL: https://issues.apache.org/jira/browse/MYFACES-4633
> Project: MyFaces Core
>  Issue Type: Bug
>Reporter: James McLeod
>Priority: Major
> Attachments: beanmanager-init-from-jndi.patch
>
>
> Function {{private}} BeanManager lookupBeanManagerFromJndi() in 
> [FacesInitializerImpl|https://github.com/apache/myfaces/blob/main/impl/src/main/java/org/apache/myfaces/webapp/FacesInitializerImpl.java]
>  (specifically [line 594 of the current 
> version|https://github.com/apache/myfaces/blob/7905297aee87def27bd77975e07545f2e59aa357/impl/src/main/java/org/apache/myfaces/webapp/FacesInitializerImpl.java#L594]
>  looks incorrect to me.
> The logic in the function is:
>  # Try to retrieve {{beanManager}} as {{java:comp/BeanManager}} in 
> {{InitialContext}}
>  # If this succeeds (i.e. {{beanManager}} is non-null), try to retrieve 
> {{beanManager}} as {{java:comp/env/BeanManager}} in {{InitialContext}}
> The second step should be done if the first attempt to retrieve 
> {{beanManager}} fails, not if it succeeds. (If my interpretation is wrong, I 
> think an explanatory comment is warranted here!)



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


[jira] [Commented] (MYFACES-4633) Suspicious Logic when setting BeanManager from JNDI

2023-10-06 Thread Thomas Andraschko (Jira)


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

Thomas Andraschko commented on MYFACES-4633:


Can you do us a favor and provide a PR?
i think the same code should exist in 4.0.x and 2.3-next branch

> Suspicious Logic when setting BeanManager from JNDI
> ---
>
> Key: MYFACES-4633
> URL: https://issues.apache.org/jira/browse/MYFACES-4633
> Project: MyFaces Core
>  Issue Type: Bug
>Reporter: James McLeod
>Priority: Major
> Attachments: beanmanager-init-from-jndi.patch
>
>
> Function {{private}} BeanManager lookupBeanManagerFromJndi() in 
> [FacesInitializerImpl|https://github.com/apache/myfaces/blob/main/impl/src/main/java/org/apache/myfaces/webapp/FacesInitializerImpl.java]
>  (specifically [line 594 of the current 
> version|https://github.com/apache/myfaces/blob/7905297aee87def27bd77975e07545f2e59aa357/impl/src/main/java/org/apache/myfaces/webapp/FacesInitializerImpl.java#L594]
>  looks incorrect to me.
> The logic in the function is:
>  # Try to retrieve {{beanManager}} as {{java:comp/BeanManager}} in 
> {{InitialContext}}
>  # If this succeeds (i.e. {{beanManager}} is non-null), try to retrieve 
> {{beanManager}} as {{java:comp/env/BeanManager}} in {{InitialContext}}
> The second step should be done if the first attempt to retrieve 
> {{beanManager}} fails, not if it succeeds. (If my interpretation is wrong, I 
> think an explanatory comment is warranted here!)



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