Error message when I am entering a non String SpEL expression in spring-config.xml

I have created a spring application and when I am trying to enter a non-String SpEL expression in the spring-config.xml I get an error (but the project runs fine, since I am not doing anything wrong).
Here is an example : :

public class InjectSimpleSpel {
    private String name;
    private int age;
    private float height;
    private boolean programmer;
    private Long ageInSeconds;

    public void setName(String name) { = name;

    public void setAge(int age) {
        this.age = age;

    public void setHeight(float height) {
        this.height = height;

    public void setProgrammer(boolean programmer) {
        this.programmer = programmer;

    public void setAgeInSeconds(Long ageInSeconds) {
        this.ageInSeconds = ageInSeconds;

    //other methods
    public String toString() {
        return "Name :" + name + "\n"
                + "Age:" + age + "\n"
                + "Age in Seconds: " + ageInSeconds + "\n"
                + "Height: " + height + "\n"
                + "Is Programmer?: " + programmer;

and here is the part of the spring-config.xml that produces the error (all the value properties except from the first one):

<bean id="injectSimpleSpel" >
        <property name="name">
        <property name="age">
            <value>#{injectSimpleConfig.age + 1}</value>
        <property name="height">
        <property name="programmer">
        <property name="ageInSeconds">

The error I get from the four value properties after the first one is like this one :

Cannot convert string #{injectSimpleConfig.age + 1} to target class int

Please sign in to leave a comment.