[JAVASERVERFACES-2780] PropertyNotFoundException thrown for actionListener Created: 06/Mar/13  Updated: 11/Jul/13  Resolved: 11/Jul/13

Status: Closed
Project: javaserverfaces
Component/s: composite components
Affects Version/s: 2.1.20
Fix Version/s: None

Type: Bug Priority: Trivial
Reporter: SteGr Assignee: Unassigned
Resolution: Incomplete Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
is related to JAVASERVERFACES-2839 composite component umbrella task Closed
Tags: actionlistener, composite_components


This Bug is propably based on http://java.net/jira/browse/JAVASERVERFACES-2729

An CDI Bean of an arbitrary scope (e.g. javax.enterprise.context.RequestScoped) that has a void no-arg method which is used as an action listener for a composite component.

import javax.enterprise.context.RequestScoped;
import javax.inject.Named;

public class TestBean {
    public void callActionListener() {
        System.out.println("ACTIONLISTENER CALLED");
    <cc:attribute name="value" required="true" />
    <cc:attribute name="action" targets="view" required="true" />
    <cc:attribute name="actionListener" targets="menuLink" />
    <li><h:commandLink value="#{cc.attrs.value}" id="menuLink" /></li>
<!-- ... -->
<m:menuActionItem value="Test" actionListener="#{testBean.callActionListener}" />
<!-- ... -->

com.sun.faces.facelets.el.ContextualCompositeMethodExpression is not able to resolve the EL expression to the callActionListener method of TestBean. It will throw an PropertyNonFoundExcpetion on line 208 (source is an instance of TagValueExpression) which is caught on line 214. The excpetion should be logged and the original EL exception is thrown on line 223 (well my JBoss 7 installation never reaches that point, as it throws itself an exception during the log() in line 216 when it tries to format [...]#


[...] using java.text.MessageFormat).

More Details
After I click on my link JSF tries to call my action listener two times. The first time with one argument ActionEvent which fails on line 186 and then again as described above (on line 186). The second time it is called without arguments and that call succeeds.

The strange thing about that is, that it fails only once per application server (re)start (start -> click -> fail -> click -> ok -> click -> ok -> restart -> click -> fail ...)
I think that something is wrong during the log() call in line 216 which triggers the fail of the logger itself. Maybe some missing resource? Could you please revisit it?

(The same command link outside of the composite component works correct.)

Dirty workaround for now
If I change my index.jsf to

<!-- ... -->
<m:menuActionItem value="Test" actionListener="#{testBean.callActionListener()}" />
<!-- ... -->

(notice the parentheses in the EL expression), everything works OK. But well, it is not elegant and not correct.

Comment by Manfred Riem [ 03/Apr/13 ]

Can you reproduce this on Glassfish?

Comment by Manfred Riem [ 08/May/13 ]

Lowering priority because of no response

Comment by Manfred Riem [ 13/Jun/13 ]

Lowering priority because of no response

Comment by Manfred Riem [ 11/Jul/13 ]

Closing because of inactivity

Generated at Thu Oct 20 21:56:22 UTC 2016 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.