This error means that when you bind, the value of the binding is not an Object. This error is caused by the JDK version. Some JDK versions support converting directly from int to Integer, which can be compiled through. Your JDK probably doesn’t support this. There are two ways to solve this problem: First, ignore the JDK version, such as if you originally had session.setattribute (“count”,count); Count is an int, so you can use Integer countObj = integer.valueof (count); SetAttribute (“countObj”,countObj); Option 2: Project folder, properties,Java Compiler change Compiler Compliance lever to 1.6