Environment:
Wildfly 9.0.1
JSF: jsf-impl-2.2.11-jbossorg-1
WELD: wildfly-weld-9.0.1
I have this scenario:
CustomerController.java
public abstract class CustomerController {
public String registerCustomer(){
//Do something and return success page
return SUCCESS_PAGE;
}
}
Type1CustomerController.java
@Named
@ViewScoped
public class Type1CustomerController extends CustomerController{
public String registerCustomer(){
super.registerCustomer();
//Special case, just go back to login and allow login
return SUCCESS_LOGIN_PAGE;
}
}
Type2CustomerController.java
@Named
@ViewScoped
public class Type2CustomerController extends CustomerController {
//Does not override the registerCustomer method, but adds some functionlities based on some abstract definitions on the superclass and simply shows success_page
}
CustomerSelectionController.java
@ApplicationScoped
public class CustomerSelectionController {
@Inject
private Instance<Type2CustomerController> type2CustomerController;
@Inject
private Instance<Type1CustomerController> type1CustomerController;
@Produces
@ViewScoped
@Named("customerController")
public CustomerController customerController() {
if(someConditionsAreMet())
return type1CustomerController.get();
//Otherwise return type2 customer controller
return type2CustomerController.get();
}
}
Now when the Type2CustomerController
is selected, everything works fine.
When the Type1CustomerController
, disaster strikes:
Method not found: class com.mycompany.view.internal.controller.customer.Type1CustomerController$Proxy$_$$_WeldClientProxy.registerCustomer()
at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:109)
at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:87)
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
What can be the issue, that the superclass method, overriden in the Type1Controller is not found by EL?