javax.el.ELException: Cannot convert output of type class java.lang.String

Asked on January 23, 2015
Hi,
I am creating JSF composite component demo application. Need help to resolve below exception.
javax.el.ELException: Cannot convert output of type class java.lang.String to class javax.el.MethodExpression
org.apache.el.lang.ELSupport.coerceToType(ELSupport.java:419)
org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
com.sun.faces.facelets.el.ContextualCompositeValueExpression.getValue(Unknown Source)
com.sun.faces.facelets.el.TagValueExpression.getValue(Unknown Source)
com.sun.faces.facelets.tag.TagAttributeImpl$AttributeLookupMethodExpression.invoke(Unknown Source)
javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(Unknown Source)
com.sun.faces.application.ActionListenerImpl.processAction(Unknown Source)
javax.faces.component.UICommand.broadcast(Unknown Source)
javax.faces.component.UIViewRoot.broadcastEvents(Unknown Source)
javax.faces.component.UIViewRoot.processApplication(Unknown Source)
com.sun.faces.lifecycle.InvokeApplicationPhase.execute(Unknown Source)
com.sun.faces.lifecycle.Phase.doPhase(Unknown Source)
com.sun.faces.lifecycle.LifecycleImpl.execute(Unknown Source)
javax.faces.webapp.FacesServlet.service(Unknown Source)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

Replied on January 23, 2015
Please explain what are you creating.

Replied on January 23, 2015
I am creating a composite component in JSF and creating command button as below.
<composite:interface>
--------------------
---------------------
<composite:attribute name="submitButtonAction" />
</composite:interface>
<composite:implementation>
-----------------------
----------------------
<h:commandButton value="#{cc.attrs.submitButtonLabel}" action="#{cc.attrs.submitButtonAction}"/>
</composite:implementation>

Replied on January 23, 2015
You have not defined <b>method-signature</b> in <composite:attribute name="submitButtonAction" />
define it as
<composite:attribute name="submitButtonAction" method-signature="java.lang.String anyMethod()" />
in <composite:interface>
define it as
<composite:attribute name="submitButtonAction" method-signature="java.lang.String anyMethod()" />
in <composite:interface>