Strange FacesException

Plz all,

I just try to develop first JSF app. But I've problem in it.

I've bean called UserNumber, it has one property called number, setter and getter.

When i run application this Exception appeared

"Can't set managed bean property: 'number'"

Why this ?

[304 byte] By [CSDevelopera] at [2007-11-27 1:32:35]
# 1
Which object type is it? Have you definied it in the managed-property in the faces-config.xml if so, how did you it?
BalusCa at 2007-7-12 0:37:15 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

Thanks for reply,

Type object of what ?

yes, I defined it in faces-config.xml.

But i didn't mention that this bean has an operation called logon( ).

This is the code of UserNumber

public class UserNumber {

int number;

public UserNumber(){

}

public int getNumber() {

return number;

}

public void setNumber(int userNumber) {

this.number = userNumber;

}

public String logon(){

if(number == 9)

return "Success";

else

return "Fail";

}

}

CSDevelopera at 2007-7-12 0:37:15 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

With object type I mean, which kind of object is it?

Well, it appears that it's just the primitive int :)

Why have you definied it in the faces-config.xml? Do you have special purposes or didn't you just know what you're doing? If the last, then just remove it from the faces-config.xml. If the first, then you have to define it as Integer in the bean as well as the faces-config, otherwise it will be expected as a String.

BalusCa at 2007-7-12 0:37:15 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
Thanks for ur help. My app. run now.But,>Why have you definied it in the faces-config.xml?Really i don't know. but exadel plugin defined it automatically.
CSDevelopera at 2007-7-12 0:37:15 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...