This means, that for some reason class InputPageBean wasn't found at runtime. That can happen if com.example.InputPageBean wasn't properly deployed and is being missed from classpath.
Checklist:
* Check if your class file (not the ".java" file) is on the class path of your webapp. Your class file should be in webapp/WEB-INF/classes/com/example.
* Check for typos in the faces-config.xml file, verify the package and the class name
* Check the POJO default constructors if are properly implemented because there are cases you have overide it.
* Check for compiler errors
Thursday, October 2, 2008
IllegalArgumentException:argument type mismatch
Code:
Error Message:
2005-01-18 14:34:18 StandardWrapperValve[Faces Servlet]: Servlet.service() for servlet Faces Servlet threw exception
javax.faces.el.EvaluationException: java.lang.IllegalArgumentException: argument type mismatch at......
What you wanted to use is the value attribute, not the binding attribute.
Solution:
If you declare the "value" attribute you use "Value Binding" expressions. They are used to refer to properties in your bean.
Example: value="${userBean.userName}" refers to the username property in your userBean instance. Your userBean should have accessors methods for the "userName" property: setUserName(String name) and getUserName()
Declaring the "binding" attribute you use "Component Binding" expressions. With this attribute you refer to the entire component instance.
Example:assuming "result" refers to a UIInput component instance: binding="${userBean.result}" Then in your userBean, you would have:
private UIInput result;
public UIInput getResult() {
return result;
}
public void setResult(UIInput result) {
this.result = result);
}
Error Message:
2005-01-18 14:34:18 StandardWrapperValve[Faces Servlet]: Servlet.service() for servlet Faces Servlet threw exception
javax.faces.el.EvaluationException: java.lang.IllegalArgumentException: argument type mismatch at......
What you wanted to use is the value attribute, not the binding attribute.
Solution:
If you declare the "value" attribute you use "Value Binding" expressions. They are used to refer to properties in your bean.
Example: value="${userBean.userName}" refers to the username property in your userBean instance. Your userBean should have accessors methods for the "userName" property: setUserName(String name) and getUserName()
Declaring the "binding" attribute you use "Component Binding" expressions. With this attribute you refer to the entire component instance.
Example:assuming "result" refers to a UIInput component instance: binding="${userBean.result}" Then in your userBean, you would have:
private UIInput result;
public UIInput getResult() {
return result;
}
public void setResult(UIInput result) {
this.result = result);
}
Common errors in Java Server Faces (JSF)
Basically, when you are developing your applications for the first time using Java Server Faces (JSF) most likely you encounter errors. To deal with this common errors in JSF, I made some pages in this blog that presents some of the ways to solve your problem.
Below are the list of common errors in JSF. Just click on it to read the details on how to deal with that kind of error.
Below are the list of common errors in JSF. Just click on it to read the details on how to deal with that kind of error.
- IllegalArgumentException:argument type mismatch
- javax.faces.FacesException: Can't instantiate class: 'com.example.InputPageBean' ?
- javax.faces.el.PropertyNotFoundException: Error testing property 'name' in bean of type null ?
- JspException; Duplicate component id: '_id0:_id14', first used in tag: ?
- ReferenceSyntaxException: how to use numbers as resource bundle message references?
- javax.servlet.jsp.JspException: Argument Error: One or more parameters are null ?
- ClassNotFoundException on Tomcat startup: ConfigureListener missing ?
Subscribe to:
Posts (Atom)